The labeled perfect matching in bipartite graphs

In this paper, we deal with both the complexity and the approximability of the labeled perfect matching problem in bipartite graphs. Given a simple graph G = ( V, E ) with | V | = 2 n vertices such that E contains a perfect matching (of size n ), together with a color (or label) function L : E → { c 1 , . . . , c q } , the labeled perfect matching problem consists in ﬁnding a perfect matching on G that uses a minimum or a maximum number of colors.


Introduction
Let Π be a NPO problem accepting simple graphs G = (V, E) as instances, edgesubsets E ⊆ E verifying a given polynomial-time decidable property P red as solutions, and the solutions cardinality as objective function; the labeled problem associated to Π, denoted by LABELED Π, seeks, given an instance I = (G, L) where G = (V, E) is a simple graph and L is a mapping from E to {c 1 , . . ., c q }, in finding a subset E verifying P red that optimizes the size of the set L(E ) = {L(e) : e ∈ E }.Note that two versions of LABELED Π may be considered according to the optimization goal: LABELED Min Π that consists in minimizing |L(E )| and LABELED Max Π that consists in maximizing |L(E )|.Roughly speaking, the mapping L corresponds to assigning a color (or a label) to each edge and the goal of LABELED Min Π (resp., Max Π) is to find an edge subset using the fewest (resp., the most) number of colors.If a given NPO problem Π is NP-hard, then the associated labeled problem LABELED Π is clearly NP-hard (consider a distinct color per edge).For instance, the LABELED Longest path problem or the LABELED maximum induced matching problem are both NP-hard.Moreover, if the decision problem associated to Π is NP-complete, (the decision problem aims at deciding if a graph G contains an edge subset verifying P red), then LABELED Min Π can not be approximated within performance ratio better than 2 − ε for all ε > 0 unless P=NP, even if the graph is complete.Indeed, if we color the edges from G = (V, E) with a lonely color and then we complete the graph, adding a new color per edge, then it is NP-complete to decide between opt(I) = 1 and opt(I) ≥ 2, where opt(I) is the value of an optimal solution.Notably, it is the case of the LABELED traveling salesman problem or the LABELED minimum partition problem into paths of length k for any k ≥ 2.
Thus, labeled problems have been mainly studied, from a complexity and an approximability point of view, when Π is polynomial, [5,6,7,9,14,18,19].For example, the first labeled problem introduced in the literature is the LABELED minimum spanning tree problem, which has several applications in communication network design.This problem is NP-hard and many complexity and approximability results have been proposed in [5,7,9,14,18,19].On the other hand, the LABELED maximum spanning tree problem has been shown polynomial in [5].Very recently, the LABELED path and the LABELED cycle problems have been studied in [6]; in particular, the authors prove that the LABELED minimum path problem is NP-hard.
In this paper, we go thoroughly into the investigation of the complexity and the approximability of labeled problems, with the analysis of the matching problem in bipartite graphs.The maximum matching problem is one of the most known combinatorial optimization problem and arises in several applications such as images analysis, artificial intelligence or scheduling.It turns out that a problem very closed to it has been studied in the literature, which is called in [12] the restricted perfect matching problem.This latter aims at determining, given a graph G = (V, E), a partition E 1 , . . ., E k of E and k positive integers r 1 , . . ., r k , weather there exists a perfect matching M on G satisfying for all j = 1, . . ., k the restrictions |M ∩ E j | ≤ r j .This problem has some relationship with the timetable problem, since a solution may be seen as a matching between classes and teachers that satisfies additional restrictions (for instance, no more that r labs at the same time).The restricted perfect matching problem is proved to be NP-complete in [12], even if (i) |E j | ≤ 2, (ii) r j = 1, and (iii) G is a bipartite graph.On the other hand, it is shown in [20] that the restricted perfect matching problem is polynomial when G is a complete bipartite graph and k = 2.A perfect matching M only verifying condition (ii) (that is to say |M ∩ E i | ≤ 1) is called good in [8].Thus, we deduce that the LABELED maximum perfect matching problem is NP-hard in bipartite graph since opt(I) = n iff G contains a good matching.
In section 2, we analyze both the complexity and the approximability of the LABELED minimum perfect matching problem and the LABELED maximum perfect matching problem in 2-regular bipartite graphs.Finally, section 3 focuses on the case of complete bipartite graphs.Now, we introduce some terminology and notations that will be used in the paper.A matching M on a graph G = (V, E) is a subset of edges that are pairwise non adjacent; M is said perfect if it covers the vertex set of G.In the labeled perfect matching problem (LABELED P M in short), we are given a simple graph G = (V, E) on |V | = 2n vertices which contains a perfect matching together with a color (or label) function L : E → {c 1 , . . ., c q } on the edge set of G.For i = 1, . . ., q, we denote by L −1 ({c i }) ⊆ E the set of edges of color c i .The goal of LABELED Min P M (resp., Max P M) is to find a perfect matching on G using a minimum (resp., a maximum) number of colors.An equivalent formulation of LABELED Min P M could be the following: if G[C] denotes the subgraph induced by the edges of colors C ⊆ {c 1 , . . ., c q }, then LABELED Min P M aims at finding a subset C of minimum size such that G[C] contains a perfect matching.The restriction of LABELED P M to the case where each color occurs at most r times in I = (G, L) (i.e., |L −1 ({c i })| ≤ r for i = 1, . . ., q) will be denoted by LABELED P M r .
We denote by opt(I) and apx(I) the value of an optimal and an approximate solution, respectively.We say that an algorithm A is an ε-approximation of LABELED Min P M with ε ≥ 1 (resp.,

The 2-regular bipartite case
In this section, we deal with a particular class of graphs that consist in a collection of pairwise disjoints cycles of even length; note that such graphs are 2-regular bipartite graphs.
Theorem 2.1 LABELED Min P M r is APX-complete in 2-regular bipartite graphs for any r ≥ 2 .
Proof.Observe that any solution of LABELED Min P M r is an r-approximation.The rest of the proof will be done via an approximation preserving reduction from the minimum balanced satisfiability problem with clauses of size at most r, MIN BALANCED r-SAT for short.An instance I = (C, X) of MIN BALANCED r-SAT consists in a collection C = (C 1 , . . ., C m ) of clauses over the set X = {x 1 , . . ., x n } of boolean variables, such that each clause C j has at most r literals and each variable appears positively as many time as negatively; let B i denotes this number for any i = 1, . . ., n.The goal is to find a truth assignment f satisfying a minimum number of clauses.MIN BALANCED 2-SAT where 2 ≤ B i ≤ 3 has been shown APX-complete by the way of an L-reduction from MAX BALANCED 2-SAT where B i = 3, [4,13].
L(e i,1 ) = c j 1 Figure 1: The gadget H(x i ) and the color of its edges.
We only prove the case r = 2. Let I = (C, X) be an instance of MIN BALANCED 2-SAT on m clauses C = {C 1 , . . ., C m } and n variables X = {x 1 , . . ., x n } such that each variable x i has either 2 occurrences positive and 2 occurrences negative, or 3 occurrences positive and 3 occurrences negative.We build the instance I = (H, L) of LABELED Min P M 2 where H is a collection of pairwise disjoints cycles {H(x 1 ), . . ., H(x n )} and L colors edges of H with colors c 1 , . . ., c j , . . ., c m , by applying the following process: • Color the edges of H(x i ) as follows: if x i appears positively in clauses C j1 , . . ., C j B i and negatively in clauses Figure 1 provides an illustration of the gadget H(x i ).Clearly, H is made of n disjoint cycles and is painted with m colors.Moreover, each color appears exactly twice.
Let f * be an optimal truth assignment on I satisfying m * clauses and consider the perfect matching uses exactly m * colors and thus: Conversely, let M be a perfect matching on H using apx(I) = m colors; if one sets f (x i ) = true if e i,2 ∈ M , f (x i ) = false otherwise, we can easily observe that the truth assignment f satisfies m clauses.
Trivially, the problem becomes obvious when each color is used exactly once.We now show that we have a 2-approximation in 2-regular bipartite graphs, showing that the restriction of LABELED Min P M to 2-regular bipartite graphs is as hard as approximate as MINSAT.
Theorem 2.2 There exists an approximation preserving reduction from LABELED Min P M in 2-regular bipartite graphs to MINSAT of expansion c(ε) = ε.

Proof.
The result comes from the reciprocal of the previous transformation.Let I = (G, L) be an instance of LABELED Min P M where G = (V, E) is a collection {H 1 , . . ., H n } of disjoint cycles of even length and L(E) = {c 1 , . . ., c m } defines the label set, we describe every cycle H i as the union of two matchings M i and M i .We construct an instance I = (C, X) of MINSAT where C = {C 1 , . . ., C m } is a set of m clauses and X = {x 1 , . . ., x n } is a set of n variables, as follows.The clause set C is in one to one correspondence with the color set L(E) and the variable set X is in one to one correspondence with the connected components of G; a literal x i (resp., x i ) appears in C j iff c j ∈ L(M i ) (resp., c j ∈ L(M i )).We easily deduce that any truth assignment f on I that satisfies k clauses can be converted into a perfect matching M f on I that uses k colors.
Using the 2-approximation of MINSAT [15] and the Theorem 2.2, we deduce: Dealing with LABELED Max P M r , the result of [12] shows that computing a good matching is NP-hard even if the graph is bipartite and each color appears at most twice; a good matching M is a perfect matching using |M | colors.Thus, we deduce from this result that LABELED Max P M r is NP-hard for any r ≥ 2. We strengthen this result using a reduction from MAX BALANCED 2-SAT.

Theorem 2.4 LABELED Max P M r is APX-complete in collection of pairwise disjoints cycles of even length for any r ≥ 2 .
In the same way, using the approximate result for MAXSAT [2] , we obtain Corollary 2.5 LABELED Max P M in 2-regular bipartite graphs is 0.7846-approximable.
Figure 2: The gadget H(x j ).

The complete bipartite case
When considering complete bipartite graphs, we obtain several results: for any r ≥ 6.
Proof.We give an approximation preserving L-reduction (cf.Papadimitriou & Yannakakis [16]) from the set cover problem, MINSC for short.Given a family S = {S 1 , . . ., S n0 } of subsets and a ground set X = {x 1 , . . ., x m0 } (we assume that ∪ n0 i=1 S i = X), a set cover of X is a sub-family S = {S f (1) , . . ., S f (p) } ⊆ S such that ∪ p i=1 S f (i) = X; MINSC is the problem of determining a minimum-size set cover S * = {S f * (1) , . . ., S f * (q) } of X.Its restriction MINSC 3 to instances where each set is of size at most 3 and each element x j appears in at most 3 different sets has been proved APX-complete in [16].
Given an instance I 0 = (S, X) of MINSC, its characteristic graph G I0 = (L 0 , R 0 ; E I0 ) is a bipartite graph with a left set L 0 = {l 1 , . . ., l n0 } that represents the members of the family S and a right set R 0 = {r 1 , . . ., r m0 } that represents the elements of the ground set X; the edge-set E I0 of the characteristic graph is defined by Note that G I0 is of maximum degree 3 iff I 0 is an instance of MINSC 3 .From I 0 , we construct the instance I = (K n,n , L) of LABELED Min P M 6 .First, we start from a bipartite graph having m 0 connected components H(x j ) and n 0 + m 0 colors {c 1 , . . ., c n0+m0 }, described as follows: • For each element x j ∈ X, we build a gadget H(x j ) that consists in a bipartite graph of 2(d G I 0 (r j ) + 1) vertices and 3d G I 0 (r j ) edges, where d G I 0 (r j ) denotes the degree of vertex r j ∈ R in G I0 .The graph H(x j ) is illustrated in Figure 2. into a complete bipartite graph, adding a new color per edge.Each color c x (∀x ∈ V ) appears 3 times, c e (∀e ∈ E) twice and any other color, once.Hence, the application of the proof that was made in Theorem 3.1 leads to the announced result.Unfortunately, we can not apply the proof of Theorem 2.2 since in this latter, on the one hand, we have some cycles of size 6 and, on the other hand, a color may occurs in different gadgets.
One open question concerns the complexity of LABELED Min P M 2 in bipartite complete graphs.Moreover, from Theorem 3.1, we can also obtain a stronger inapproximability result: one can not compute in polynomial-time an approximate solution that uses less that (1/2 − ε)ln(opt LABELED Max P M (I)) colors in complete bipartite graphs where opt LABELED Max P M (I) is the value of an optimal solution of LABELED Max P M, i.e., the maximum number of colors used by a perfect matching.

Corollary 3.2 For any
Proof.First, we apply the construction made in Theorem 3.1, except that I 0 = (S, X) is an instance of MINSC such that the number of elements m 0 is strictly larger than the number of sets n 0 .From I 0 , we construct n 0 instances I 1 , . . ., I n0 of LABELED Min P M where I i = (H, L i ).The colors L i (E) are the same than L(E), except that we replace colors c n0+1 , . . ., c n0+m0 by c i .
Let S * be an optimal set cover on I 0 and assume that S i ∈ S * , we consider the instance I i of LABELED Min P M. From S * , we can easily construct a perfect matching M * i of I i that uses exactly |S * | colors.Conversely, let M i be a perfect matching on I i ; by construction, the subset S = {S k : c k ∈ L(M i )} of S is a set cover of X using |L(M i )| sets.Finally, let A be an approximate algorithm for LABELED Min P M, we compute n 0 perfect matchings M i , applying A on instances I i .Thus, if we pick the matching that uses the minimum number of colors, then we can polynomially construct a set cover on I 0 of cardinality this number of colors.
On the other hand, dealing with LABELED Max P M r in K n,n , the result of [8] shows that the case r = 2 is polynomial, whereas it becomes NP-hard when r = Ω(n 2 ).Indeed, it is proved in [8] that, on the one hand, we can compute a good matching in K n,n within polynomial-time when each color appears at most twice and, on the other hand, there always exists a good matching in such a graph if n ≥ 3.An interesting question is to decide the complexity and the approximability of LABELED Max P M r when r is a constant greater than 2.

Approximation algorithm for LABELED Min P M r
Let us consider the greedy algorithm for LABELED Min P M r in complete bipartite graphs that iteratively picks the color that induces the maximum-size matching in the current graph and delete the corresponding vertices.Formally, if L(G ) denotes the colors that are still available in the graph G at a given iteration and if G [c] (resp., G [V ]) denotes the subgraph of G that is induced by the edges of color c (resp., by the vertices V ), then the greedy algorithm consists in the following process: Proof.Let I = (G, L) be an instance of LABELED Min P M r , we denote by C i for i = 1, . . ., r be the set of colors of the approximate solution which appears exactly i times in C and by p i its cardinality; finally, let M i denote the matching with colors C i .If apx(I) = |C |, then we have: Let C * be an optimal solution corresponding to the perfect matching M * of size opt(I) = |C * |; we denote by E i the set of edges from M * that belong to G[∪ i k=1 V (M k )], the subgraph induced by ∪ i k=1 V (M k ) and we set q i = |E i \E i−1 | (where we assume that E 0 = ∅).For any i = 1, . . ., r − 1, we get: We also have the following inequality for any i = 1, . . ., r − 1: Since M * is a perfect matching, the quantity Because each color appears on at most r edges, the result follows.
I is clearly an instance of LABELED Min P M r .The set of colors C = {c i, j i : i = 1, . . ., r, j = 1, . . ., n i } is the approximate solution outputted by Greedy and it uses apx(I) = (H r + r) × r! colors, whereas C * = {c * i,j : i = 1, 2, j = 1, . . ., r!} is the set of colors that are used by an optimal solution; this latter verifies opt(I) = 2 × r!.The Figure 3 describes the instance I for r = 2.
We conjecture that LABELED Min P M is not O(n ε )-approximable in complete bipartite graphs.Thus, a challenge will be to give better approximate algorithms or to improve the lower bound.

3 output C ; Theorem 3 . 3 1 i
Greedy is an Hr+r 2 -approximation of LABELED Min P M r in complete bipartite graphs where H r is the r-th harmonic number H r = r i=1 , and this ratio is tight.