Diverse Pairs of Matchings
Fedor V. Fomin, Petr A. Golovach, Lars Jaffke, Geevarghese Philip, Danil Sagunov
DDiverse Pairs of Matchings
Fedor V. Fomin , Petr A. Golovach , Lars Jaffke , Geevarghese Philip , andDanil Sagunov University of Bergen, Bergen, Norway {fedor.fomin,petr.golovach,lars.jaffke}@uib.no Chennai Mathematical Institute, Chennai, India UMI ReLaX [email protected] St. Petersburg Department of V.A. Steklov Institute of Mathematics, St. Petersburg, Russia JetBrains Research, St. Petersburg, Russia [email protected]
September 11, 2020
Abstract
We initiate the study of the
Diverse Pair of (Maximum/ Perfect) Matchings prob-lems which given a graph G and an integer k , ask whether G has two (maximum/perfect)matchings whose symmetric difference is at least k . Diverse Pair of Matchings (askingfor two not necessarily maximum or perfect matchings) is NP -complete on general graphs if k is part of the input, and we consider two restricted variants. First, we show that on bipartitegraphs, the problem is polynomial-time solvable, and second we show that Diverse Pair ofMaximum Matchings is FPT parameterized by k . We round off the work by showing that Diverse Pair of Matchings has a kernel on O ( k ) vertices. Matching is one of the most fundamental notions in graph theory whose study can be traced backto the classical theorems of Kőnig [19] and Hall [13]. The first chapter of the book of Lovászand Plummer [21] devoted to matching contains a nice historical overview on the development ofthe matching problem. The problem of finding a maximum size or a perfect matching are theclassical algorithmic problems; an incomplete list of references covering the history of algorithmicimprovements on these problems is [8, 16, 18, 20, 23, 27, 31, 22], see also the book of Schrijver [28]for a historical overview of matching algorithms.In this paper we initiate the algorithmic study of the diverse matching problem. In this problem,we are to find a pair of matchings which are different from each other as much as possible. Moreformally, we want the size of their symmetric difference to be large. Recall that the symmetricdifference of two sets
X, Y is defined as X (cid:52) Y = ( X \ Y ) ∪ ( Y \ X ) . We study the following problem. 1 a r X i v : . [ c s . D S ] S e p nput: Graph G , integer k Question:
Does G contain two (maximum/perfect) matchings M , M such that | M (cid:52) M | ≥ k ? Diverse Pair of (Maximum/Perfect) Matchings
Diversity-enhancing is one of the key goals in developing professional social matching systems[25]. For example, consider the problem of assigning agents to perform various tasks (say, busdrivers to bus routes or cleaners to different locations). To avoid monotony, which is one of thedeclared enemies of happiness at work, the practice is to reassign agents to new tasks. In this case,we would be very much interested in designing a schedule with diverse assignments. To give anotherillustration, assume that a teacher should give a series of assignments to students that are expectedto work in pairs. From one side, the teacher wishes to follow the preferences of the students givenby a graph, but from the other side, it is preferable to facilitate collaboration between differentstudents. This leads to the problem of finding diverse perfect matchings in the preference graph.We now briefly motivate why finding a diverse set of maximum/perfect matchings in a graphwould be of interest. From a graph-theoretic point of view, in the simplest model, one maxi-mum/perfect matching is as good as the other. But in a practical setting this is rarely the casesince there is a large amount of side information that determines how an assignment (for instanceagents to tasks) is received. Some side information is modeled by maximum weight matchings, orvia notions from social choice theory such as stable or envy free matchings [4]. Nevertheless, thisapproach has its natural limitations; some side information may complicate the model, rendering itintractable, while some side information may even be impossible to include in a model.For instance, if we allow agents to have incomplete preference lists or ties, then the correspondingmaximum stable matching problem is NP -hard, even in severely restricted cases [26]. Other sideinformation may be a priori unknown, and only once presented with a number of alternatives, wemay be able to decide which assignment is the most desirable. In that case it is key that thepresented alternatives are diverse, otherwise the insight we gain is comparable to that of having asingle fixed assignment and is therefore negligible. Similar motivations for finding diverse solutionsets in combinatorial problems can be found in [2, 3]. Our results and methods.
While a perfect or a maximum matching in a graph can be foundin polynomial time, this is not true anymore for the diverse variant of the problem, even in graphs ofmaximum degree three. Matching problems are often considered on bipartite graphs, and we showthat
Diverse Pair of Maximum Matchings remains polynomial-time solvable in this case.The intractability of the problem in the general case also suggests to look at it from the perspec-tive of parameterized complexity [7, 5] and kernelization [11]. We show that the problem is
FPT parameterized by k , by giving a randomized k · n O (1) time algorithm, and we give a derandomizedversion of this algorithm that runs in time k k O (log k ) · n O (1) . Finally, we show that the problemasking for a diverse pair of (not necessarily maximum) matchings admits a kernel on O ( k ) vertices.The randomized algorithm for Diverse Pair of Maximum Matchings is obtained via acombination of color-coding [1] and the polynomial-solvability of finding a minimum cost maximummatching in a graph [12]. We derandomize this algorithm via universal sets [24]. The kernelizationalgorithm for
Diverse Pair of Matchings first finds a maximal matching M in the graph. If M is large enough, then we can conclude that we are dealing with a Yes -instance by splitting M into two matchings. Otherwise, the endpoints of M form a vertex cover of the input graph whichallows us to shrink the graph without changing the answer to the problem.2 elated work. A well-studied generalization of matchings in graphs is that of a b -matching ,where b is an integer; see for instance [21]. Given a graph G and an integer b , a b -matching is anassignment of an integer µ ( e ) to each edge e of G , such that for each vertex v , the sum over all itsincident edges e v of µ ( e v ) is bounded by b . The size of a b -matching is the sum over all edges e in G of µ ( e ) . The -matchings of a graph precisely correspond its matchings (via the edges e with µ ( e ) = 1 ). However, a -matching is not always the union of two matchings: take for instance atriangle. Then, assigning a value of to all its edges gives a -matching; while any matching canhave at most one edge from a triangle. Therefore, finding diverse pairs of matchings is not the sameas finding -matchings.Finding q pairwise disjoint matchings of large total size corresponds to finding large subgraphsthat can be q -edge colored, each matching constitutes a color class. The Maximum q -Edge Col-orable Subgraph problem asks for the largest edge-subgraph that can be properly colored with q colors. This problem is known to be hard to approximate [9].Let G be a graph with edge set E and maximum degree ∆ . Any proper edge coloring requires atleast ∆ colors. On the other hand, Vizing’s Theorem [32] asserts that every graph can be properlyedge-colored with ∆ + 1 colors. A consequence of this result is that (any) graph G contains a ∆ -colorable subgraph with at least ∆∆+1 | E | edges; which is tight when ∆ is even as witnessed bythe complete graph K ∆+1 . This motivated research in improving the lower bound when ∆ is odd,or when ∆ is even and K ∆+1 is excluded. Kamiński and Kowalik [17] gave several improved lowerbounds for the cases when ∆ ≤ .The difference with Maximum -Edge Colorable Subgraph is that in Diverse Pair ofMaximum Matchings , we require matchings (or: color classes) to be of maximum size, while inthe former problem, we only want to maximize the total number of edges in the two color classes.A recent manuscript due to Fellows [10] initiated the study of finding diverse sets of solutions to NP -hard combinatorial problems from the viewpoint of parameterized complexity [2, 3]. Concretely,Baste et al. [2] showed that a large class of vertex subset problems that are FPT parameterized bytreewidth have
FPT algorithms in their diverse variant, parameterized by treewidth plus the numberof requested solutions. Moreover, Baste et al. [3] showed analogous results for hitting set problemsparameterized by solution size plus number of requested solutions. Our work contrasts this in thatthe classical variant of the problem we consider is polynomial-time solvable, while its diverse variantbecomes NP -hard, even when asking for only two solutions.Very recently, Hanaka et al. [14] gave efficient algorithms for finding diverse sets of solutionsto several other combinatorial problems. This includes an FPT -algorithm for finding diverse setsof matchings in a graph. However, their result is different from ours. We give an
FPT -algorithmfor finding a diverse pair of maximum or perfect matchings, and our parameter is the size of thesymmetric difference between the matchings, in other words, the diversity measure. In [14], theparameter is the size of the matchings plus the number of requested solutions, and the matchingsdo not need to be of maximum cardinality. Note that in this setting, the maximum possible diversityis bounded in terms of the parameter as well. In the case that we drop the maximum cardinalityrequirement on the matchings, we even obtained a polynomial kernel for finding a diverse pair ofmatchings. By the same arguments given in the proof of Theorem 7, we can derive that the problemof finding a diverse set of r matchings of size k parameterized by k + r considered in [14] is not only FPT but has a polynomial kernel. 3
Preliminaries
We assume the reader to be familiar with basic notions in graph theory and parameterized com-plexity and refer to [6] and [7, 5, 11], respectively, for the necessary background.All graphs considered in this work are finite, undirected, simple, and without self-loops. For agraph G we denote by V ( G ) its set of vertices and by E ( G ) its set of edges . For an edge uv ∈ E ( G ) ,we call u and v its endpoints . For a vertex v of a graph G , N G ( v ) .. = { w ∈ V ( G ) | vw ∈ E ( G ) } isthe set of neighbors of v in G , and the degree of v is deg G ( v ) .. = | N G ( v ) | .The subgraph induced by X , denoted by G [ X ] , is the graph ( X, { uv ∈ E ( G ) | u, v ∈ X } ) . For aset of edges F ⊆ E ( G ) , we let G − F .. = ( V ( G ) , E ( G ) \ F ) .A graph G is called empty if E ( G ) = ∅ . A set of vertices S ⊆ V ( G ) is an independent set if G [ S ] is empty. A set S ⊆ V ( G ) is a vertex cover if V ( G ) \ S is an independent set. A graph G is bipartite if its vertex set can be partitioned into two nonempty independent sets. NP-Completeness.
We briefly argue the NP -completeness of Diverse Pair of Maxi-mum/Perfect Matchings on -regular graphs which was observed in [29]. Membership in NP is clear. To show NP -hardness, we reduce from -Edge Coloring on -regular graphs which isknown to be NP -complete [15]. Let G be a -regular graph on n vertices (note that this implies that n is even), and consider ( G, n ) as an instance of Diverse Pair of Matchings . Suppose that G has a proper -edge coloring. Since G is -regular, all three colors appear on an incident edge ofeach vertex. Therefore, a color class is a perfect matching of G , and we can take two color classesas our solution to ( G, n ) . Conversely, a solution ( M , M ) to ( G, n ) forms two disjoint matchings ofsize n/ each. This implies that both M and M are perfect, and therefore maximum matchings.Since each vertex in G has degree three, this means that M .. = E ( G ) \ ( M ∪ M ) also forms aperfect matching in G , and therefore ( M , M , M ) is a proper -edge coloring of G . Observation 1 ([29]).
Diverse Pair of (Maximum/Perfect) Matchings is NP -complete on -regular graphs. In this section we show that
Diverse Pair of Maximum Matchings is solvable in polynomialtime on bipartite graphs via a reduction to the -Factor problem. Theorem 2.
Diverse Pair of Maximum Matchings is polynomial-time solvable on bipartitegraphs.Proof.
Let ( G, k ) be a given instance of Diverse Pair of Maximum Matchings , where G isbipartite. We show how to reduce this instance to an equivalent instance of the problem of findingmaximum-weight -factor of a larger graph G (cid:48) . A -factor of G (cid:48) is a subgraph of G (cid:48) in which thedegree of each vertex is equal to . Equivalently, -factor of G (cid:48) is a vertex-disjoint cycle cover of G (cid:48) . The problem of finding a maximum-weight factor of a graph is well-known to be solvable inpolynomial time using the Tutte’s reduction to the problem of finding a maximum-weight perfectmatching [21, 30]. Our graph G (cid:48) is an edge-weighted graph with parallel edges. We note that thealgorithm of finding a maximum-weight factor works fine with such graphs.We also assume that the two parts of G are of equal size. If that is not true, introduce isolatedvertices to the smaller part of G . This does not change the matching structure in G , so the obtainedinstance is equivalent to the initial one. Denote the number of vertices in each part of G by n , so | V ( G ) | = 2 n . 4e now show how to construct G (cid:48) given G . The graph G (cid:48) is defined on the same vertex set as G is, i.e. V ( G (cid:48) ) = V ( G ) . For each edge uv of G , G (cid:48) has two parallel edges between u and v . Oneof these edges is assigned weight , and the other is assigned weight . In other words, edges of G are doubled in G (cid:48) . Additionally, for each pair of vertices u, v from distinct parts of G that are notadjacent in G , G (cid:48) has two parallel edges of weight − n between u and v . Thus, G (cid:48) is a completebipartite graph with doubled edges, and weights of these edges depend on what edges are presentin G . This finishes the construction of G (cid:48) . Claim 2.1. Let M and M be a pair of maximum matchings in G that maximize the value of | M ∪ M | . Then the maximum weight of a -factor of G (cid:48) equals | M ∪ M | − n · ( n − | M | ) .Proof. We first show that G (cid:48) has a -factor of weight at least | M ∪ M | − n · ( n − | M | ) . Denotethis -factor by F . It is constructed as follows. For each edge of M take the corresponding edge ofweight in G (cid:48) into F . Then, for each edge in M \ M take the corresponding edge of weight into F . For each edge in M ∩ M , take the corresponding edge of weight in G (cid:48) into F . Clearly, F isnow of weight | M ∪ M | , but it is not yet a -factor of G (cid:48) , unless M and M are perfect matchings.There are n −| M | vertices in each part of G that are not saturated by M . Take these n −| M | ) vertices and take an arbitrary matching between them in G (cid:48) . All edges of this matching are of weight − n , otherwise M is not maximum in G . Add the edges of this matching into F . Repeat the samefor M , i.e. take an arbitrary matching in G (cid:48) between vertices that are not saturated by M andadd all its edges into F . The edges of weight − n of the matchings for M and M may coincide. Ifan edge of weight − n is presented in both matchings, take both its parallel copies into F . It is easyto see that F is now a -factor of G (cid:48) , as it consists of edges of two perfect matchings between twoparts. The weight of F is | M ∪ M | − n ( n − | M | ) − n ( n − | M | ) = | M ∪ M | − n · ( n − | M | ) .It is left to show that F is indeed a maximum-weight -factor of G (cid:48) . To see this, take a maximum-weight factor F (cid:48) of G (cid:48) and assume that the weight of F (cid:48) is greater than the weight of F . Note that F (cid:48) consists of n edges. As discussed above, F (cid:48) forms a disjoint union of simple cycles on thevertices of G (cid:48) , where each vertex belongs to exactly one cycle. Note that some of these cycles mayconsist of two parallel edges. Since G (cid:48) is bipartite, all of these cycles have even length. Color theedges of F (cid:48) with two colors so that no two consecutive edges have the same color on a cycle. Thenthe edges of the same color form a perfect matching in G (cid:48) . Denote these matchings by F (cid:48) and F (cid:48) .Let M (cid:48) be the set of original edges of G which copies are present in F (cid:48) . Let M (cid:48) be the set of edgesof G obtained analogously from F (cid:48) . Copies of edges in M (cid:48) and M (cid:48) have weights or in G (cid:48) . Allother edges in F (cid:48) and F (cid:48) are of weight − n .Observe that if an edge of G is present in both M (cid:48) and M (cid:48) , then one of its copies in F (cid:48) hasweight , and the other has weight . Thus, the total weight of - and -weighted edges in F (cid:48) is atmost | M (cid:48) ∪ M (cid:48) | . The number of edges of weight ( − n ) in F (cid:48) is n − | M (cid:48) | − | M (cid:48) | . Thus, the totalweight of F (cid:48) is at most | M (cid:48) ∪ M (cid:48) | − n (2 n − ( | M (cid:48) | + | M (cid:48) | )) .We assumed that the weight of F (cid:48) is greater than the weight of F . From this we get that ( | M (cid:48) ∪ M (cid:48) | − | M ∪ M | ) − n (2 | M | − ( | M (cid:48) | + | M (cid:48) | )) > holds; equivalently, that ( | M (cid:48) ∪ M (cid:48) | − | M ∪ M | ) > n (2 | M | − ( | M (cid:48) | + | M (cid:48) | )) . (1)Recall that M (cid:48) and M (cid:48) are matchings in G . Suppose M (cid:48) and M (cid:48) are maximum matchings in G . Then the right hand side of Equation 1 evaluates to zero, and—by the definition of M and M —the left hand side is at most zero. Hence Equation 1 does not hold, a contradiction. So atleast one of M (cid:48) and M (cid:48) is not a maximum matching. Thus we get that | M (cid:48) | + | M (cid:48) | < | M | (2)5olds; equivalently, that | M (cid:48) | + | M (cid:48) | − | M | < | M | holds. By construction we have that the size ofany matching in G is at most n . In particular | M | ≤ n , and so we have that | M (cid:48) | + | M (cid:48) | − | M | < n (3)holds. Equation 2 can be restated as | M | − ( | M (cid:48) | + | M (cid:48) | ) > . Now, | M | − ( | M (cid:48) | + | M (cid:48) | ) ≥ (4)holds. Substituting Equation 4 in Equation 1 we get that ( | M (cid:48) ∪ M (cid:48) | − | M ∪ M | ) > n (5)holds. Observe now that | M (cid:48) | + | M (cid:48) | ≥ | M (cid:48) ∪ M (cid:48) | and | M | ≤ | M ∪ M | hold. Substituting thesein Equation 5 we get that (( | M (cid:48) | + | M (cid:48) | ) − | M | ) > n holds, which contradicts Equation 3. (cid:121) Now let M , M be two arbitrary maximum matchings of G , and let µ ( G ) denote the size of amaximum matching of G . Thus | M | = | M | = µ ( G ) . By the definition of symmetric difference wehave that | M (cid:52) M | = | M \ ( M ∩ M ) | + | M \ ( M ∩ M ) | = | M |−| M ∩ M | + | M |−| ( M ∩ M ) | =2 µ ( G ) − | M ∩ M | . And since | ( M ∩ M ) | = | M | + | M | − | M ∪ M | = 2 µ ( G ) − | M ∪ M | we getthat | M (cid:52) M | = 2 µ ( G ) − µ ( G ) − | M ∪ M | ) = 2( | M ∪ M | − µ ( G )) . Since µ ( G ) is an invariantof graph G this means that the maximum value of | M (cid:52) M | is attained by exactly those pairs ofmaximum matchings M , M which maximize the value | M ∪ M | . Further, let M (cid:63) , M (cid:63) be a pair ofmaximum matchings such that | M (cid:63) ∪ M (cid:63) | is the maximum among all pairs of maximum matchings.Then we have that the maximum value of | M (cid:52) M | , over all pairs of maximum matchings, equals | M (cid:63) ∪ M (cid:63) | − µ ( G )) .From 2.1 we get that we can compute the value | M (cid:63) ∪ M (cid:63) | —though not the matchings M (cid:63) and M (cid:63) —in polynomial time, by computing the weight of a maximum 2-factor in a derived graph. Wecan find the maximum matching size µ ( G ) of G in polynomial time as well. So we can compute thenumber | M (cid:63) ∪ M (cid:63) | − µ ( G )) in polynomial time. By the arguments in the previous paragraph,checking whether | M (cid:63) ∪ M (cid:63) |− µ ( G )) ≥ k suffices to solve the bipartite instance ( G, k ) of DiversePair of Maximum Matchings . (cid:3) Diverse Pair of Maximum Matchings
In this section we give an
FPT -algorithm for
Diverse Pair of Maximum Matchings parame-terized by k . We first give a randomized algorithm based on the color-coding technique of Alon,Yuster and Zwick [1] in Theorem 3, and then derandomize this algorithm at the cost of a slightlyslower runtime in Corollary 6. Theorem 3.
Diverse Pair of Maximum Matchings parameterized by k is FPT . More pre-cisely, there is a randomized algorithm that in time k · n O (1) finds a solution with constant probability,if it exists, and correctly concludes that there is no solution otherwise, where n denotes the numberof vertices of the input graph.Proof. Let G be the graph of the given instance. First, we compute a maximum matching M in G in polynomial time [8, 12, 23]. We check if there is a solution using M as one of the two matchings. Claim 3.1. Let G be a graph and M a maximum matching of G . One can determine in polynomialtime whether G has a maximum matching M (cid:48) such that | M (cid:52) M (cid:48) | ≥ k , and construct such amatching if it exists. roof. The algorithm is as follows. Let c : E ( G ) → { , } be a cost function of the edges of G ,defined as c ( e ) .. = (cid:26) , if e ∈ M , otherwise ∀ e ∈ E ( G ) Let M (cid:48) be a minimum cost maximum matching in G using the cost function c . Such a matching M (cid:48) can be found in polynomial time [12]. Due to the cost function c , a minimum cost maximummatching in G is one that minimizes the number of edges from M . Therefore, M (cid:48) maximizes thesymmetric difference with M , over all maximum matchings of G . We verify whether | M (cid:52) M (cid:48) | ≥ k ,and if so, return M (cid:48) . Otherwise, we correctly conclude that there is no matching satisfying theconditions of the claim. (cid:121) Due to Claim 3.1, we may now assume that for each maximum matching M (cid:48) of G , | M (cid:48) (cid:52) M | ≤ k .We will exploit this property to give an algorithm using color coding (see e.g. [5, Chapter 5]). Wecolor the edges of G uniformly at random with colors red and blue . For ease of exposition, wealso use the notation ‘ red ’ and ‘ blue ’ to denote the set of edges that received color red and blue ,respectively.Suppose that there is a solution ( M , M ) . We say that a coloring as above is good for ( M , M ) ,if the edges in M \ M and M \ M are colored red and blue , respectively. We call an edge coloring good , if it is good for some solution. To be able to show that trying k colorings to achieve constantsuccess probability suffices, we bound the size of these sets.By Claim 3.1, we know that | M (cid:52) M r | ≤ k for all r ∈ { , } . Since | M (cid:52) M | is the Hammingdistance between sets, by the triangle inequality, | M (cid:52) M | ≤ | M (cid:52) M | + | M (cid:52) M | ≤ k and | M \ M | + | M \ M | ≤ k . This leads to the following observation. Observation 3.2. Let G be a graph, let M be a maximum matching of G , and suppose that for allmaximum matchings M (cid:48) of G , | M (cid:52) M (cid:48) | ≤ k . Suppose the edges of G are colored uniformly atrandom with colors red and blue . Suppose there is a solution ( M , M ) . Then, with probability atleast − k , the edge coloring is good for ( M , M ) . Suppose that our instance is a
Yes -instance, and that the edges of G are colored with a goodcoloring. We show how to obtain the solution in polynomial time from the edge-colored graph. Claim 3.3. Let G be a graph, M a maximum matching of G , and suppose that the edges of G arecolored uniformly at random with colors red and blue . There is an algorithm that runs in polynomialtime, and if the edge-coloring is good, finds two maximum matchings M and M in G such that | M (cid:52) M | ≥ k , and reports No otherwise.Proof. The idea is similar to the one given in the algorithm of Claim 3.1. To find M , we define thefollowing cost function c : E ( G ) → { , } : c ( e ) .. = (cid:26) , if e ∈ blue0 , if e ∈ red ∀ e ∈ E ( G ) . Then, we find a minimum-cost maximum matching M of G with the cost function c in polynomialtime [21]. 7ext, to find M , we consider the cost function c : E ( G ) → { , } , where c ( e ) .. = (cid:26) , if e ∈ red0 , if e ∈ blue ∀ e ∈ E ( G ) , and find a minimum-cost maximum matching M of G with cost function c in polynomial time [21].Now, if | M (cid:52) M | ≥ k , then we return ( M , M ) , and we say No , otherwise.We now argue the correctness of the algorithm in the case that the edge-coloring of G was good.In this case, there is a solution ( M ∗ , M ∗ ) such that the edges of M ∗ \ M ∗ are red and the edges of M ∗ \ M ∗ are blue , and | M ∗ (cid:52) M ∗ | ≥ k . We claim that | M (cid:52) M | ≥ | M ∗ (cid:52) M ∗ | .To obtain a contradiction, assume that | M (cid:52) M | < | M ∗ (cid:52) M ∗ | .Since M , M , M ∗ , and M ∗ are maximum matchings of G , they have the same size. Therefore,we have that | M (cid:52) M | + 2 | M ∩ M | = | M | + | M | = | M ∗ | + | M ∗ | = | M ∗ (cid:52) M ∗ | + 2 | M ∩ M | . Since | M (cid:52) M | < | M ∗ (cid:52) M ∗ | , we obtain that | M ∩ M | > | M ∗ ∩ M ∗ | . (6)Because M ∗ \ M ∗ ⊆ red , c ( M ∗ ) = | M ∗ ∩ blue | = | ( M ∗ ∩ M ∗ ) ∩ blue | by the definition of the costfunction c . Symmetrically, c ( M ∗ ) = | ( M ∗ ∩ M ∗ ) ∩ red | . Hence, c ( M ∗ ) + c ( M ∗ ) = | ( M ∗ ∩ M ∗ ) ∩ blue | + | ( M ∗ ∩ M ∗ ) ∩ red | = | M ∗ ∩ M ∗ | . (7)Notice that c ( M ) = | M ∩ blue | ≥ | ( M ∩ M ) ∩ blue | and c ( M ) = | M ∩ red | ≥ | ( M ∩ M ) ∩ red | .Therefore, c ( M ) + c ( M ) ≥ | ( M ∩ M ) ∩ blue | + | ( M ∩ M ) ∩ red | = | M ∩ M | . (8)Combining (6)–(8), we obtain that c ( M ) + c ( M ) ≥ | M ∩ M | > | M ∗ ∩ M ∗ | = c ( M ∗ ) + c ( M ∗ ) . (9)However, c ( M ) ≤ c ( M ∗ ) and c ( M ) ≤ c ( M ∗ ) by the definition of these matchings and c ( M ) + c ( M ) ≤ c ( M ∗ ) + c ( M ∗ ) contradicting (9). We conclude that | M (cid:52) M | ≥ | M ∗ (cid:52) M ∗ | . (cid:121) The outline of the procedure is given in Algorithm 1. It is well-known that a maximum matchingof a graph can be found in polynomial time, therefore line 1 takes polynomial time. By Claims 3.1and 3.3, lines 2 and 7, respectively, take polynomial time. Moreover, by Observation 3.2, if thereis a solution, then with probability at least − k an edge-coloring as constructed in line 7 is good,in which case the algorithm finds the solution by Claim 3.3. It is clear that repeating this step k times yields a constant success probability. (cid:3) The algorithm of Theorem 3 can be derandomized by standard tools (see, e.g., [5, Chapter 5]).To do so, we use the following notion of (Ω , k ) -universal sets, which will replace the random coloringstep in the above algorithm by deterministic choices of colorings.8 nput : Graph G , integer k Output:
If exists, with constant probability, a pair M , M of maximum matchings of G such that | M (cid:52) M | ≥ k , No otherwise. Compute a maximum matching M of G ; if there is a maximum matching M (cid:48) in G such that | M (cid:52) M (cid:48) | ≥ k then return ( M, M (cid:48) ) ; else repeat k times Color the edges of G uniformly at random with colors red and blue ; run the algorithm of Claim 3.3; if the algorithm returned ( M , M ) then return ( M , M ) ; return No ; Algorithm 1:
The algorithm of Theorem 3.
Definition 4 ( (Ω , k ) -universal set). Let Ω be a set and k be a positive integer with k ≤ | Ω | .An (Ω , k ) -universal set is a family U of subsets of Ω such that for any size- k set S ⊆ Ω , the family U S .. = { A ∩ S : A ∈ U } contains all subsets of S .We will use the following construction of a small universal set due to Naor et al. [24]. Theorem 5 ([24], see also Theorem 5.20 in [5]).
For any set Ω and integer k ≤ | Ω | , one canconstruct an (Ω , k ) -universal set of size k k O (log k ) log( | Ω | ) in time k k O (log k ) | Ω | log( | Ω | ) . This immediately gives the following corollary.
Corollary 6. There is a deterministic k k O (log k ) · n O (1) time algorithm that solves Diverse Pairof Maximum Matchings , where n denotes the number of vertices in the input graph. Diverse Pair of Matchings
We now show that the
Diverse Pair of Matchings problem, asking for a pair of not necessarilymaximum matchings has a kernel on O ( k ) vertices. Note that the NP -completeness of this problemis captured in Observation 1 as well. Moreover, we would like to remark that this variant of theproblem is only interesting in the case when the input graph has no matching of size k or more:otherwise, a maximum matching (which can be found in polynomial time) forms a trivial solutiontogether with an empty matching. Theorem 7.
Diverse Pair of Matchings parameterized by k has a kernel on O ( k ) vertices.Proof. Let ( G, k ) be an instance of Diverse Pair of Matchings . We provide a procedure thateither correctly concludes that ( G, k ) is a Yes -instance, or marks a set of O ( k ) vertices X ⊆ V ( G ) such that ( G [ X ] , k ) is equivalent to ( G, k ) .First, let M be a maximal matching of G . If | M | ≥ k , then for any -partition ( M , M ) of M ,we have that | M (cid:52) M | = | M | ≥ k , and therefore ( G, k ) is a Yes -instance.Suppose that | M | < k and therefore, | V ( M ) | < k . Since M is maximal, V ( M ) is a vertex coverof G , and therefore, E ( G − V ( M )) = ∅ . This motivates the following procedure that produces a setof marked vertices X ⊆ V ( G ) , to which we can restrict the instance without changing the answer.1. Initialize X .. = V ( M ) . 9 Mu Xv X u Figure 1: Illustration of the situation in the proof of Claim 7.1. The existence of v implies that | X u | ≥ k ,and since V ( M ) is a vertex cover of G , the vertices in X u are pairwise non-adjacent.
2. For each v ∈ V ( M ) , add a maximal subset of N G ( v ) \ V ( M ) of size at most k to X .Let X denote the set constructed according to the two previous steps. We show that ( G [ X ] , k ) is equivalent to ( G, k ) . Claim 7.1. Let G , k , M , and X be as above. Then, ( G, k ) is a Yes -instance of
Diverse Pair ofMatchings if and only if ( G [ X ] , k ) is a Yes -instance of
Diverse Pair of Matchings .Proof.
Since G [ X ] is a subgraph of G , it is clear that if ( G [ X ] , k ) is a Yes -instance, then so is ( G, k ) .Now suppose that ( G, k ) is a Yes -instance and let ( M , M ) with | M (cid:52) M | ≥ k be a solution.If M ∪ M ⊆ E ( G [ X ]) , then ( M , M ) is also a solution to ( G [ X ] , k ) , so suppose that for some r ∈ { , } , there is an edge uv ∈ M r such that v ∈ V ( G ) \ X . Since V ( M ) ⊆ X and V ( M ) is avertex cover of G , we may assume that u ∈ V ( M ) . Since v is a neighbor of u in V ( G ) \ X , theabove marking algorithm added a set of k neighbors of u in V ( G ) \ V ( M ) to X , denote that setby X u . For an illustration see Figure 1.Now, since X u ⊆ V ( G ) \ V ( M ) , and since V ( M ) is a vertex cover of G , we have that E ( G [ X u ]) = ∅ . This means in particular that each edge in M ∪ M has at most one endpoint in X u . Therefore,if all vertices in X u are the endpoint of some edge in either M or in M , then | M ∪ M | ≥ k , whichimplies that at least one of M and M contains at least k edges. Suppose w.l.o.g. that | M | ≥ k .As above, any -partition ( M (cid:48) , M (cid:48) ) of M is such that | M (cid:48) (cid:52) M (cid:48) | = | M | ≥ k , therefore ( M (cid:48) , M (cid:48) ) is a solution to ( G [ X ] , k ) . Otherwise, there is a vertex x ∈ X u that is not the endpoint of any edgein M ∪ M . We obtain M (cid:63)r by removing uv and adding ux . Then, ( M (cid:63)r , M − r ) is still a solution to ( G, k ) , and it uses one more edge in G [ X ] . Repeatedly applying this argument shows that ( G [ X ] , k ) is a Yes -instance. (cid:121)
The previous claim asserts the correctness of the procedure. Since | V ( M ) | < k , and for eachvertex in V ( M ) , we added at most k more vertices to X , we have that | X | = O ( k ) . A maximalmatching can be found greedily, and it is clear that the marking procedure runs in polynomial time.This yields the result. (cid:3) In this work, we initiated the study of algorithmic problems asking for diverse pairs of (maxi-mum/perfect) matchings, where diverse means that their symmetric difference has to be at leastsome value k . These problems are NP -complete on -regular graphs, and we showed that on bi-partite graphs, they become polynomial-time solvable; while parameterized by k , they are FPT ,10nd the problem asking for two diverse (not necessarily maximum) matchings admits a polynomialkernel.The notion of diverse matchings opens up many natural further research directions. In thiswork, we considered the complexity of finding pairs of diverse matchings. What happens whenwe ask for a larger number of matchings? In [2, 3], the measure of diversity of a set of solutionsis the sum over all pairs of their symmetric difference. In this setting, we can obtain an
FPT -algorithm parameterized by the number of requested matchings plus the ‘diversity target’ using thesame approach as in our
FPT -algorithm for
Diverse Pair of Maximum Matchings . However,if we ask for a set of matchings M such that for each pair M , M ∈ M , | M (cid:52) M | ≥ k , thenthe situation is much less clear, even asking for three solutions. Call the corresponding problem Diverse Triples of Maximum Matchings . Is it
FPT parameterized by k ?While the symmetric difference is a natural measure of diversity of two matchings, one mightconsider other measures as well. The diversity measure at hand may affect the complexity of theproblem, so it would be interesting to see if there is an (easily computable) diversity measure underwhich Diverse Pair of Maximum/Perfect Matchings becomes W [1]-hard. Acknowledgements.
We thank Günter Rote for pointing out to us that, given a maximummatching M , we can find a maximum matching M (cid:48) such that | M (cid:52) M (cid:48) | is maximum in polynomialtime by the reduction to the Minimum Cost Maximum Matching problem.
References [1] Noga Alon, Raphael Yuster, and Uri Zwick. Color-coding.
J. ACM , 42(4):844–856, 1995.[2] Julien Baste, Michael R. Fellows, Lars Jaffke, Tomáš Masařík, Mateus de Oliveira Oliveira,Geevarghese Philip, and Frances A. Rosamond. Diversity of solutions: An exploration throughthe lens of fixed-parameter tractability theory. In
IJCAI 2020 , pages 1119–1125, 2020.[3] Julien Baste, Lars Jaffke, Tomáš Masařík, Geevarghese Philip, and Günter Rote. FPT algo-rithms for diverse collections of hitting sets.
Algorithms , 12(12):254, 2019.[4] Felix Brandt, Vincent Conitzer, Ulle Endriss, Jérôme Lang, and Ariel D. Procaccia.
Handbookof computational social choice . Cambridge University Press, 2016.[5] Marek Cygan, Fedor V. Fomin, Łukasz Kowalik, Daniel Lokshtanov, Dániel Marx, MarcinPilipczuk, Michał Pilipczuk, and Saket Saurabh.
Parameterized Algorithms . Springer, 2015.[6] Reinhard Diestel.
Graph Theory . Springer, 2005.[7] Rodney G. Downey and Michael R. Fellows.
Parameterized Complexity . Springer-Verlag, NewYork, 1999.[8] Jack Edmonds. Paths, trees, and flowers.
Can. J. Math. , 17(3):449–467, 1965.[9] Uriel Feige, Eran Ofek, and Udi Wieder. Approximating maximum edge coloring in multi-graphs. In
APPROX 2002 , pages 108–121. Springer, 2002.[10] Michael R. Fellows. The Diverse X paradigm. manuscript, 2018.[11] Fedor V. Fomin, Daniel Lokshtanov, Saket Saurabh, and Meirav Zehavi.
Kernelization. Theoryof Parameterized Preprocessing . Cambridge University Press, 2018.1112] Harold N. Gabow and Robert Endre Tarjan. Faster scaling algorithms for general graph-matching problems.
J. ACM , 38(4):815–853, 1991.[13] Philip Hall. On representatives of subsets.
J. London Math. Soc. , 10:26–30, 1935.[14] Tesshu Hanaka, Yasuaki Kobayashi, Kazuhiro Kurita, and Yota Otachi. Finding diverse trees,paths, and more.
CoRR , abs/2009.03687, 2020.[15] Ian Holyer. The NP-completeness of edge-coloring.
SIAM Journal on Computing , 10(4):718–720, 1981.[16] John E. Hopcroft and Richard M. Karp. An n / algorithm for maximum matchings in bipartitegraphs. SIAM Journal on Computing , 2:225–231, 1973.[17] Marcin Jakub Kamiński and Lukasz Kowalik. Beyond the Vizing’s bound for at most sevencolors.
SIAM Journal on Discrete Mathematics , 28(3):1334–1362, 2014.[18] A. V. Karzanov. The problem of finding the maximal flow in a network by the method ofpreflows.
Dokl. Akad. Nauk SSSR , 215:49–52, 1974.[19] Dénes Kőnig. Über Graphen und ihre Anwendung auf Determinantentheorie und Mengenlehre.
Math. Ann. , 77(4):453–465, 1916.[20] László Lovász. On determinants, matchings, and random algorithms. In
Fundamentals ofComputation Theory , pages 565–574. Akademie Verlag, 1979.[21] László Lovász and Michael D. Plummer.
Matching Theory . AMS, 2009.[22] Aleksander Mądry. Navigating central path with electrical flows: From flows to matchings,and back. In
FOCS 2013 , pages 253–262. IEEE Computer Society, 2013.[23] Marcin Mucha and Piotr Sankowski. Maximum matchings via Gaussian elimination. In
FOCS2004 , pages 248–255. IEEE Computer Society, 2004.[24] Moni Naor, Leonard J. Schulman, and Aravind Srinivasan. Splitters and near-optimal deran-domization. In
FOCS 1995 , pages 182–191, 1995.[25] Thomas Olsson, Jukka Huhtamäki, and Hannu Kärkkäinen. Directions for professional socialmatching systems.
Commun. ACM , 63(2):60–69, 2020.[26] Gregg O’Malley.
Algorithmic aspects of stable matching problems . PhD thesis, University ofGlasgow, 2007.[27] Michael O. Rabin and Vijay V. Vazirani. Maximum matchings in general graphs throughrandomization.
J. Algorithms , 10(4):557–567, 1989.[28] Alexander Schrijver.
Combinatorial Optimization. Polyhedra and Efficiency. Vol. A . Springer-Verlag, Berlin, 2003.[29] Jukka Suomela. Complexity of two perfect matchings with minimum shared edges? TheoreticalComputer Science Stack Exchange, 2010. https://cstheory.stackexchange.com/q/1291 (version:2010-09-14). 1230] William Thomas Tutte. A short proof of the factor theorem for finite graphs.
Can. J. Math. ,6:347–352, 1954.[31] Vijay V. Vazirani. A proof of the MV matching algorithm, 2014.[32] Vadim G. Vizing. On an estimate of the chromatic class of a p-graph.