Counting Maximum Matchings in Planar Graphs Is Hard
aa r X i v : . [ c s . CC ] J a n Counting Maximum Matchings in Planar Graphs Is Hard
Istv´an Mikl´os , and Mikl´os Kr´esz , , R´enyi institute, 1053 Budapest, Re´altanoda u. 13-15, Hungary SZTAKI, 1111 Budapest, L´agym´anyosi u. 11, Hungary InnoRenew CoE, 6310 Izola, Livade 6, Slovenia University of Primorska IAM , 6000 Koper, Muzejski trg 2, Slovenia University of Szeged, Dept. of Applied Informatics, 6701 Szeged, P.O.B. 396, HungaryJanuary 7, 2020
Abstract
Here we prove that counting maximum matchings in planar, bipartite graphs is
The complexity class
For any graph G , M ( G ) denotes the number of matchings in G and M M ( G ) denotes the number ofmaximum matchings of G .We will denote the computational problem of counting matchings in a graph by . Similarly, denotes the computational problem of counting maximum matchings in a graph.When the problem is restricted to special classes of graphs, it is emphasized by prefixes; Pl- will denoteplanar, B- will denote bipartite. For example, denotes the computational problem ofcounting matchings in planar, bipartite graphs. Definition 1.
Let G = ( V, E ) be a graph, and let w : V → W be a weight function mapping complexnumbers to the vertices of G , where W ⊆ C .Then the matching polynomial of G is defined as M P ( G ) := X M ∈M ( G ) Y v / ∈ M w ( v ) , (1) where M ( G ) is the set of non-necessarily perfect matchings of G , and a vertex v is not in a matching M ifnone of the edges of M is incident to v . The empty product is defined as , that is, each perfect matchingalso contributes to the matching polynomial with a value . The set W is given by fixed formulae usingthe basic arithmetic operations and roots with integer degrees.We will denote the computational problem of computing the matching polynomial of a planar bipartitegraph by . The size of W \ { } equals k will be emphasized by denoting the problemby . Observe that
M P ( G ) equals M ( G ) when each weight is 1. We prove this hardness results very similar to the proof of Jerrum. The only difference between our proofand Jerrum’s proof is in the sub-gadgets building the crossing gadget and in the number of differentweights used in the matching polynomial.
Theorem 3.1.
Counting matchings in planar, bipartite graphs is
We first prove that ≤ . Then with 6 polynomial interpolations,we prove that ≤ ≤ , we create a planar, bipartite crossing gadget. By replacingall crossing edges of a bipartite graph G , we construct a vertex-weighted, planar, bipartite graph G ′ , such2hat M P ( G ′ ) = C k M ( G ), where C is (cid:18) q √ i (cid:19) (1 − √ i )4 × √ − √
105 + 3) ≈ − . . i (2)and k is the number of crossings in G . Clearly, the first n digits of C can be computed in O ( poly ( n ))time.Similar to Jerrum, the crossing gadget is built from two sub-gadgets, ∆ and ∆ . Both sub-gadgets havethe topology and parametrized vertex weights shown in Figure 1. We will call the edges incident to x , y and z external edges.It is easy to see that the matching polynomial of the gadget is b c + 3 b + ( x + y + z )( b (4 + 3 ab + 2 bc + ab c )) ++( xy + xz + yz )(3 + 8 ab + 3 bc + 3 a b + 4 ab c + a b c ) + (3)+ xyz ( c (2 + 9 ab + 6 a b + a b ) + 3(2 a + 4 a b + a b )) . We are looking for parameter values a , b and c such that the matching polynomial of ∆ be C (1 + xy + xz + yz ) (4)and the matching polynomial of ∆ be C (1 + xyz ) , (5)for some complex, non-zero numbers C and C . That is, we want the matching polynomial of subgadget∆ to contribute to the matching polynomial when all or exactly one of its external edges are in amatching. Similarly, we want the matching polynomial of ∆ to contribute to the matching polynomialwhen all or none of the external edges are in a matching.Observing that b = 0 cannot yield a solution, we have to solve the equation system for ∆ : c (2 + 9 ab + 6 a b + a b ) + 3(2 a + 4 a b + a b ) = b c + 3 b (6)4 + 3 ab + 2 bc + ab c = 0 (7)3 + 8 ab + 3 bc + 3 a b + 4 ab c + a b c = 0 (8)Using Equation 7, we can express c as c = − − ab b + ab (9)to get to the reduced system − − ab − a b − a b = 2 b (10) − b − ab − a b = 0 (11)3 yza aabb bc Figure 1: The topology of the sub-gadgets of the crossing gadget. See text for details.A possible solution is a = − √ i q √ i ) ≈ − . . i, b = s
11 + 9 i √ ≈ . . i (12)from which c and c can be also expressed: c = − − √ i q √ ≈ − . . i and C = (cid:18) q √ i (cid:19) (1 − √ i )4 ≈ . − . i. The weights for ∆ can be computed from the following equation system:3 + 8 ab + 3 bc + 3 a b + 4 ab c + a b c = b c + 3 b (13)4 + 3 ab + 2 bc + ab c = 0 (14) c (2 + 9 ab + 6 a b + a b ) + 3(2 a + 4 a b + a b ) = 0 (15)4e can again express c from the second equation, and thus we get the following reduced system: − b − ab − a b = 2 b (16) − − ab − a b − a b = 0 (17)We know that √ − is a solution of the equation4 x + 21 x + 30 x + 8 = 0 . (18)Then setting ab = √ − , that is, a = √ − b , substituting it in equation 16 we arrive to the followingequation: − b − √ − b − √ − ! b = 2 b (19)has to be solved for b , that is, b = ± i s − √ . (20)Then a possible solution is a = − i √ − q − √ , b = 14 i s − √ , (21)from which c and c can also be expressed: c = − i − √ q (679 + 29 √ C = √ − √
105 + 3) . (23)Still following Jerrum, we can pack three ∆ and three ∆ sub-gadgets to arrive to our planar, bipartitecrossing gadget, see Figure 2. Let G be an arbitrary bipartite graph. For any planar drawing of G ,replace each crossing edges ( x, y ) and ( z, w ) with the crossing gadget. Let the so-obtained graph be G .For each vertex in G which is not in the crossing gadget, the weight is set to 1.Recall that ∆ contribute to the matching polynomial only when all or one of the ’ a ’ vertices are incidentto external edges in the matching. Also observe that ∆ contributes to the matching polynomial only if allor none of the ’ a ’ vertices are incident to external edges in the matching. Furthermore, any contributionof ∆ is C , and any contribution of ∆ is C . Therefore, the matching polynomial of the gadget inFigure 2 is C C (1 + xy + zw + xyzw ) . (24)It is also easy to see that the crossing gadget is a bipartite graph with x and w being in one of the vertex5 a a a b b b c a a a b b b c ya a a b b b c xa a a b b b c a a a b b b c wa a a b b b c Figure 2: The planar, bipartite crossing gadget. Vertex weights a , b and c are the weights of sub-gadget∆ . Vertex weights a , b and c are the weights of sub-gadget ∆ . See text for details.classes, and z and y being in the other vertex class.Therefore, any matching of G can be extended to a set of matchings in G , such that the edges incidentto x and y in the crossing gadget are in the matching of G if and only if a crossing edge ( x, y ) is in thematching of G (same holds for the edge ( z, w ) of G ). In this way, for any matching of G , the correspondingset of matchings contribute to the matching polynomial of G with ( C C ) k , where k is the number ofcrossings in the drawing of G . Furthermore, the contribution to the matching polynomial of all othermatchings of G is 0.Thus, we get that the matching polynomial of G is the number of matchings in G times ( C C ) k , where k is the number of crossings in the drawing of G .Next, we prove that ≤ . We do it by showing that for any k > ≤ . Let G = ( V, E ) be an arbitrary planar, bipartitegraph, and let w : V → W be a weight function with | W \ { }| = k + 1. Let x ∈ W be any of theweights but 1, let X ⊆ V be the subset of vertices with weight x , and let m = | X | . Then we construct m + 1 graphs, G , G , . . . , G m +1 . In the graph G i = ( V i , E i ), i new edges are attached to each vertex in X . Then the weights of the vertices V \ X have the weights as they had in G , the vertices in X and thefurther vertices incident to the new edges have weight 1. Clearly, for the weight function v i : V i → W i itholds that | W i \ { }| = k . 6t is easy to see that the matching polynomial of G is f ( x ), where f ( y ) := m X j =0 a j y j (25)is the matching polynomial of a graph G y , which has the same topology than the graph G , and almostall the same weights except that each weight x is replaced with the indeterminate y .It is also easy to see that the matching polynomial of G i is m X j =0 a j ( i + 1) j . (26)Indeed, the matching polynomial of G i restricted to those matchings M in which j vertices in X are notincident to edges in M ∩ E is a j ( i + 1) j . Indeed, for each vertex in X which are not incident to any edgein X ∩ E , there are i ways to be incident to an edge in E i \ E , and there is a possible way not to becovered by the matching.That is, if we could compute the matching polynomial for each G i , then we could evaluate f at m + 1different points. In this way, we could compute the coefficients a j with polynomial interpolation, andthus, we also could compute M P ( G ) = f ( x ).Applying this polynomial reduction 6 times we arrive to ≤ = .It is worth explaining why this chain of reductions is indeed a polynomial reduction when the computationsinvolve complex numbers with irrational coefficients. We would like to compute the matching polynomialof G which can be written in the form M P ( G ) = k X i =0 9 k X i =0 3 k X i =0 9 k X i =0 9 k X i =0 3 k X i =0 λ i ,i ,i ,i ,i ,i a i b i c i a i b i c i , (27)where k is the number of crossings of G , and a , b , c , a , b and c are the six complex weights computedabove. Observe that all coefficients λ i ,i ,i ,i ,i ,i are integers, and these integers are computed duringthe polynomial interpolation. That is, the computation during the polynomial interpolations remains inthe domain of integer numbers, furthermore these integers are surely smaller than the maximum of thepossible number of matchings in a graph, that is, the number of digits necessary to express the numbersappearing during the polynomial interpolation are at most polynomial with the size of the problem. Thenwe have to compute M ( G ) = 1 C k M P ( G ) = 1 C k k X i =0 9 k X i =0 3 k X i =0 9 k X i =0 9 k X i =0 3 k X i =0 λ i ,i ,i ,i ,i ,i a i b i c i a i b i c i . (28)Observe that there are polynomial number of terms to add in equation 28 and the sum of these terms is7n integer when divided by C k . Furthermore, each monom as well as C comes from a field extension witha fixed (constant) dimension, so the right hand side can be formally – and thus, explicitly – computed inpolynomial time. Theorem 4.1.
Counting the maximum matchings in planar, bipartite graphs is
We prove it by proving the polynomial reduction ≤ .Let G = ( U, V, E ) be an arbitrary bipartite, planar graph with | U | ≤ | V | . We construct a graph G ′ = ( U, V ′ , E ′ ), that we obtain from G by attaching an edge to each vertex in U . Clearly, any maximummatching in G ′ has size | U | . We claim that there is a bijection between the matchings of G and themaximum matchings of G ′ . Indeed, from a maximum matching M ′ of G ′ , we can remove the edges of M ′ which are in E ′ \ E , thus we get a matching of G . For the other direction, any matching M of G canbe extended to a maximum matching of G ′ by covering the vertices of U not in the matching M by theedges in E ′ \ E . If these two transformations are denoted by ϕ and ϕ ′ , it is easy to see that ϕ ′ ( ϕ ( M )) = M, (29)and ϕ ( ϕ ′ ( M ′ )) = M ′ (30)for any matching M of G and any maximum matching M ′ of G ′ . Therefore, M ( G ) = M M ( G ′ ) , (31)which completes the proof. In this paper, we showed that counting maximum matchings in bipartite, planar graphs is M of G is a matching such that no matching M ′ of G existssuch that M ⊂ M ′ . To our best knowledge, the computational complexity of counting maximal matchings8s unknown even for simple graphs, though our results suggests the conjecture that it might be hard evenrestricting the problem to planar, bipartite graphs. Acknowledgement
We thank Csaba Szab´o for his fruitful comments on solving polynomial equation systems. Mikl´os Kr´eszacknowledges the European Commission for funding the InnoRenew CoE project (Grant Agreement