Top Banner
Improved approximation bounds for the minimum rainbow subgraph problem an Katreniˇ c a,1, , Ingo Schiermeyer b a Institute of Computer Science, P. J. ˇ Saf´arik University in Koˇ sice, Jesenn´ a 5, 04154 Koˇ sice, Slovakia b Institut f¨ ur Diskrete Mathematik und Algebra, Technische Universit¨at Bergakademie Freiberg, 09596 Freiberg, Germany Abstract In this paper we consider the Minimum Rainbow Subgraph problem (MRS): Given a graph G with n vertices whose edges are coloured with p colours, find a subgraph F G of minimum order and with p edges such that F contains each colour exactly once. We present a polynomial time ( 1 2 +( 1 2 + )Δ)-approximation algorithm for the MRS problem for an arbitrary small positive . This improves the previously best known approximation ratio of 5 6 Δ. We also prove the MRS problem to be NP-hard and APX-hard for graphs with maximum degree 2. Finally we present an algorithm to find an optimal solution in running time O(2 (p+2p log 2 Δ) n O(1) ). 1. Introduction and motivation In this paper we consider only finite undirected graphs without loops or multiple edges. For a graph G =(V,E),V (G) and E(G) are the set of vertices and edges, respectively. The number of vertices and edges, denoted by |G| and ||G||, are the order and the size of G, respectively. Definition 1 (rainbow subgraph). Let G be a graphwith an edge-colouring. A subgraph X of G is called rainbow subgraph if X does not contain two edges of the same colour. Email addresses: [email protected] (J´ an Katreniˇ c), [email protected] (Ingo Schiermeyer) 1 This work was partially supported by the Slovak VEGA grant 1/0035/09. Preprint submitted to Elsevier September 22, 2010
10

Improved approximation bounds for the minimum rainbow subgraph problem

Jan 24, 2023

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Improved approximation bounds for the minimum rainbow subgraph problem

Improved approximation bounds for the minimum

rainbow subgraph problem

Jan Katrenica,1,, Ingo Schiermeyerb

a Institute of Computer Science,P. J. Safarik University in Kosice, Jesenna 5, 04154 Kosice, Slovakia

b Institut fur Diskrete Mathematik und Algebra,Technische Universitat Bergakademie Freiberg, 09596 Freiberg, Germany

Abstract

In this paper we consider the Minimum Rainbow Subgraph problem (MRS):Given a graph G with n vertices whose edges are coloured with p colours,find a subgraph F ⊆ G of minimum order and with p edges such that Fcontains each colour exactly once.

We present a polynomial time (12

+ (12

+ ε)∆)-approximation algorithmfor the MRS problem for an arbitrary small positive ε. This improves thepreviously best known approximation ratio of 5

6∆. We also prove the MRS

problem to be NP-hard and APX-hard for graphs with maximum degree 2.Finally we present an algorithm to find an optimal solution in running timeO(2(p+2p log2 ∆)nO(1)).

1. Introduction and motivation

In this paper we consider only finite undirected graphs without loops ormultiple edges. For a graph G = (V,E), V (G) and E(G) are the set ofvertices and edges, respectively. The number of vertices and edges, denotedby |G| and ||G||, are the order and the size of G, respectively.

Definition 1 (rainbow subgraph).Let G be a graph with an edge-colouring. A subgraph X of G is called rainbowsubgraph if X does not contain two edges of the same colour.

Email addresses: [email protected] (Jan Katrenic),[email protected] (Ingo Schiermeyer)

1This work was partially supported by the Slovak VEGA grant 1/0035/09.

Preprint submitted to Elsevier September 22, 2010

Page 2: Improved approximation bounds for the minimum rainbow subgraph problem

Problem 1 (Minimum Rainbow Subgraph problem (MRS)).Given a graph G with n vertices and an edge-colouring with p colours, find arainbow subgraph F ⊆ G of minimum order and with p edges.

Note that a solution for the MRS problem may consist of several rainbowcomponents. Furthermore, the given edge-colouring need not be a properedge-colouring.

