2018 IEEE 59th Annual Symposium on Foundations of Computer Science

Planar Graph is in NC

Nima Anari Vijay V. Vazirani Computer Science Department Computer Science Department Stanford University University of California, Irvine [email protected] [email protected]

Abstract—Is perfect matching in NC? That is, is there a finding a perfect matching, was obtained by Karp, Upfal, and deterministic fast parallel algorithm for it? This has been an Wigderson [11]. This was followed by a somewhat simpler outstanding open question in theoretical computer science for algorithm due to Mulmuley, Vazirani, and Vazirani [17]. over three decades, ever since the discovery of RNC matching algorithms. Within this question, the case of planar graphs has The matching problem occupies an especially distinguished remained an enigma: On the one hand, counting the number position in the theory of algorithms: Some of the most of perfect matchings is far harder than finding one (the former central notions and powerful tools within this theory were is #P-complete and the latter is in P), and on the other, for discovered in the context of an algorithmic study of this NC planar graphs, counting has long been known to be in problem, including the notion of polynomial time solvability whereas finding one has resisted a solution. P In this paper, we give an NC algorithm for finding a perfect [4] and the counting class # [22]. The parallel perspective matching in a planar graph. Our algorithm uses the above- has also led to such gains: The first RNC matching algorithm stated fact about counting matchings in a crucial way. Our led to a fundamental understanding of the computational main new idea is an NC algorithm for finding a face of the relationship between search and decision problems [10] and perfect matching polytope at which many new conditions, in- the second algorithm yielded the Isolation Lemma [17], which volving constraints of the polytope, are simultaneously satisfied. Several other ideas are also needed, such as finding a point in has found several applications in complexity theory and the interior of the minimum weight face of this polytope and algorithms. Considering the fundamental insights gained by finding a balanced tight odd set in NC. an algorithmic study of matching, the problem of obtaining NC Keywords-parallel algorithm; planar graph; perfect match- an algorithm for it has remained a premier open question ing; Tutte ; Pfaffian; ever since the 1980s. The first substantial progress on this question was made I. INTRODUCTION by Miller and Naor [16]. They gave an NC algorithm for Is perfect matching in NC? That is, is there a deterministic finding a perfect matching in bipartite planar graphs using a parallel algorithm that computes a perfect matching in a graph flow-based approach. Later, Mahajan and Varadarajan [15] NC in polylogarithmic time using polynomially many processors? gave an elegant way of using the algorithm for counting This has been an outstanding open question in theoretical perfect matchings to finding one, hence giving a different NC computer science for over three decades, ever since the algorithm for bipartite planar graphs. Our algorithm is discovery of RNC matching algorithms [11, 17]. Within this inspired by their approach. question, the case of planar graphs had remained an enigma: In the last few years, several researchers have obtained quasi NC For general graphs, counting the number of perfect matchings - algorithms for matching and its generalizations; such algorithms run in polylogarithmic time though they is far harder than finding one: the former is #P-complete O(1) O nlog n [22] and the latter is in P [4]. However, for planar graphs, a require ( ) processors. These algorithms achieve polynomial time algorithm for counting perfect matchings a partial derandomization of the Isolation Lemma for the was found by Kasteleyn, a physicist, in 1967 [12], and an specific problem addressed. Several nice algorithmic ideas NC algorithm follows easily1, given an NC algorithm for have been discovered in these works and our algorithm has computing the of a matrix, which was obtained benefited from some of these; in turn, it will not be surprising by Csanky [2] in 1976. On the other hand, an NC algorithm if some of our ideas turn out to be useful for the resolution of for finding a perfect matching in a planar graph has resisted the main open problem. First, Fenner, Gurjar, and Thierauf [6] quasi NC a solution. In this paper, we provide such an algorithm. gave a - algorithm for perfect matching in bipartite An RNC algorithm for the decision problem, of deter- graphs, followed by the algorithm of Svensson and Tarnawski mining if a graph has a perfect matching, was obtained [21] for general graphs. Algorithms were also found for the by Lovasz´ [13], using the Tutte matrix of the graph. The generalization of bipartite matching to the linear matroid first RNC algorithm for the search problem, of actually intersection problem by Gurjar and Thierauf [7], and to a further generalization of finding a vertex of a polytope with 1For a formal proof, in a slightly more general context, see [23]. faces given by totally unimodular constraints, by Gurjar,

2575-8454/18/$31.00 ©2018 IEEE 650 DOI 10.1109/FOCS.2018.00068 S 1 C 3 in section III-B. These introduce a second way for a cycle 1 1 3 3 to be blocked, namely an odd set S, whose cut intersects C, 1 − 1 1 1 3 1 3 3 may go tight (section V-A) and the for this cycle cannot 3 3 S 1 1 1 1 be increased without moving outside the polytope. Thus the 3 + 3 + 3 1 3 3 cycle will not lose an edge. However, notice that since one 1 − 1 3 3 of the odd set constraints has gone tight, we are already at (a) (b) a face of lower dimension! In this case, we will say that C S Figure 1. (a) Even cycle blocked by an odd set constraint. Example due cycle is blocked by odd set . For an example, see fig. 1a to [6, 21]. (b) Resulting graph after shrinking the blocking tight odd set. in which the point inside the polytope is the all 1/3 vector and the highlighted cycle is blocked by odd set S. Observe Thierauf, and Vishnoi [8]. that the rotation chosen on the highlighted cycle leads to Our main theorem is the following. infeasibility on cut S. Theorem 1. There is an NC algorithm that for any given How do we capitalize on this progress? The obvious idea, planar graph, either returns a perfect matching in it, or which happens to need substantially many additional ideas to NC S reports that it has none. get to an algorithm, is to shrink , find a perfect matching in the shrunk graph, expand S, remove the matched vertex In the full version of our paper we generalize theorem 1 from it, and find a perfect matching on the remaining vertices to finding a minimum weight perfect matching if the of S. For an example of the shrunk graph, see fig. 1b. It edge weights are polynomially bounded and to finding a is easy to see that at least one edge of C must have both perfect matching in graphs of bounded genus; their common endpoints in S, and therefore the shrunk graph has fewer generalization easily follows. edges than the original. As stated above, a number of new ideas are needed to II. OVERVIEW AND TECHNICAL IDEAS make this rough outline yield an NC algorithm. First, a small Due to space constraints, we defer many proofs to the full hurdle: If G is nonbipartite planar, the procedure of Mahajan version of this paper. In this section we give an overview of and Varadarajan [15] will find Ω(n) edge-disjoint faces; the main ideas behind our algorithm. however, not all of these faces may be even. In fact, there are matching covered planar graphs having only one even A. The Mahajan-Varadarajan algorithm and difficulties im- face. To get around this, we use even walks: it consists of posed by odd cuts either an even cycle or two odd cycles with a path connecting We first give the idea behind the NC algorithm of Mahajan them (section III-C). We give an NC algorithm for finding and Varadarajan [15] for bipartite planar graphs. W.l.o.g. Ω(n) edge-disjoint even walks in G (section VI-B). assume that the graph is matching covered, i.e., each edge is in a perfect matching. Using an oracle for counting the B. A key algorithmic issue and its resolution number of perfect matchings, they find a point x in the A walk is blocked if it loses an edge or if an odd cut interior of the perfect matching polytope and they show how intersecting it goes tight. Either way, we reduce the dimension. to move this point to lower dimensional faces of the polytope However, a new challenge arises: In the first case, the amount until a vertex is reached. In a matching covered bipartite of rotation required to make the walk lose an edge is easy planar graph, every planar face can be used to modify x to compute, similar to the bipartite case. But in the second by increasing and decreasing alternate edges by the same case, how do we find the smallest rotation so an odd cut (small) amount , and this moves the point inside the polytope; intersecting the walk goes just tight? Note that we seek this is called a rotation of the cycle. Increasing , at some the “smallest” rotation so no odd cut goes under-tight. We point an edge e gets zero. When this happens, cannot be postpone the answer until we address the next hurdle. increased anymore and the cycle is blocked. If so, the point x Next, we state a big hurdle: As in the bipartite case, to moves to a lower (by at least one) dimension face. To make make substantial progress, we need to move the point x to substantial progress, they observe that for any set of edge- a face of the polytope where each of the Ω(n) even walks disjoint faces, this process can be executed independently is blocked. In the bipartite case, we could modify all cycles in parallel on cycles corresponding to each face, thereby independently in parallel. However, in the nonbipartite case, reaching a face of the polytope of correspondingly lower executing these moves in parallel may take the point outside dimension. Finally, they show how to find Ω(n) edge-disjoint the polytope. These two cases are illustrated in figs. 2a and 2b. faces in NC, thereby terminating in O(log n) such iterations. The reason is that whereas rotations on two different walks The fundamental difference between the perfect matching may be individually feasible, executing them both may make polytopes of bipartite and nonbipartite graphs is the additional an odd set go under-tight. This is depicted in fig. 3a. constraint in the latter saying that each odd subset, S,of The following idea helps us get around this hurdle: It vertices must have at least one edge in the cut δ(S); see eq. (1) suffices to find a weight function on edges, w, so that one

651 none of these walks loses an edge, then the dimension of O k • + • • + • the face we end up on may not be smaller by ( ). There could be very few, or even one, tight odd cut that intersects each of the walks. However, each walk will have at least ⇓ ⇓ one edge in a tight odd set, and therefore shrinking them will result in O(k) edges being shrunk. Hence, the number of edges works as a measure of progress. • • C. The rest of the ideas A number of ideas are still needed to get to an NC algo- (a) (b) rithm. First, for each walk that does not lose an edge, we Figure 2. (a) Parallel moves in the bipartite matching polytope. (b) Parallel need to find a tight odd cut intersecting it. For this, we use moves in the nonbipartite matching polytope. the result of Padberg and Rao [18] stating that the Gomory- Hu tree of a graph will contain a minimum weight odd cut. We show how to find a Gomory-Hu tree in a weighted planar minimizer of w, x graph in NC (section VI-C), a result of independent interest. − − const 2 2  = Next, consider a walk W which, w.r.t. the current point x ,x w +2 • in the polytope, is intersecting a tight odd cut. We rotate W x W S • walk slightly so the point becomes infeasible. Now crosses an under-tight cut, (lemma 10). Hence, w.r.t. x, each +1 minimum weight odd cut must be an under-tight cut that − − 1 1 crosses W , and the Gomory-Hu tree must contain one of w them. Repeating this for all walks in parallel, we obtain a (a) (b) set of tight odd cuts that intersect each of the walks. Figure 3. (a) Odd set constraint violated when even walks are rotated However, these odd cuts may be crossing each other independently. (b) Minimizer of appropriate linear function x →w, x arbitrarily. Standard uncrossing techniques work sequentially blocks even walks. to produce a laminar family. But how do we find it in NC? of the half-spaces defined by w contains w itself and the We give a divide-and-conquer-based procedure that finds other contains, for each of our even walks, the direction the top level sets of one such laminar family; these top of its rotation. Then, at the minimizer of x →w, x in level sets can be shrunk simultaneously (section V-B). The the polytope each of the walks is blocked.Furthermore, the procedure works as follows: We partition the family of tight minimizer is still a feasible point, so no odd cut goes under- odd cuts into two (almost) equal subfamilies, recursively tight. This idea is illustrated in fig. 3b. Such a function w is “uncross” each subfamily to obtain its top level sets, and then easy to construct: in each even walk, pick the weight of any merge these two into one family of top level sets. Clearly one edge to be 1 and the rest 0 (section IV-B). the last step is the crux of the procedure. The key to it lies in observing that two families of top level sets have a simple Next, we need to find the minimizer of x →w, x.For intersection structure, which can be exploited appropriately. this, it suffices to construct an NC oracle for computing #Ge , w The proposed algorithm has now evolved to the following: the number of minimum weight matchings in G containing shrink all top level sets and recursively find a perfect matching the edge e. This oracle is constructed by finding a Pfaffian in the shrunk graph, followed by recursively finding a perfect orientation (section III-A) for G, appropriately substituting matching in each of the shrunk sets (after removing its for the variables in the Tutte matrix of G and computing matched vertex). This algorithm has polylog depth; however, the determinant of the resulting matrix (section VI-A). The it does not run in polylog time because of the following minimizer point, x, is the average of all corner points of the inherent sequentiality: matchings in the shrunk sets have to face minimizing the weight w. be found after finding a matching in the shrunk graph. Some clarifications are due at this point: First, let us answer We next observe that if we could find a balanced tight the opening question of this section, i.e., how to rotate just odd cut, we would be done by a simple divide-and-conquer one given walk so it gets blocked by one of the two ways? strategy: match any edge in the cut and find matchings in the Interestingly enough, at present we know of no simpler two sides of the cut recursively, in parallel. Notice that with method for one walk than for multiple walks (binary search this scheme, even though matchings in the two sides can be comes to mind but that is not an elegant, analytic solution). found only after finding a matching in the shrunk graph, the Second, in the bipartite case, we could use the decrease in latter can be done in constant time (and without any recursive the dimension as a measure of progress. In the nonbipartite k calls). Hence, the time taken is indeed polylog. However, case, however, when we rotate edge-disjoint walks, and finding a balanced tight odd cut is not straightforward. It

652 c c The perfect matching polytope, PM(G) is the convex hull a b a b b of indicator vectors of all perfect matchings: acdef e i h ⇒ i h ⇒ G {1 | M G}. def ghi PM( )=conv M is a perfect matching of f d g g E j j j For a weight vector w ∈ R on edges, we obtain minimum weight fractional and integral perfect matchings by x →w, x w x Figure 4. Shrinking repeatedly yields a balanced viable set. minimizing the linear function = e e e on PM(G). These form a face of PM(G) and will be denoted involves iteratively shrinking the top level sets found, finding by PM(G, w). even walks and moving to the minimum weight face in the A key step needed by our algorithm is finding a point on the shrunk graph, etc. (section IV-B). This is illustrated in fig. 4. face PM(G, w) in NC. This is accomplished by computing We show that O(log n) such iterations suffice for finding a a Pfaffian orientation for G and evaluating the Tutte matrix balanced tight odd cut. for appropriate substitutions of the variables. The point we find will be exactly the average of the vertices on the face III. PRELIMINARIES PM(G, w). We denote this average by avg(PM(G, w)): In this section, we will state several notions and algorithmic 1M primitives we need for our NC algorithm for finding a perfect G, w M:1M ∈PM(G,W ) . avg(PM( )) = |{M | 1 ∈ G, w }| matching in a planar graph. M PM( ) Lemma 1. Given a planar graph G =(V,E) and an integral A. The Tutte matrix and Pfaffian orientations E weight vector w ∈ Z represented in unary, there is an A key fact underlying our algorithm is that computing NC algorithm which returns avg(PM(G, w)). the number of perfect matchings in a planar graph lies in NC. Let G =(V,E) be an arbitrary graph.Let A be the We prove lemma 1 in section VI-A. G symmetric of G Obtain matrix T from A In general, a face of PM( ) is defined by setting a S by replacing for each edge (i, j) ∈ E, its two entries by xij particular set of inequalities to equalities. Let be the family and −xij. T is called the Tutte matrix for G. Its determinant of odd sets whose inequalities are set to equality. These will S ,S ∈S is nonzero as a polynomial iff G has a perfect matching. be called tight odd sets. Two such tight odd sets 1 2 However, computing this determinant is not easy: Simply are said to cross if they are not disjoint and neither is a S ∩ S writing it will require exponential space in general. subset of the other. If so, one can prove that either 1 2 S ∪ S S − S S − S Note that for each edge edge there are two ways of com- and 1 2 are also tight odd sets or 1 2 and 2 1 pleting the corresponding entry in T . These multiple ways are tight odd sets. In either case, we can uncross the initial of getting a Tutte matrix are in bijection with orientations sets and replace them by new ones that do not cross. The S of the graph. family is said to be laminar if no pair of sets in it cross. S A key fact underlying our algorithm is that when G is Given a family of tight odd sets , one can successively planar, there is an orientation which makes all of the nonzero uncross pairs to obtain a laminar family. For our purposes, terms in the determinant of T appear with the positive sign, we only need to work with the maximal sets in the laminar and this orientation can be found in NC [2]. This yields family. We define a notion of uncrossing for top-level sets an NC algorithm to solve the decision problem of checking and show how they give us the space of equality constraints, whether G has a perfect matching. by defining things appropriately. B. The perfect matching polytope and tight odd sets C. Finding maximal independent sets and even walks One of the ingredients we use in multiple ways to design The perfect matching polytope for G =(V,E) is defined RE our algorithm is that a maximal independent set in a graph in and is given by the following set of linear equalities NC and inequalities [3]. can be found in . NC ⎧ ⎫ Lemma 2 ([14]). There is an algorithm for finding some 1 ,x ∀v ∈ V, maximal independent set in an input graph G =(V,E). ⎨ δ(v) =1 ⎬ x ∈ RE 1 ,x≥ ∀S ⊂ V, |S| , ⎩ δ(S) 1 with odd ⎭ Mahajan and Varadarajan [15] used lemma 2 to find x ≥ ∀e ∈ E. e 0 linearly many edge-disjoint cycles in bipartite planar graphs. (1) We use a similar step, but instead of cycles we have to work We use the notation 1F to denote the indicator vector of a with even walks, i.e., cycles with possibly repeated edges. subset of edges F ⊆ E. For a subset of vertices S,welet δ(S) denote the edges that cross S, and by a slight abuse Definition 1. For this paper, an even walk is either a simple of notation we let δ(v)=δ({v}) denote the set of edges even length cycle in G or the following structure: Let C1 adjacent to vertex v. and C2 be two odd length edge-disjoint cycles in G and let

653 PERFECTMATCHING(G =(V,E)) In order for a step of the algorithm to make significant if |V | =0then progress, i.e., reduce the size of the graph by a constant factor, return ∅. we also require the viable set to be balanced. That is, we c ≤ |S| ≤ − c c > else require 1 |V | (1 1) for some small constant 1 0. Find a viable set S with |S|/|V |∈[c1, 1 − c1]. Throughout the paper we will assume several constant upper w ← 1 c c Let δ(S). bounds for 1. At the end 1 can be set to the lowest of these Let x ← avg(PM(G, w)). upper bounds. Select an arbitrary edge e ∈ δ(S) with xe > 0. Assuming that we are able to find a balanced viable set S NC Let G1 be the induced graph on S with the in , we can prove theorem 1. endpoint of e removed. Proof of theorem 1: Since the set S found by fig. 5 N Let G2 be the induced graph on V − S with the is feasible, there is at least one perfect matching with endpoint of e removed. |N ∩ δ(S)| =1. On the other hand, for the weight vector w 1 N w, 1  in parallel do = δ(S) and any perfect matching ,wehave N = M1 ← PERFECTMATCHING(G1). |N ∩ δ(S)|, which is always at least one. So the minimum M2 ← PERFECTMATCHING(G2). weight perfect matchings N are exactly those that have a single edge in the cut δ(S). The point x is the average of return M1 ∪ M2 ∪{e} these perfect matchings, so for any edge e with xe > 0, there Figure 5. Divide-and-conquer algorithm for finding a perfect matching. is at least one minimum weight perfect matching N  e. This shows that {e} can be extended to a perfect matching P be a path, edge-disjoint from C ,C , connecting vertex 1 2 without using any other edge of δ(S) and therefore proves v of C to vertex v of C ;ifv = v , P will be the empty 1 1 2 2 1 2 that G and G both have a perfect matching, an assumption path. Starting from v , traverse C , then P from v to v , 1 2 1 1 1 2 we need to be able to recursively call the algorithm. This then traverse C , followed by P from v to v . This will be 2 2 1 shows the correctness of the algorithm. a closed walk that traverses an even number of edges and We finish the proof by showing that the algorithm is in will also be called an even walk. NC. By lemma 1, we can compute the point x in NC, and Note that all of our walks start and end at the same location. we assumed the viable set S was found by an NC algorithm. We use lemma 2 to derive the following. We prove lemma 3 So all of the steps of each recursive call can be executed in in section VI-B. polylogarithmic time with a polynomially bounded number of processors. Notice that the recursion depth of the algorithm Lemma 3. Suppose that G =(V,E) is a connected planar is at most log / −c (|V |) which is logarithmic in the input graph with no vertices of degree 1 and at most |V |/2 vertices 1 (1 1) size. This is because the size of the graph gets reduced by a of degree 2. Then we can find Ω(|E|) edge-disjoint even walks factor of 1 − c in each recursive level. Since recursive calls in G by an NC algorithm. 1 are executed in parallel, this shows that the entire algorithm IV. MAIN ALGORITHM runs in polylog time. A. Divide-and-conquer procedure All that remains is finding a balanced viable set by an NC algorithm. This is done in section IV-B. In this section we will describe the algorithm we use to prove theorem 1. W.l.o.g. assume that the input graph has B. Finding a balanced viable set a perfect matching. We can easily check whether a perfect matching exists first, by counting the number of perfect In this section we describe how to find a balanced viable matchings in NC; see section III-A. set S in a graph G =(V,E) in NC. Notice that a single We use a divide-and-conquer approach. The pseudocode vertex is, by definition, a viable set, but is not balanced G V,E |V |≤ 1 |V | > 1 is given in fig. 5. Given a graph =( ), our algorithm unless c1 . So w.l.o.g. we can assume c1 . finds an odd set S ⊂ V , selects an edge e ∈ δ(S) as the first The main idea behind our algorithm is the following: edge of the perfect matching, and then recursively extends Suppose that we reduce the size of the graph G by either this to a perfect matching in S and V − S, without using removing edges not participating in perfect matchings from any other edge of the cut δ(S). it, or shrinking tight odd sets (both w.r.t. some weight vector Note that if M is the output of our algorithm, by definition, w). Any vertex in the shrunk graph corresponds to an odd |M ∩ δ(S)| =1. This prevents us from using an arbitrary set in the original graph G. This odd set is always viable. So odd set S ⊂ V in the first step and motivates the following if we manage to reduce the size of the shrunk graph enough definition. so that it contains at most 1/c1 vertices, then the largest of the viable sets we get this way would have size at least Definition 2. Given a graph G =(V,E), an odd set S is c |V |. By being careful when we remove edges or shrink called viable if there exists at least one perfect matching 1 pieces, we can also make sure the size is not larger than M ⊆ E with |M ∩ δ(S)| =1.

654 BALANCEDVIABLESET(G0 =(V0,E0)) REDUCE (G =(V,E), f : V0 → V ) Let G =(V,E) be a copy of G0 and let f : V0 → V be Find Ω(|E|) edge-disjoint even walks W1,...,Wk. the identity map. Let w ← 0, the zero weight vector. −1 while |f (v)|

655 i S {v ,v ,...,v } PREPROCESS (G =(V,E), f : V → V ) We claim that for any even , the set i = 0 1 i 0 t x Let x ← avg(PM(G)). is a tight odd set. To see this, let = (v0,v1). Then because v x − t for e ∈ E with xe =0in parallel do 1 has degree 2, it must be that (v1,v2) =1 . Then, this x t Remove e from G. means that (v2,v3) = , and so on. In the end, we get that x − t δ S Let G, f ← MAKECONNECTED(G, f). (vi−1,vi) =1 . Now, look at the edges in ( ). They are v v v while |{v ∈ V | deg(v)=2}| > |V |/2 do either adjacent to 0 or i. Those adjacent to 0 have a total Let G, f ← SHRINKDEGREETWOS(G, f). x value of 1 − t and those adjacent to vi have a total x value t 1 ,x t − t of .So δ(Si) = +(1 )=1. − Figure 8. The preprocessing step. Now let j be the first even index such that |f 1(Sj)|≥ c |V |. If no such index exists, we can simply shrink Sk or connected. We arrive at a connected graph where every edge 1 0 Sk (depending on the parity of k). Else, we claim that Sj participates in a perfect matching. This ensures that there are +1 is a balanced viable set. Viability follows from being a tight no vertices of degree 1, unless the entire graph is a single odd set. Being balanced follows because edge; but in that case we return f −1(v) as a balanced viable set for any of the two vertices. −1 −1 −1 −1 |f (Sj)| = |f (Sj−2)| + |f (vj−1)| + |f (vj)| After having a connected graph with no vertices of degree ≤ c |V | c |V | c |V |. 1, and no more than half of the vertices of degree 2,we 1 0 + 1 0 + 1 0 shrink them into other vertices by finding appropriate tight So as long as 3c1 ≤ (1 − c1), the set Sj is balanced and we odd sets. The while loop can be run at most a logarithmic can simply return it. number of times, because each time the number of vertices Having all ingredients, we finish the proof of lemma 6. gets reduced by a factor of 2. Proof of lemma 6: It is easy to see that the point M CONNECTED It remains to describe the procedures AKE x ∈ PM(G) remains a valid point throughout, i.e., it remains SHRINKDEGREETWOS and . Both of these procedures work in the matching polytope even after shrinking sets. This is x by shrinking tight odd sets w.r.t. . In both, we have to be because we only shrink tight odd sets w.r.t. x. Assume that slightly careful to avoid shrinking a large piece of the original the algorithm does not find a balanced viable set. |f −1 v | 0 where we used the fact that Cj is not the largest component − for all e ∈ E, since we removed all edges e with xe =0. in terms of f 1(Cj). So as long as c +1/2 < 1 − c ,we 1 1 We will prove the following: are done. This is clearly satisfied for small enough c1. Now let us describe SHRINKDEGREETWOS. First we Lemma 8. There is an NC algorithm DISJOINTODDSETS, identify all vertices of degree 2. Some of these vertices that either finds a balanced viable set, or finds disjoint tight might be connected to each other, in which case we get odd sets S1,...,Sl satisfying the following: In any Wi there paths formed by these vertices. We can extend these paths, is an edge e both of whose endpoints belong to some Sj. −1 by the doubling trick in polylog time to find maximal paths Furthermore |f (Sj)|

656 In section V-A we describe the procedure for finding a of lemma 9, and furthermore w, χW  < 0. Then there S ⊂ V 1 ,x tight odd set blocking an even walk. Then in section V-B, must be an odd set such that δ(S) =1and 1 ,χ   S we describe how to uncross these to get disjoint odd sets. δ(S) W =0. Furthermore such an can be found by y x W A. Finding a tight odd set blocking an even walk first obtaining as an -rotation of by , for a small but inverse exponentially large , and then finding a minimum In this section we describe how to find a tight odd set y 1 ,y odd cut in : argminS⊂V,|S| δ(S) . blocking a given even walk W . At a high level, we first is odd S 1 ,x move slightly outside of the polytope by moving along a We will say that an odd set such that δ(S) =1 1 ,χ   W direction defined by W . Then we find one of the violated and δ(S) W =0, is a set that blocks the walk .By constraints defining the matching polytope. This must be the combining the following lemma with lemma 10, we get that tight odd set we were after. we can find a tight odd set blocking each of our even walks. Recall that an even walk is either a simple even cycle in G NC C C Lemma 11. There is an algorithm that given a weight or the following structure: Let 1 and 2 be two odd length planar graph G, outputs the minimum odd cut of G. edge-disjoint cycles in G and let P be a path connecting vertex v1 of C1 to vertex v2 of C2;ifv1 = v2, P will be We will prove lemma 11 in section VI-C. the empty path. Starting from v1, traverse C1, then P from B. Uncrossing tight odd sets v1 to v2, then traverse C2, followed by P from v2 to v1. Next we define the alternating vector of an even walk W . Suppose we are given a list of tight odd sets S1,...,Sm Write W as a list of edges W =(e1,...,ek), where k is even that could cross each other arbitrarily. and if the walk contains a path, then the edges of the path will Note that we can assume from the beginning that for − 1 i |f 1 Si |≤ |V | Si be repeated twice in this list. We define the alternating vector each , ( ) 2 0 . If not, we simply replace by W χ −1 1 −1 ... 1 − i1 V −S |f −1 S | 0 for all e ∈ E. Lemma 9. Let x =avg(PM(G, w)) for some weight vector Definition 3. For a set S ⊆ V , define Λ(S) ⊆ RE to be the w. Let W be an even walk whose edges are in the support of x, linear subspace defined as the span of cut indicators of all i.e., for every e ∈ W , we have xe > 0, and let w, χW  < 0. tight odd sets contained in S: Let K(n) ≤ nn denote the number of perfect matchings in S {1 | T ⊆ S, |T | , 1 ,x }. the complete graph Kn, and let y be an -rotation of x with Λ( ):=span δ(T ) is odd δ(T ) =1 the walk W for some <1/2nK(n). Then, the following We extend this definition to more than one set S1,...,Sm hold: 1) For every vertex v, we have 1δ v ,y =1.2)For ( ) by letting S ,...,Sm S ··· Sm . S ⊂ V 1 ,x > 1 ,y≥ Λ( 1 ):=Λ( 1)+ +Λ( ) every odd set ,if δ(S) 1, then δ(S) 1. ⊥ 3) For every edge e ∈ E, we have ye ≥ 0. We also use the notation Λ (S1,...,Sm) to denote the E subspace of R orthogonal to Λ(S ,...,Sm). Lemma 9 almost ensures that the point y is inside the 1 Next, we will show that χW not being orthogonal to matching polytope PM(G) if the starting point x was in Λ(S ,...,Sm) implies that W has an edge in one E(Si). PM(G). The only way that y cannot be in PM(G) is if 1 S ⊂ V 1 ,x W χ ∈/ there is an odd set such that δ(S) =1, i.e., a Lemma 12. Let be an even walk, and assume that W ⊥ tight odd set, whose constraint gets violated by y. This leads Λ (S1,...,Sm). Then there is at least one edge e ∈ W and us to the following important lemma, which enables us to at least one i such that e ∈ E(Si). extract a tight odd set blocking the rotation of the walk W . Next we define our basic uncrossing operations and show Lemma 10. Suppose w is a weight vector, x = that they preserve this nonorthogonality property. Whenever avg(PMw(G)), W is a walk that satisfies the conditions we have two tight odd sets S1 and S2 we will show that we

