EUROCOMB 2021

Strongly Pfaffian Graphs

Maximilian Gorsky, Raphael Steiner, and Sebastian Wiederrecht

Technische Universit¨atBerlin [email protected] [email protected] [email protected]

Abstract: An orientation of a graph G is Pfaffian if every even cycle C such that G−V (C) has a has an odd number of edges oriented in either direction of traversal. Graphs that admit a Pfaffian orientation permit counting the number of their perfect matchings in polynomial time. We consider a strengthening of Pfaffian orientations. An orientation of G is strongly Pfaffian if every even cycle has an odd number of edges directed in either direction of the cycle. We show that there exist two graphs S1 and S2 such that a graph G admits a strongly Pfaffian orientation if and only if it does not contain a graph H as a subgraph which can be obtained from S1 or S2 by subdividing every edge an even number of times. Combining our main results with a result of Kawarabayashi et al. we show that given any graph the tasks of recognising whether the graph admits a strongly Pfaffian orientation and constructing such an orientation provided it exists can be solved in polynomial time.

1 Introduction

All graphs considered in this article are finite and do not contain loops. We also exclude parallel edges, unless we explicitly address the graphs as multi-graphs. Let G be a graph and F ⊆ E(G) be a set of edges. F is called a matching if no two edges in F share an endpoint, a matching is perfect if every vertex of G is contained in some edge of F . A subgraph H of G is conformal if G − V (H) has a perfect matching, and finally an orientation of G is a digraph G~ such that (u, v) or (v, u) is an edge of G~ if and only if uv ∈ E(G), and G~ does not contain (u, v) and (v, u) at the same time. An even cycle C of G is oddly oriented by an orientation G~ if it has an odd number of edges directed in either direction around C. An orientation G~ of G is Pfaffian if G has a perfect matching and every even conformal cycle C is oddly oriented by G~ . A graph G is called Pfaffian if it admits a Pfaffian orientation. Pfaffian orientations are significant as, given that a graph G admits a Pfaffian orien- tation, the number of perfect matchings of G can be computed in polynomial time. In general, the problem of counting the number of perfect matchings in a graph is polynomial-time equivalent to of a matrix, which is known to be ]P-hard [11]. By utilising a deep theorem of Lov´asz[5], Vazirani and Yannakakis [12] proved that, in terms of complexity, recognising a Pfaffian graph and finding a Pfaffian orientation can be seen as the same problem. Theorem 1 ([12]) The decision problems ‘Is a given orientation of a graph Pfaffian?’ and ‘Is a given graph Pfaffian?’ are polynomial-time equivalent. 1 Research Perspectives CRM Barcelona, Summer 20XX, vol. XX, in Trends in Mathematics Springer-Birkh¨auser,Basel 2 Strongly Pfaffian Graphs

Let H be a graph and e ∈ E(H) be some edge of H. We say that a graph H0 is obtained from H by subdividing, or respectively bisubdividing, the edge e, if H0 can be obtained from H be replacing e with a path of positive length, or respectively a path of odd length (possibly length one), whose endpoints coincide with the endpoints of e and whose internal vertices do not belong to H. A graph H00 is a emphsubdivision, or respectively a bisubdivision, of H if it can be obtained by subdividing, or respectively bisubdividing, all edges of H. Notably, bisubdivision preserves path- and cycle-parities. There exists a precise characterisation of Pfaffian bipartite graphs in terms of forbid- den bisubdivisions. Theorem 2 ([4]) A G is Pfaffian if and only if it does not contain a conformal bisubdivision of K3,3. While Theorem 2 characterises all Pfaffian bipartite graphs it does not immediately yield a polynomial time recognition algorithm. Such an algorithm was later found by McCuaig [6] and, independently, by Robertson et al. [8]. The case of non-bipartite Pfaffian graphs appears to be more illusive, and it remains an important open problem in whether Pfaffian graphs can be recognised in polynomial time. For several graph classes including non-bipartite graphs characteri- sations of Pfaffian graphs in these classes are known (see [2, 1]), but whether they can be recognised in polynomial time appears to be open. Moreover, there is no hope that all non-bipartite Pfaffian graphs can be described by excluding a finite number of minimal obstructions in a fashion similar to Theorem 2 [7]. For more Information on Pfaffian orientations and related problems we refer the reader to [6, 9].

2 Main Results

Inspired by the inherent complexity of Pfaffian orientations, especially in non-bipartite graphs, we investigate a stronger, and therefore more restrictive version of Pfaffian ori- entations. Definition 3 Let G be a graph. An orientation G~ of G is strongly Pfaffian if every even cycle C of G is oddly oriented by G~ . A graph G that admits a strongly Pfaffian orientation is called strongly Pfaffian.

S1 S2

Figure 1. The two obstructions for strongly Pfaffian graphs.