Our research on the Minimum Rainbow Subgraph problem was motivatedby an application from bioinformatics. The generation of genome populationsin bioinformatics can be solved by computing minimum rainbow subgraphs(cf. [10] for a detailed description). This problem was also studied in [5]under the name minimum primer set and proved inapproximable to less thana [1− o(1)] lnn− o(1) factor (see [5]).

In [10] a polynomial time approximation algorithm is presented with anapproximation ratio of 5

6∆ for graphs with maximum degree ∆. In this

paper we improve the approximation ratio for polynomial time algorithmsby proving that for each positive number ε, one can construct a polynomialtime approximation algorithm with an approximation ratio of 0.5+(0.5+ε)∆.

Matos Camacho et al. [10] proved the MRS problem to be NP-hard andAPX-hard. In this paper we prove that this is true even for graphs withmaximum degree 2.

We also discuss the complexity of finding an optimal solution to the MRSproblem. We show that the optimal solution can be found in running timeO∗(2p) 2, for graphs with maximum degree ∆ = 2. For the general case,we show that the optimal solution can be found in running time O∗(2p∆2p).This shows that the MRS problem is fixed-parameter tractable for the classof graphs of bounded maximum degree when the number of edge colours isused as the parameter.

2. Improved approximation for MRS

We first present an approximation algorithm for trees. Suppose the edgesof G are coloured with p colours 1, 2, . . . , p. Let c be a colour function definedby c(e) = i if the edge e receives colour i.

Construct a graph G′ with V (G′) = {v1, v2, . . . , vp} (vi corresponds tocolour i) and vivj ∈ E(G′) if there exist two adjacent edges e, f ∈ E(G) with

2The notation O∗(f(n)) suppresses factors that are polynomial in n.

2

Page 3: Improved approximation bounds for the minimum rainbow subgraph problem

c(e) = i and c(f) = j. Now compute a maximum matching of size β(G′).This can be computed in running time O(

√nm) resp. O(n2.376) [11]. Next

construct a graph H with V (H) ⊆ V (G) as follows:For each matching edge of M choose two adjacent edges in G with these

two colours. For each vertex of V (G′) not in M choose an edge in G withthis colour. In this way we obtain a graph H with p edges and

|H| ≤ 2p− β(G′) (1)

In [10] the following result was presented, which has been first proved forconnected graphs with even size m by Kotzig [7].

Theorem 1. Let G be a connected graph of size m. Then E(G) containsbm

2c pairwise edge disjoint paths of order three.

If G contains a rainbow tree with p edges, then with Theorem 1 and (1)we obtain

|H| ≤ 2p− β(G′) ≤ 2p−⌊p

2

⌋≤ 3

2p+

1

2.

Similarly, if G contains a rainbow forest with p edges and t components,this implies |H| ≤ 3

2p+ 1

2t.

Lemma 1. If G contains a rainbow forest F with p edges and t components,then one can construct a solution H for the MRS problem with |H| ≤ 1.5p+0.5t in polynomial time.

An approximationH computed in this way will be called ForestApproximation(G).

We propose the following greedy algorithm for a fixed integer index k,k ≥ 3.

Algorithm 1: Greedy MRSk(G)

Input: A graph G on n vertices whose edges are coloured by p colours;Output: A rainbow subgraph H on p edges;H := ∅;

0. while G contains some rainbow subgraph L on exactly k vertices andat least k − 1 edges do

H := H ∪ L;G := Gr edges whose colours occur in L;

1. while G contains some rainbow cycle L doH := H ∪ L;G := Gr edges whose colours occur in L;

2. H := H ∪ ForestApproximation(G);return H;

3

Page 4: Improved approximation bounds for the minimum rainbow subgraph problem

2.1. The complexity

Since in each iteration during step 0 and step 1 at least one colour isremoved from G, the total number of iterations is at most p. We claim thateach iteration can be carried out in time O(k2nk):

• To find a rainbow subgraph on exactly k vertices and at least k−1 edgesone can check all combinations of k vertices, which is