657 can uncross them, i.e., replace them by new tight odd sets UNCROSS(S ,...,Sm) S S 1 without shrinking the subspace Λ( 1)+Λ( 2). We will use if m=1 then the following uncrossing lemma, which is standard in the return S1 literature and follows from submodularity of the cut function. else S S in parallel do Lemma 13. If 1 and 2 are tight odd sets then either R ,...,R ← UNCROSS(S ,...,S ) S ∩ S ,S ∪ S 1 1 1 p 1 m/2 1 2 1 2 are tight odd sets and δ(S1) + δ(S2) = C ,...,C ← UNCROSS(S ,...,S ) 1 1 S − S S − S 1 q m/2 +1 m δ(S1∩S2) + δ(S1∪S2),or 1 2 and 2 1 are tight 1 1 1 1 return MERGEUNCROSS(R1,...,Rp,C1,...,Cq) odd sets and δ(S1) + δ(S2) = δ(S1−S2) + δ(S2−S1).

Now we use lemma 13 to prove the claim that tight odd Figure 9. Divide-and-conquer algorithm for uncrossing tight odd sets sets can be uncrossed without shrinking Λ(S1)+Λ(S2). a given list of tight odd sets S ,...,Sm. The high-level S ,S 1 Lemma 14. Suppose that 1 2 are tight odd sets, i.e., description of our procedure, UNCROSS, is given in fig. 9. |S |, |S | 1 ,x 1 ,x 1 2 are odd and δ(S1) = δ(S2) =1. Then We roughly divide the given sets into two parts, and S ∪ S exactly one of the following two conditions holds: 1) 1 2 recursively uncross each part. Then we call the procedure S S ⊆ S ∪ S is a tight odd set and Λ( 1)+Λ( 2) Λ( 1 2), MERGEUNCROSS in order to merge the resulting sets. S S − S 2) 1 and 2 1 are both tight odd sets and Next, we will describe the merging procedure S S ⊆ S S − S Λ( 1)+Λ( 2) Λ( 1)+Λ( 2 1). MERGEUNCROSS. The procedure MERGEUNCROSS, UNCROSS Proof: Look at the parity of |S1 ∪ S2|.If|S1 ∪ S2| is similarly to , accepts a list of tight odd sets and odd, then we claim that case 1 happens. Otherwise, we will returns a list of pairwise disjoint tight odd sets whose show that case 2 happens. Λ is not smaller. With some abuse of notation, we still MERGEUNCROSS S ,...,Sm Case 1: |S1 ∪ S2| is odd. In this case |S1 ∩ S2| is also odd name the inputs to as 1 . The MERGEUNCROSS UNCROSS and it follows by lemma 13 that S1 ∪ S2 is a tight odd set. It difference between and is that MERGEUNCROSS is trivial from definition 3 that Λ(S1), Λ(S2) ⊆ Λ(S1 ∪ S2) the input sets to satisfy certain properties which immediately yields Λ(S1)+Λ(S2) ⊆ Λ(S1 ∪ S2). highlighted below. Case 2: |S1 ∪ S2| is even. In this case |S1 − S2| and Lemma 15. Suppose that {S1,...,Sm} = |S2 − S1| are both odd. Again, from lemma 13 it follows {R1,...,Rp,C1,...,Cq}, where m = p + q and that S2 − S1 is a tight odd set. It remains to prove that R1,...,Rp are pairwise disjoint tight odd sets and Λ(S1)+Λ(S2) ⊆ Λ(S1)+Λ(S2 −S1). It is enough to prove C1,...,Cq are also pairwise disjoint tight odd sets. Then that Λ(S2) ⊆ Λ(S1)+Λ(S2 − S1). S1,...,Sm have no 3-wise intersections. Furthermore, It is enough to show that for any tight odd set T ⊆ S ,we 2 the intersection graph of S ,...,Sm, where two Si’s are 1 ∈ S S − S 1 have the inclusion δ(T ) Λ( 1)+Λ( 2 1).Weagain connected if they have a nonempty intersection, is bipartite. have two cases: Either |T ∩ S1| is odd or even. If |T ∩ S1| is even, it follows from lemma 13 that T − S1 Having no 3-way intersections means that we can compute S − T 1 1 S ,...,Sm and 1 are tight odd sets and δ(T ) = δ(T −S1) + the parity of any union of 1 from their pairwise 1 − 1 1 , 1 ∈ S δ(S1−T ) δ(S1).Wehave δ(S1−T ) δ(S1) Λ( 1) and intersections. This is more handily captured by the notion of 1 ∈ S − S 1 ∈ S S − S δ(T −S1) Λ( 2 1).So δ(T ) Λ( 1)+Λ( 2 1) an intersection parity graph. as desired. S ,...,S |T ∩S | Definition 4. For tight odd sets 1 m satisfying the The only case that remains is when 1 is odd. In this conditions of lemma 15, define the intersection parity graph case we apply lemma 13 to the sets T and S − S , both of 2 1 H =(VH ,EH ), as follows: Let VH , the nodes of H,be which are tight odd sets. Note that T ∩ (S − S )=T − S 2 1 1 S ,...,Sm and for i = j let there be an edge between Si which has even size by assumption. Therefore by lemma 13, 1 and Sj if and only if |Si ∩ Sj| is odd. (S2 − S1) − T and T − (S2 − S1)=S1 ∩ T are also tight 1 1 1 − 1 H odd sets and δ(T ) = δ(S2−S1−T ) + δ(S1∩T ) δ(S2−S1). An immediate corollary of lemma 15 is that is bipartite. 1 ∈ S 1 , 1 ∈ |∪ S | We have δ(S1∩T ) Λ( 1) and δ(S2−S1−T ) δ(S2−S1) Another corollary is that the parity of i i is the same as the S − S 1 ∈ S S − S |V | |E | |H| Λ( 2 1) which proves that δ(T ) Λ( 1)+Λ( 2 1) parity of H + H which we simply denote by ; this is as desired. because the inclusion-exclusion formula stops at pairwise in- S ,...,S H S ,...,S Given tight odd sets 1 m, repeated applications tersections for our sets. We use the notation ( i1 ik ) S ,...,S of lemma 14 allow us to uncross them, i.e., replace to denote the induced subgraph on nodes i1 ik . With   2 S ,...,S |S ∪ ...S | ≡|H S ,...,S | them by pairwise disjoint tight odd sets 1 m such this notation we have i1 ik ( i1 ik ) , S ,...,S ⊆ S ,...,S 2 that Λ( 1 m) Λ( 1 m ). However, naively where ≡ represents having the same parity. lemma 14 would result in a sequential algorithm which is By lemma 14, if S ,S have an edge between them in H, not in NC. Next we show how we can do uncrossing in NC. 1 2 then the union S ∪ S will also be a tight odd set. If there We will use a divide-and-conquer approach to uncross 1 2 is a third set S3 connected to S2, we can again include S3