Surprisingly, for the class of strongly Pfaffian graphs it suffices to exclude bisubdivi- sions of S1 and S2 (see Figure 1), as subgraphs to characterise the entire class. Theorem 4 A graph G is strongly Pfaffian if and only if it does not contain a bisubdi- vision of S1 or S2 as a subgraph. And furthermore, thanks to the results in [3], Theorem 4 allows us to deduce that the task of recognising strongly Pfaffian graphs can be performed in polynomial time, since we can simply check for the existence of the bisubdivided versions of S1 and S2. EUROCOMB 2021 3

Theorem 5 ([3]) Let H be a fixed graph, and for each edge e ∈ E(H) let a value p(e) ∈ {0, 1} be fixed. There exists a polynomial time algorithm for testing if a given graph G contains a subdivision of H in which for every e ∈ E(H) the length of the subdivision-path representing e is congruent to p(e) modulo 2. Corollary 6 Strongly Pfaffian graphs can be recognised in polynomial time. Similar to Theorem 1, we can additionally show the following. Theorem 7 Given a strongly Pfaffian graph, a strongly Pfaffian orientation can be constructed in polynomial time. Consequently given a graph G, we can test whether it is strongly Pfaffian and con- struct a strongly Pfaffian orientation in polynomial time.

3 A Structural Characterisation of Strongly Pfaffian Graphs

Let S be the class of graphs which do not contain bisubdivisions of S1 or S2 as subgraphs. In order to show Theorem 4, we need to show that (1) every strongly Pfaffian graph is contained in S and (2) every graph in S admits a strongly Pfaffian orientation. An important tool when working with strongly Pfaffian orientations is the switching operation. For this let G~ be an orientation of a graph G and let v ∈ V (G). Then switching at v in G~ means reversing all arcs of G~ incident with v to obtain a modified orientation of G. We say that two orientations of a graph are switching-equivalent if one can be obtained from the other by a sequence of switchings. Observe that if G~ 1 and G~ 2 are switching-equivalent orientations of the same graph, then G~ 1 is strongly Pfaffian if and only the same holds for G~ 2. Using this fact we can give a short proof of (1). Lemma 8 If G is a strongly Pfaffian graph, then G ∈ S. Proof. Since every subgraph of a strongly Pfaffian graph is strongly Pfaffian, it suffices to show that no bisubdivision of S1 or S2 is strongly Pfaffian. First let G be a bisubdivision of S1 and suppose towards a contradiction that a strongly Pfaffian orientation G~ of G exists. Let u, v be the unique vertices of degree three in G and let P1,P2,P3 be the three disjoint u-v-paths in G. Since G is a bisubdi- vision of S1, all three paths P1,P2,P3 have even length. Pause to note that by applying vertex-switchings, we may find a strongly Pfaffian orientation G~ 0 of G that is switching- 0 equivalent to G~ such that P1,P2 − v, P3 − v each form directed paths in G~ starting at 0 u. Since the cycles P1 ∪ P2 and P1 ∪ P3 must be oddly oriented by G~ , the last edges of both P2 and P3 must start in v. However, this means that the cycle P2 ∪ P3 has an even number of edges oriented in either direction in G~ 0, a contradiction showing that G is not strongly Pfaffian. Next suppose that G is a bisubdivision of S2. Let v1, v2, v3, v4 be the vertices of degree three in G and for i, j ∈ {1, 2, 3, 4}, let Pi,j be the subdivision-path of G connecting vi and vj. Possibly after relabelling, we may assume that Pj,4 is even for j ∈ {1, 2, 3} and P1,2,P2,3,P1,3 are odd. Suppose towards a contradiction that there exists a strongly Pfaffian orientation G~ of G. Possibly by performing switchings, we may assume w.l.o.g. that Pj,4 is directed from vj to v4 for j ∈ {2, 3, 4}. For j ∈ {1, 2, 3}, let pj be the number of forward-edges on Pj,j+1 when traversing it from vj to vj+1 (where 3 + 1 := 1). By the pigeon-hole principle, we have pj ≡ pj+1(mod 2) for some j ∈ {1, 2, 3}, w.l.o.g. j = 1. 4 Strongly Pfaffian Graphs