(nk

). The number

of colours in a graph induced by a given combination of k vertices canbe computed in running time O(k2). This gives a complexity upperbound O(

(nk

)k2), which is O(k2nk).

• To find a rainbow cycle, from the previous step G does not containa connected rainbow subgraph on k vertices. Therefore, such a cyclehas at most k− 1 vertices. A variation of vertices uniquely identifies acycle, therefore one can check all variations of at most k − 1 vertices,which is at most O(

(n

k−1

)(k − 1)!). For a given variation of at most

k − 1 vertices of G one can easily check if it forms a rainbow cycle.This gives a complexity upper bound O(k2nk).

Thus the Greedy MRSk algorithm has time complexity O(pk2nk), whichis polynomial in the size of the input.

2.2. The approximation ratio

We shall prove that the Greedy MRSk(G) algorithm has an approxima-tion ratio of 0.5 + (0.5 + 1

k)∆. Consider an optimal solution F for G.

Let p1 denote the number of colours corresponding to edges that wereadded to H during steps 0 and 1. Let p2 = p− p1. Let t2 denote the numberof components of F∩G during step 2. By construction the number of verticesadded to H during the steps 0 and 1 is at most (1 + 1

k−1)p1 and the number

of vertices added to H during step 2 is at most 1.5p2 + 0.5t2 by Lemma 1.Therefore

|H| ≤ (1 +1

k − 1)p1 + 1.5p2 + 0.5t2. (2)

Since F ∩G is a forest at step 2, p2 ≤ |F | − 1. Since (1 + 1k−1

) ≤ 1.5, fork ≥ 3, the right side of (2) is largest for p2 = |F | − t2 and p1 = p− |F |+ t2.We obtain

4

Page 5: Improved approximation bounds for the minimum rainbow subgraph problem

|H| ≤ (k

k − 1)(p− |F |+ t2) + 1.5(|F | − t2) + 0.5t2

= (k

k − 1)p− (

k

k − 1)|F |+ (

k

k − 1)t2 + 1.5|F | − t2

= |F |(( k

k − 1)p

|F |− 1− (

1

k − 1) + 1.5) + (

1

k − 1)t2

≤ |F |(( k

k − 1)p

|F |+ 0.5)

Note that in the last line we have used t2 ≤ |F |.

Theorem 2. Let G be an instance of the MRS problem having n verticesand edges coloured by p colours. Let F be an optimal solution having |F |vertices and p edges. The algorithm Greedy MRSk(G) runs in time O(pk2nk)and returns a solution having at most 0.5|F |+ (1 + 1

k−1)p vertices.

Corollary 1. For every positive ε > 0 there is a polynomial time approxi-mation algorithm on MRS with an approximation ratio of 0.5 + (0.5 + ε)∆,for graphs having maximum degree ∆.

Proof. Let F be an optimal solution for the MRS problem having |F | verticesand p edges. Clearly, the degree of each vertex in F is at most ∆. Therefore,p|F | ≤

∆2

. Using Theorem 2 we get an approximation ratio of 0.5+(1+ 1k−1

)∆2

which is at most 0.5 + (0.5 + 1k)∆.

To get an approximation algorithm with ratio of 0.5 + (0.5 + ε)∆, it isenough to use the Greedy MRSk algorithm for a sufficiently large integer k.

3. The MRS problem for ∆ = 2

The MRS problem is NP-hard and APX-hard [10], since this is a kindof generalization of the Pure Parsimony Haplotyping problem [8, 9]. Weprovide a proof that the MRS problem remains hard even for graphs withmaximum degree 2. Our proofs rely on a result of Berman and Karpinsky [2]on the 3-OCC-MAX 2SAT problem. This problem is the restriction of themaximum satisfiability problem to instances for which each clause containsat most two variables and each variable occurs in at most three clauses.

Theorem 3 (Berman and Karpinsky [2]). For every ε > 0, it is NP-hard toapproximate 3-OCC-MAX 2SAT within a factor of 2012

2011− ε.