658 S ∪ S ∪ S in this union, i.e., 1 2 3 will be a tight odd set. MERGEUNCROSS(S ,...,Sm) S ∪ 1 Can we repeatedly apply this procedure and otain 1 for i =1...min parallel do ···∪Sm as a tight odd set? There seem to be two barriers Si ← Si − Sj j

H H S ,...,Sm Lemma 17. Assume that = ( 1 ) is connected Theorem 2. Given tight odd sets S1,...,Sm, there is an 2 and |H| ≡ 0. There are two induced subgraphs of H, which NC algorithm that either finds a viable set or outputs S ,...,S are odd and connected, and which together cover every node. pairwise disjoint tight odd sets 1 m such that S ,...,S ⊆ S ,...,S |f −1 S |

659 B. Finding linearly many edge-disjoint even walks T having no edges. The partition and T satisfy: 1) For S ,S ∈ T, ∃ u ∈ S ,v∈ S Here we prove lemma 3 by showing how to find Ω(|E|) each edge ( i j) i j such that w S ,S f u, v S ,S many edge-disjoint even walks in G =(V,E) in NC.By ( i j)= ( ). 2) The removal of ( i j) from T T assumption, G is a connected planar graph with no vertices disconnects , and splits the partitions which naturally S, S G u v of degree 1 and at most |V |/2 vertices of degree 2. We first defines a cut, ( ) in . This must be a minimum - cut. find linearly many edge-disjoint planar faces in G. In each iteration, the sequential algorithm refines the tree by splitting one of the partitions into two. It picks a NC Lemma 18 (Adapted from [15]). There is an algorithm partition, Si, having at least two vertices, u, v. Let T ,...Tl |E|/ 1 that returns 288 edge-disjoint planar faces of a graph be the subtrees of T incident at node Si. Each subtree Tj  satisfying the assumptions of lemma 3. is shrunk into a single vertex tj. This gives a graph G on S ∪{t ,...,t } G u v If at least half of the faces found by lemma 18 are even, i 1 l .In , find a minimum - cut. It is easy f u, v we work with these as our even walks. Else, we need to pair to show that the weight of this cut will also be ( ). S S S up odd faces together with an edge-disjoint path connecting This cut will partition i into two sets, say and . S each pair to get Ω(|E|) even walks of the second type. Replace i by these two sets and connect them by an edge of weight f(u, v). Among the subtrees T ,...Tl take the ones f 1 Lemma 19. Given an even number of edge-disjoint odd on the u side (v side) of the cut and let them be incident NC f 2/ |E|   faces in a planar graph, we can find in , 16 edge- at S (S ). The algorithm ends when each partition is a disjoint even walks, each formed by joining two given faces. singleton vertex. The tree will be a Gomory-Hu tree. NC Sketch of proof: First we find a spanning tree T of G. We now give our algorithm. The main difference lies S We will only use paths on the spanning tree to pair up odd in the way set i is split. We first define the notion of a S r ∈ S faces. For each given odd face, place a token at one of its central vertex for i. Pick a vertex i and for each v ∈ S r v vertices, arbitrarily. Now we have f tokens on the spanning remaining vertex i, find a mimimal minimum - G tree T . In lemma 20 we will prove that these tokens can be cut in the graph defined above after shrinking subtrees S S S S ∩ S paired up by edge-disjoint paths from the tree in NC. incident to i. Let v denote this cut and let v = v i. r S This pairing needs to be modified to form the even walks. We will say that is a central vertex for i if for each v ∈ S ,v r |S |≤|S |/ For more details refer to the full version of this paper. i = , v i 2. We now describe the missing part from the above proof. Lemma 21. For any partition Si, a central vertex r exists. T Lemma 20. Consider a tree and an even number of tokens A central vertex for Si can be found in NC: For each vertex o ,...,o 1 f placed on the vertices of the tree. We can find, in r ∈ Si, test if it is a central vertex by finding, in parallel, a NC  , a pairing of the tokens using the shortest path on the minimal minimum v-r in G for each vertex v ∈ Si,v= r. tree, so that no two paths share an edge. From now on, let r denote a central vertex for Si. The We now have the ingredients to prove lemma 3. following fact is straightforward: |E|/ Proof of lemma 3: We first find 288 edge-disjoint Lemma 22. Let r, u, v ∈ V and let Su and Sv be minimal faces by invoking lemma 18. If at least half of these faces minimum u-r and v-r cuts in G, respectively. Then Su and are even, we return this half. Otherwise we invoke lemma 19. Sv do not cross. We have |E|/576 odd faces, any by possibly dropping one r, v ,...v ∈ V S ,...,S of them we can supply an even number f ≥|E|/576 − 1 Corollary 1. Let 1 k and let v1 vk be v r v r G of odd faces to the algorithm described by lemma 19 and minimal minimum 1- , ... k- cuts in , respectively. Then 2 S ,...,S obtain (|E|/576 − 1) /16|E| =Ω(|E|) edge-disjoint even v1 vk form a laminar family. walks. This finishes the proof. Let r denote a central vertex for Si that is found by S C. Finding Gomory-Hu trees and minimum odd cuts the algorithm. By corollary 1, the cuts v, for each vertex v ∈ Si,v= r form a laminar family. Let M ,...,Ml be In this section, we will give an NC algorithm for con- 1 the maximal sets of this laminar family. Clearly, we can split structing a Gomory-Hu tree for a planar graph G =(V,E) Si into the l sets M1 ∩Si,...,Ml ∩Si and attach subtrees to with edge weights given by w : E → R≥0 and finding a appropriate sets as given by M ,...,Ml. This can be done minimum odd cut. We will crucially use the fact that an s-t 1 for all sets Si of the current partition, in parallel. This defines max-flow and min-cut can be computed in a planar graph one iteration of our parallel algorithm. Clearly, after each in NC [9]. For each pair of vertices u, v ∈ V , let f(u, v) iteration, the cardinality of the largest set in the partition denote the weight of a minimum u-v cut in G. drops by a factor of 2 and therefore only O(log n) such The sequential algorithm for constructing a Gomory-Hu iterations are needed. Hence we get: tree has, at any point, a tree T defined on a partition  S1,...,Sk of V , and a weight function w defined on Theorem 3. There is an NC algorithm for obtaining a the edges of T . The starting partition is simply V , with Gomory-Hu tree for an edge-weighted planar graph.