Now P1,2 ∪ P2,3 ∪ P3,4 ∪ P4,1 is an even cycle in G whose number of edges oriented in either direction is even. This contradiction shows that G is not strongly Pfaffian.  The main work for Theorem 4 needs to be done when proving (2). Here our approach is as follows: We give an explicit description of all graphs in the class S and then later construct strongly Pfaffian orientations for all of these graphs. We start by observing that it is sufficient to prove (2) for 2-vertex-connected graphs: As is easily noted, a graph is contained in S if and only if the same is true for each of its blocks (maximal 2-connected subgraphs). Similarly, given a strongly Pfaffian orien- tation of each block of a graph, the union of these orientations forms a strongly Pfaffian orientation of the whole graph (since every even cycle is contained in one of the blocks). As a next step we reduce the proof of (2) to the case of subdivisions of 3-vertex- connected multi-graphs. In order to do so, we consider an operation that decomposes 2-connected graphs along 2-vertex-separations while preserving important information concerning parities of path lengths. Definition 9 Let G be a 2-vertex-connected graph, and let u, v ∈ V (G) be distinct vertices such that {u, v} forms a separator of G. Let H1,H2 be connected subgraphs of G such that V (H1) ∪ V (H2) = V (G), V (H1) ∩ V (H2) = {u, v}. Finally, for i ∈ {1, 2} let Gi be a supergraph of Hi obtained as follows: If there exists an odd u, v-path in H3−i, then add an edge uv to Hi (unless it already exists). If there exists an even u-v-path in H3−i, then add a new vertex w∈ / V (Hi) to Hi and connect it to u and v. Perform both operations simultaneously if both an even and an odd path from u to v in H3−i exists. With these definitions, we say that G is a parity 2-sum of the two graphs G1 and G2. The following result describes how parity sums interact with the class S and strongly Pfaffian graphs. Due to the space restrictions, we leave its proof to the reader.

Lemma 10 Let G be the parity 2-sum of two graphs G1 and G2. Then:

• G ∈ S if and only if G1,G2 ∈ S. • G is strongly Pfaffian if and only if G1 and G2 are strongly Pfaffian. Using Lemma 10, it suffices to prove (2) for 2-vertex-connected graphs that cannot be written as the parity 2-sum of two smaller graphs. It is not hard to see that such graphs either have at most 2 vertices of degree larger than two (in this case, the proof of (2) becomes quite trivial); or they are subdivisions of 3-vertex-connected multi-graphs such that every subdivision-path has length at most two, and two parallel subdivision-paths only exist in the form of a direct edge and a 2-edge-path between the same two branch vertices. Since neither S1 nor S2 use two parallel subdivision-paths of this type, it turns out that a graph G as described above is contained in S if and only if the same is true for every subdivision of a 3-connected simple graph contained in G (obtained by ignoring one of the two subdivision-paths of each parallel pair). Hence, in order to describe all such graphs that are contained in S, we can further reduce to subdivisions of 3-connected simple graphs. To handle this case, we use the following key lemma. Lemma 11 Let G ∈ S be a subdivision of a 3-connected simple graph H. Then either (A) V (H) is the disjoint union of two induced cycles whose subdivisions in G are odd, or (B) for every odd cycle C in G the graph G − V (C) is a forest. EUROCOMB 2021 5

Sketched proof. We rely on two central observations. Let G be as in Lemma 11. First, we observe that if C1 and C2 are respectively even and odd cycles within G, then V (C1) ∩ V (C2) 6= ∅. If this was not true consider three internally disjoint paths connecting C1 and C2 in G, which are guaranteed by the 3-connectivity of H. Without much effort, it can be deduced that no matter which parities these three paths respectively possess, we are guaranteed to find a bisubdivision of S1 in G, contradicting G ∈ S. The second observation is slightly trickier. Let C1 and C2 be two disjoint odd cycles in G, then we claim that C1 and C2 contain all vertices of degree three or higher, and 0 0 the underlying cycles C1 and C2 of C1 and C2 are induced in H. Consider a vertex v 6∈ V (C1) ∪ V (C2) for which two paths P and Q with V (P ) ∩ V (Q) = {v} exist such that both P and Q end on Ci and do not intersect C3−i, for i ∈ {1, 2}. Now clearly Ci ∪ P ∪ Q contains an even cycle disjoint from C3−i, contradicting our first observation. 0 0 Thus we already know that the underlying cycles C1 and C2 of C1 and C2 are induced in H, as we can otherwise find such a vertex v on a subdivided chord of C1 or C2. (Note in particular that H is a simple graph and thus no parallel edges will disturb our cycles.) Finally, if there exists a vertex u of degree three or higher outside V (C1) ∪ V (C2), then we can again use the 3-connectedness of H to find three internally disjoint paths between u and V (C1) ∪ V (C2). By the pigeonhole principle, two of these paths must now violate the condition we have just established for the vertices outside of V (C1) ∪ V (C2). From these two observations it is easy to derive the characterisation presented in the statement of the lemma.  Using the two cases suggested by Lemma 11 we can derive a partition of the graphs in S which are subdivisions of 3-connected graphs into four classes and a handful of sporadic examples. This process is quite arduous and we omit the explicit definitions of the graphs from this article and opt instead to provide examples for each of the classes. The prismoids (see I), and five of the sporadic examples, all closely related to the