5

Page 6: Improved approximation bounds for the minimum rainbow subgraph problem

In the following we shall assume that no clause contains a variable morethan once, and for each variable x the input formula contains at least oneclause with literal x and at least one clause with literal x. Such a reducedproblem is NP-hard to approximate within a factor of 2012

2011− ε, see e.g. [12].

Theorem 4. The Minimum Rainbow Subgraph problem is NP-hard for graphswith maximum degree ∆ = 2.

Proof. We reduce 3-OCC-MAX 2SAT to MRS with ∆ = 2. Let F bean instance of the 3-OCC-MAX 2SAT problem having n variables and cclauses C1, . . . , Cc. Let occ(l, j) denote the total number of occurrences ofliteral l in clauses C1, C2, . . . , Cj. Clearly, occ(l, j) ∈ {0, 1, 2} for each land j. From a given formula F we create a graph G having 4n + c ver-tices a1, . . . , ac, x

11, . . . , x

1n, x2

1, . . . , x2n, x1

1, . . . , x1n, x2

1, . . . , x2n and n+c colours

A1, . . . , Ac, B1, . . . , Bn. For i = 1, . . . , n we put into G edges (x1i , x

2i ) and

(x1i , x

2i ) coloured by Bi. For each literal l and j = 1, . . . , c if the j-th clause

contains literal l then put into G an edge (locc(l,j), aj) coloured by colour Aj.Clearly, G has maximum degree at most 2. To finish the proof we prove thefollowing:

Lemma 2. One can satisfy at least s clauses in F if and only if the MRSfor G has at most 2n+ 2c− s vertices.

We will say that a subgraph H covers a colour, if at least one edge of Hhas this colour.⇒ Let R be the solution for F satisfying s clauses. We construct a

solution H for a graph G having 2n + 2c − s vertices in the following way.H consists of all vertices a1, . . . , ac, and for each literal l ∈ R put into Hvertices {l1, l2}. Now, at most c − s colours among of A1, . . . , Ac are notcovered by H. Therefore, for each clause C, which is unsatisfied by R, addinto H vertex l1, l ∈ C. Now |H| = c + 2n + c − s and H covers all thecolours.⇐ Let H ⊆ G be a MRS for G with |H| = 2n + 2c − s. To cover

all colours A1, . . . , Ac, H must contain all the vertices a1, . . . , ac. To covercolour Bi, H must satisfy {x1

i , x2i } ⊆ V (H) or {x1

i , x2i } ⊆ V (H), for each

i = 1, . . . , n. We construct a solution R for the formula F satisfying sclauses. For each variable x, if {x1, x2} ⊆ V (H), then we put x into R,otherwise {x1, x2} ⊆ V (H) and we put x into R. Now let H ′ ⊆ H withV (H ′) = {a1, . . . , ac} ∪ {lq : l ∈ R, q = 1, 2}. Since V (H ′) ⊆ V (H) and|H ′| = c + 2n, H ′ does not cover at most c − s colours among A1, . . . , Ac.

6

Page 7: Improved approximation bounds for the minimum rainbow subgraph problem

Since colour Ai corresponds to satisfying clause Ci, R satisfies at least sclauses.

Theorem 5. The Minimum Rainbow Subgraph problem is APX-hard forgraphs with maximum degree ∆ = 2.

Proof. We use the same reduction as in the previous proof. First, note thatc ≤ 3s, because one can always satisfy at least 1

3of clauses of any instance

of 3-OCC-2MAX SAT. This also implies n ≤ 3s because there are at most2 literals in each clause and each variable occurs at least twice. Let Hbe an optimal solution of MRS problem for G. According to Lemma 2,|H| = 2n+ 2c− s.

Now consider a polynomial time approximation algorithm with an approx-imation ratio of 1+a for the MRS problem with ∆ = 2. Such an algorithm re-turns a solution H ′′, |H ′′| ≤ (1+a)(2n+2c−s) = (2n+2c−s)+2an+2ac−as.Using c ≤ 3s, n ≤ 3s we get |H ′′| ≤ (2n+ 2c− s) + 11as.