660 Now we use Padberg and Rao’s theorem that states that [8] Rohit Gurjar, Thomas Thierauf, and Nisheeth K the Gomory-Hu tree of a graph must contain a minimum odd Vishnoi. “Isolating a Vertex via Lattices: Polytopes cut as one of its edges [18] to finish the proof of lemma 11. with Totally Unimodular Faces”. In: arXiv preprint Proof of lemma 11: We first find a Gomory-Hu tree, arXiv:1708.02222 (2017). then try all of the cuts obtained by removing an edge of [9] Donald B Johnson. “Parallel algorithms for minimum the tree. We return the minimum among cuts that split the cuts and maximum flows in planar networks”. In: vertices into odd pieces. Clearly all of this can be done in Journal of the ACM (JACM) 34.4 (1987), pp. 950–967. parallel, and hence the algorithm is in NC. [10] Richard M Karp, Eli Upfal, and Avi Wigderson. Remark VI.1. An alternative way of finding a minimum odd “Are search and decision programs computationally cut S is to use the Pickard-Queyranne structure of minimum s- equivalent?” In: STOC. 1985, pp. 464–475. t cuts [19]. However, that method is cumbersome to describe. [11] Richard M Karp, Eli Upfal, and Avi Wigderson. “Constructing a perfect matching is in random NC”. ACKNOWLEDGEMENTS In: Combinatorica 6.1 (1986), pp. 35–48. We wish to thank David Eppestein, Laszl´ oLov´ asz,´ and [12] Pieter Kasteleyn. “ and crystal physics”. Satish Rao for valuable discussions. In: Graph Theory and Theoretical Physics (1967), Part of this work was done while the first author was visit- pp. 43–110. ing the Simons Institute for the Theory of Computing. It was [13] Laszl´ oLov´ asz.´ “On , matchings, and ran- partially supported by the DIMACS/Simons Collaboration dom algorithms.” In: FCT. Vol. 79. 1979, pp. 565–574. on Bridging Continuous and Discrete Optimization through [14] Michael Luby. “A simple parallel algorithm for the NSF grant CCF-1740425. The second author was supported maximal independent set problem”. In: SIAM Journal in part by NSF grant CCF-1815901. on Computing 15.4 (1986), pp. 1036–1053. Remark VI.2. Recent work [5] has resolved the problem for [15] Meena Mahajan and Kasturi R Varadarajan. “A new NC-algorithm for finding a perfect matching in bipar- the more general K3,3-free graphs. Eppstein and Vazirani [5] go further to give NC algorithms for finding a perfect tite planar and small genus graphs”. In: STOC. 2000, matching, a minimum weight perfect matching if the weights pp. 351–357. are polynomially bounded, and an s-t min-cut in one-crossing- [16] Gary L Miller and Joseph Naor. “Flow in planar graphs -free graphs. Also recent work of Sankowski [20] has with multiple sources and sinks”. In: FOCS. 1989, given an alternative approach to finding perfect matchings pp. 112–117. in planar graphs in NC, as well as other related problems. [17] Ketan Mulmuley, Umesh V Vazirani, and Vijay V Vazirani. “Matching is as easy as matrix inversion”. REFERENCES In: Combinatorica 7.1 (1987), pp. 105–113. [1] Allan Borodin, Stephen Cook, and Nicholas Pippenger. [18] Manfred W Padberg and M Ram Rao. “Odd mini- “Parallel computation for well-endowed rings and mum cut-sets and b-matchings”. In: Mathematics of space-bounded probabilistic machines”. In: Informa- Operations Research 7.1 (1982), pp. 67–80. tion and Control 58.1-3 (1983), pp. 113–136. [19] Jean-Claude Picard and Maurice Queyranne. “On [2] Laszlo Csanky. “Fast parallel matrix inversion algo- the structure of all minimum cuts in a network rithms”. In: SIAM Journal on Computing 5.4 (1976), and applications”. In: Combinatorial Optimization II pp. 618–623. (1980), pp. 8–16. [3] J. Edmonds. “Maximum matching and a polyhedron [20] Piotr Sankowski. “NC Algorithms for Weighted Planar with 0,1-vertices”. In: Journal of Research of the Na- Perfect Matching and Related Problems”. In: ICALP. tional Bureau of Standards B 69B (1965), pp. 125–130. Vol. 107. 2018. [4] Jack Edmonds. “Paths, trees, and flowers”. In: Cana- [21] Ola Svensson and Jakub Tarnawski. “The Matching dian Journal of mathematics 17.3 (1965), pp. 449–467. Problem in General Graphs is in Quasi-NC”. In: arXiv [5] David Eppstein and Vijay V Vazirani. “NC Algo- preprint arXiv:1704.01929 (2017). rithms for Perfect Matching and Maximum Flow in [22] Leslie G Valiant. “The complexity of computing the One-Crossing-Minor-Free Graphs”. In: arXiv preprint permanent”. In: Theoretical Computer Science 8.2 arXiv:1802.00084 (2018). (1979), pp. 189–201. [6] Stephen Fenner, Rohit Gurjar, and Thomas Thierauf. [23] Vijay V Vazirani. “NC algorithms for computing the “Bipartite perfect matching is in quasi-NC”. In: STOC. number of perfect matchings in K3,3-free graphs and 2016, pp. 754–763. related problems”. In: Information and Computation [7] Rohit Gurjar and Thomas Thierauf. “Linear Matroid 80.2 (1989), pp. 152–164. Intersection is in quasi-NC”. In: Electronic Colloquium on Computational Complexity (ECCC). Vol. 23. 2016, p. 182.

661