(I) A prismoid. (II) A wheeloid. (III) A C4-cockade (IV) A m¨obioid. with a handle.

Figure 2. Representatives for the four classes. prismoids, correspond to property A mentioned in Lemma 11. The wheeloids (see II), C4-cockades with handles (see III), m¨obioids (see IV) and a specific subdivision of K5 all correspond to property B in Lemma 11. The subdivision of K5 and the m¨obioidsare notably the only non-planar graphs in S. Using the structure of each of the classes, we can give concrete proofs for the existence of strongly Pfaffian orientations for all their members. For the sporadic examples we can even give the orientations explicitly. This can then easily be extended to subdivisions of 3-connected multi-graphs as described above, all in all showing that every graph in S admits a Pfaffian orientation. Using this approach we verify (2) and hence conclude the proof of Theorem 4. We conclude this abstract by sketching the proof of Theorem 7. 6 Strongly Pfaffian Graphs

Proof Sketch for Theorem 7. Let G be a strongly Pfaffian graph given as input. Our goal is to construct a strongly Pfaffian orientation of G. We first check whether G is 2-connected graph. If not, we compute a block decomposition of G in polynomial time and recurse on the blocks. If G is 2-connected, we check whether G is bipartite. If so, by combining Theorem 4 with Theorem 3.1 in the paper [10] it follows that there exists 0 1 0 a supergraph G of G which is a C4-cockade . We can then compute G and construct a strongly Pfaffian orientation of G0 with a simple inductive process in polynomial time. We then return the restriction of this orientation to G. If G is non-bipartite, we compute and fix an induced odd cycle C in G. We compute an ear-decomposition C = G0 ⊆ G1 · · · ⊆ Gm = G of G consisting of 2-connected graphs such that Gi is obtained from Gi−1 by adding a handle. Using switchings we may now successively find strongly Pfaffian orientations of Gi, i = 0, ..., m, each of which is extendable to an strongly Pfaffian orientation of G. We start by orienting G0 = C as a directed cycle. The fact that this orientation is extendable to a strongly Pfaffian orientation of G follows since switchings and reversing all arcs of an orientation preserves strongly Pfaffian orientations. Now suppose we have oriented Gi−1 for some 1 ≤ i ≤ m. Let v0, ..., vk be the vertex-trace of the handle, we add to Gi−1 to obtain Gi. Using switchings we orient all edges vi−1vi, 1 ≤ i < k from v0 towards vk−1. Since G is strongly Pfaffian, at least one of the two possible orientations of vk−1vk results in a strongly Pfaffian orientation of Gi that is extendable to G. Since Gi−1 contains the odd cycle C and is 2-connected, there exists an 0 0 even cycle C in Gi containing vk−1vk. We orient vk−1vk such that C is oddly oriented. After carrying the process through, eventually we may output the resulting strongly Pfaffian orientation of G = Gm.  References

[1] De Carvalho MH, Lucchesi CL, Murty US. A generalization of Little’s Theorem on Pfaffian orien- tations. J. Combin. Theory, Ser. B. 2012; 102(6):1241-66. [2] Fischer I, Little CH. A characterisation of Pfaffian near bipartite graphs. J. Combin. Theory, Ser. B. 2001; 82(2):175-222. [3] Kawarabayashi K., Bruce R., Paul W. The algorithm with parity conditions. In Pro- ceedings FOCS 2011, 27–36, 2011. [4] Little CH. A characterization of convertible (0, 1)-matrices. J. of Combin. Theory, Ser. B. 1975; 18(3):187-208. [5] Lov´aszL. Matching structure and the matching lattice. J. Combin. Theory, Ser. B. 1987; 43(2):187- 222. [6] McCuaig W. P´olya’s permanent problem. Electron. J. Combin. 2004; 6:R79. [7] Norine S, Thomas R. Minimally non-Pfaffian graphs. J. Combin. Theory, Ser. B. 2008; 98(5):1038-55. [8] Robertson N, Seymour PD, Thomas R. Permanents, Pfaffian orientations, and even directed circuits. Ann. of Math. 1999; 1:929-75. [9] Thomas R. A survey of Pfaffian orientations of graphs. In Proceedings of the ICM 2006 (Vol. 3, pp. 963-984). [10] Thomassen C. Sign-nonsingular matrices and even cycles in directed graphs. Linear Algebra Appl. 1986; 75:27-41. [11] Valiant LG. The complexity of computing the permanent. Theoretical Comput. Sci. 1979; 8(2):189- 201. [12] Vazirani VV, Yannakakis M. Pfaffian orientations, 0–1 permanents, and even cycles in directed graphs. Discrete Appl. Math. 1989; 25(1-2):179-90.

1This is a certain bipartite variant of a 2-tree which is defined in [10].