Now, we are going to create a solution R′′ for SAT. Since H ′′ coversall colours B1, . . . , Bc, for each variable x it holds that {x1, x2} ⊆ V (H ′′)or {x1, x2} ⊆ V (H ′′). If {x1, x2} ⊆ V (H ′′) then we put literal x into R′′,otherwise {x1, x2} ⊆ V (H ′′) and we put x into R′′.

Now let H ′ ⊆ H ′′ with V (H ′) = {a1, . . . , ac} ∪ {lq : l ∈ R′′, q = 1, 2}.Since H ′ ⊆ H ′′ and |H ′| = c + 2n, H ′ does not cover at most c − s + 11ascolours among A1, . . . , Ac. Since colour Ai corresponds to satisfying clauseCi, R

′′ satisfies at least s−11as clauses. Therefore, R′′ has an approximationratio of at most 1

1−11a. Finally Theorem 3 claims 3-OCC-MAX 2SAT is NP-

hard to approximate within ratio 20122011− ε, that implies a cannot be smaller

than 111·2012

, unless P = NP .

4. Finding an optimal solution

Let G be a graph having n vertices, m edges, maximum degree ∆ andedges coloured by p colours. A straightforward algorithm to find an opti-mal solution for the MRS problem can check all possible combinations ofedges. Such an approach leads to the complexity upper bound O(mp), sinceit chooses p edges from the set of m edges.

Let C denote the set of all rainbow connected subgraphs of G. The MRSproblem can be transformed to a weighted set covering problem [6], whereone needs to cover the set of all colours by elements of C, where the weight

7

Page 8: Improved approximation bounds for the minimum rainbow subgraph problem

of subgraph C, C ∈ C, is |C|. Therefore, if |C| is polynomial in n (e.g. if∆ ≤ 2), a simple dynamic programming can be used to get a O∗(2p) time,O∗(2p) space exact algorithm [4]. Moreover, for any r ≥ 1 one can constructan (1 + ln r)-approximation algorithm which runs in O∗(2p/r) time [4].

In the following, we provide an exact algorithm to MRS running inO∗(2p∆2p) time and O∗(2p) space. Our technique is motivated by [1] wherea combination of random ordering and dynamic programming was used forfinding simple paths in graphs.

First consider the case that the colouring in the input is a proper edgecolouring and an optimal solution F is a connected subgraph of G.

We denote by Walk(v, c1, c2, . . . , ct) the set of all vertices of G containedin a walk starting in a vertex v ∈ V (G) and traveling along edges of coloursc1, c2, . . . , ct. We say that a sequence of colours c1, c2, . . . , ct reveals the sub-graph F , if for some vertex v holds V (F ) = Walk(v, c1, c2, . . . , ct).

A sequence of colours revealing F is enough to construct a solution of size|F | in polynomial time. The only question is, how to get such a sequence.Clearly, F can be traveled in at most 2(|F |−1) steps, since one can constructsuch a walk from a spanning tree of F visiting each edge at most twice.Generating all possible sequences of colours of length at most 2p− 1, we getan algorithm which runs in time O∗(p2p).

Now consider the case that the optimal solution F is not connected but wehave one sequence of colours c1, c2, . . . , ct, which is a concatenation of severalsequences, each revealing one component of F . We resolve this sequenceusing dynamic programming. I.e. for each subset of colours S and for eachpair of integers i, j, i < j we solve a subproblem (S, i, j) indicating theminimum order of a subgraph of G having reveal sequence ci, . . . , cj andcontaining all colours of S. For a subgraph L, L ⊆ G, let ColourSet(L)denote the set of all colours occurring at edges of L. The following functionis an example of implementation, which computes the minimum order ofa solution using memoization [3], which is a technique to avoid repeatingthe calculation of results for previously processed inputs. The algorithmstarts by setting sol[S, i, j] =? for every S ⊆ 2[p], i, j ∈ {1, . . . , t} and callssolve({1, 2, . . . , p}, 1, t), where 2[p] denotes the power set of {1, 2, . . . , p}.

8

Page 9: Improved approximation bounds for the minimum rainbow subgraph problem

Function solve(S, i, j)

Input: set of colours S, integers i, j ≤ t;Output: the minimum order of a subgraph of G covering S and

having reveal sequence ci, . . . , cj;if S = ∅ then

return 0;if i > j then

return +∞;if sol[S, i, j] 6=? then

return sol[S, i, j];sol[S, i, j] := +∞ ;for k := i to j do

foreach v ∈ V doC := Walk(v, ci, . . . , ck);sol[S, i, j] :=min(sol[S, i, j], |C|+ solve(S r ColourSet(C),k + 1,j));

return sol[S, i, j];

Since the total number of subproblems is O(2pt2) and each subproblemis computed in O(nO(1)) time (using results of shorter subproblems), onesequence of colours can be resolved in time and space O∗(2pt2). Finally,considering all sequences of colours of length at most 2p, we get an algorithmwhich runs in time O∗(2p+2p log2 p), if the input colouring is a proper colouring.

To resolve the case when the input colouring is not a proper edge colour-ing, one can generate a sequence of positive integers not greater than ∆,instead of a sequence of colours. The total number of such sequences is atmost O(22p log2 ∆).

Theorem 6. There is a deterministic algorithm to find an optimal solutionon the MRS problem which runs in O(2(p+2p log2 ∆)nO(1)) time and O(2pnO(1))space.

Using the O∗ notation this algorithm runs in O∗(2p∆2p). This shows thatMRS problem is fixed-parameter tractable for the class of graphs of boundedmaximum degree when the number of edge colours is used as the parameter.

AcknowledgementWe would like to thank the three referees for their valuable comments andsuggestions.

9

Page 10: Improved approximation bounds for the minimum rainbow subgraph problem

[1] N. Alon, R. Yuster, and U. Zwick. Color-coding. J. ACM, 42(4):844–856,1995.

[2] P. Berman and M. Karpinski. On some tighter inapproximability re-sults. In Proc. of the 26th Int. Colloquium on Automata, Languages andProgramming, volume 1644 of Lecture Notes in Computer Science, pages200–209. Springer, Berlin, 1999.

[3] T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introductionto Algorithms, pages 347–349. MIT Press, 2007.

[4] M. Cygan, L. Kowalik, and M. Wykurz. Exponential-time approxima-tion of weighted set cover. Inf. Process. Lett., 109(16):957–961, 2009.

[5] R. J. Fernandes and S. S. Skiena. Microarray synthesis through multiple-use PCR primer design. Bioinformatics, 18(1):128–135, 2002.

[6] R. Karp. Reducibility among combinatorial problems. In R. Miller andJ. Thatcher, editors, Complexity of Computer Computations, pages 85–103. Plenum Press, 1972.

[7] A. Kotzig. From the theory of finite regular graphs of degree three andfour. Casopis Pestov. Mat., 82:76–92, 1957.

[8] G. Lancia, M. C. Pinotti, and R. Rizzi. Haplotyping populations bypure parsimony: Complexity of exact and approximation algorithms.INFORMS Journal on Computing, 16(4):348–359, 2004.

[9] G. Lancia and R. Rizzi. A polynomial case of the parsimony haplotypingproblem. Oper. Res. Lett., 34(3):289–295, 2006.

[10] S. Matos Camacho, I. Schiermeyer, and Z. Tuza. Approximation algo-rithms for the minimum rainbow subgraph problem. Discrete Mathe-matics, 310(20):2666–2670, 2010.

[11] M. Mucha and P. Sankowski. Maximum matchings via gaussian elimi-nation. In Proc. of the 45th Annual IEEE Symposium on Foundationsof Computer Science, pages 248–255. IEEE Computer Society, Wash-ington, DC, 2004.

[12] D. Rautenbach and F. Regen. On packing shortest cycles in graphs. Inf.Process. Lett., 109(14):816–821, 2009.

10