• Aucun résultat trouvé

Set Cover and Dominating Set

Minimum Set Cover.In the MINIMUMSETCOVERproblem (MSC) we are given a universeU of elements and a collectionSof (non-empty) subsets ofU. The task is to find the minimum cardinality of a subsetS0⊆ SwhichcoversU, i.e.S0satisfies

S∈S0S=U.

Aminimum set coverofUis a minimum cardinality subsetS0⊆ Swhich coversU. LetU be a ground set ofnelements, and letS={S1,S2, . . . ,Sm}be a collection of subsets ofU. We say that a subsetS0⊆ Scoversa subsetS⊆ U, if every element inSbelongs to at least one member ofS0.

Note that a minimum set cover of(U,S)can trivially be found in timeO(n2m) by checking all subsets ofS.

Theorem 3.10.There is anO(nm2n)time algorithm to solve theMSCproblem for any instance(U,S)where|U |=n and|S|=m.

Proof. Let(U,S)withS={S1,S2, . . . ,Sm}be an instance of the minimum set cover problem over a ground setUwith|U |=n.

For every nonempty subset U ⊆ U, and for every j=1,2, . . . ,m we define OPT[U;j]as the minimum cardinality of a subset of {S1, . . . ,Sj} that coversU.

If{S1, . . . ,Sj}does not coverUthen we setOPT[U;j]:=∞.

Now all valuesOPT[U;j]can be computed as follows. In the first step, for every subsetU⊆ U, we setOPT[U; 1] =1 ifU⊆S1, andOPT[U; 1] =∞otherwise. Then in step j+1, j∈ {1,2, . . . ,m−1},OPT[U;j+1]is computed for allU⊆ UinO(n) time as follows:

OPT[U;j+1] = min{OPT[U;j], OPT[U\Sj+1;j] +1}.

This yields an algorithm to computeOPT[U;j]for allU⊆ Uand allj∈ {1,2, . . . ,m}

of overall running timeO(nm2n). ThereforeOPT[U;m]is the cardinality of a

min-imum set cover of(U,S). ut

3.2 Set Cover and Dominating Set 37 Now let us show how the dynamic programming algorithm of Theorem3.10can be used tobreak the2nbarrierfor the MINIMUMDOMINATINGSETproblem; that is to construct anO(cn)algorithm withc<2 solving this problem.

Minimum Dominating Set. In the MINIMUM DOMINATING SET problem (MDS) we are given an undirected graphG= (V,E). The task is to find the minimum cardinality of a dominating set inG.

A vertex subsetD⊆V of a graphG= (V,E)is adominating setforGif every vertex ofGis either inD, or adjacent to some vertex inD. Thedomination number γ(G)of a graphGis the minimum cardinality of a dominating set ofG. TheMDS problem asks us to computeγ(G).

The MINIMUM DOMINATING SET problem can be reduced to the MINIMUM

SETCOVERproblem by imposingU =V andS={N[v]: v∈V}. Note thatN[v]

is the set of vertices dominated byv, thusDis a dominating set ofGif and only if {N[v]: v∈D}is a set cover of{N[v]: v∈V}. In particular, every minimum set cover of{N[v]: v∈V}corresponds to a minimum dominating set ofG.

We use Theorem3.10to prove the following result.

Theorem 3.11.Let G= (V,E)be a graph on n vertices given with an independent set I. Then a minimum dominating set of G can be computed in time2n−|I|·nO(1). In particular, a minimum dominating set of a bipartite graph on n vertices can be computed in timeO(2n/2).

Proof. LetJ=V\Ibe the set of vertices outside the independent setI. Instead of trying all possible subsetsDofV as dominating sets, we try all possible projections ofDonJ, and for each such projectionJD=J∩D, we decide whetherJDcan be extended to a dominating set ofGby adding only vertices ofI. In fact, for every JD⊆Jthe smallest possible number of vertices ofIshould be added toJDto obtain a dominating set ofG

For every subsetJD⊆J, we show how to construct a setDsuch that

|D|=min{|D0|: D0is a dominating set andJ∩D0=JD}. (3.4) Then obviously

γ(G) =min

JD⊆J|D|.

The setID=I\N(JD)is a subset ofDsinceIis an independent set and the vertices ofIDcannot be dominated byJD. Then the only vertices that are not dominated by ID∪JDare the verticesJX=J\(N[JD]∪N(ID)). Therefore, to findDwe have to add toID∪JDthe minimum number of vertices fromI\IDthat dominate all vertices of JX. To find a minimum subset ofI\IDwhich dominatesJX, we reduce this problem toMSCby imposingU=JX andS={N[v]: v∈I\ID}. By Theorem3.10, such a problem is solvable in time 2|JX|·nO(1). Thus the running time of the algorithm (up to a polynomial factor) is

JD

⊆J

In the remaining part of the proof we show how to improve the running time 3n−|I|

to the claimed 2n−|I|. There is a general theorem based on fast subset convolution which will be proved in Chap.7 that can do this job. However, for this case, we show an alternative proof based on dynamic programming.

Once again, we want to show that

can be evaluated in time 2n−|I|·nO(1). Instead of trying all subsets ofJand then for each subset constructing a dominating set D, we do the following. For every subsetX⊆Jwe compute a minimum subset ofIwhich dominatesX. We can com-pute this by performing the following dynamic programming. Let us fix an ordering {v1,v2, . . . ,vk}ofI. We defineDX,ia subset of{v1,v2, . . . ,vi}of the minimum size subset which dominatesX. ThusDX,k is a subset ofI dominatingX of minimum size. We putD/0,k=/0 and forX6=/0,

DX,1=

v1, ifX⊆N(v1), {v1,v2, . . . ,vk}, otherwise.

To compute the valuesDX,ifori>1, we consider two cases. Either the optimum set is a subset of{v1,v2, . . . ,vi−1}, or it containsvi. Thus are computed, constructing a setDsatisfying (3.4) for every subsetJD⊆Jcan be done in polynomial time by computingD=ID∪JD∪DJX,k. In total, the running time needed to compute γ(G)is the time required to compute setsDX,k plus the time required to compute for every subsetJD subsetsID andDJX,k. Thus, up to a polynomial factor, the running time is

2|J|+

3.2 Set Cover and Dominating Set 39 u t The following binary entropy function is very helpful in computations involving binomial coefficients. For more information on Stirling’s formula and the binary entropy function the reader is referred to the Notes.

Lemma 3.12 (Stirling’s Formula). For n>0,

Thebinary entropy function his defined by

h(α) =−αlog2α−(1−α)log2(1−α) forα∈(0,1).

Lemma 3.13 (Entropy function).Forα∈(0,1), 1

Proof. We give only the proof of the second inequality.

Sinceh(α) =h(1−α), we can assume thatα≤1/2. By the Binomial Theorem,

u t By making use of Theorem3.11and the binary entropy function, it is possible to construct an algorithm solving theMDSproblem (for general graphs) faster than by trivial brute-force inΘ(2n).

Corollary 3.14.The MINIMUM DOMINATING SET problem is solvable in time O(1.7088n), where n is the number of vertices of the input graph.

Proof. Every maximal independent set of a graphGis also a dominating (not neces-sary minimum) set ofG. First we compute any maximal independent set ofG, which can be done by a greedy procedure in polynomial time. If the size of the maximal in-dependent set found is larger thanαn, for 0.2271<α<0.22711, by Theorem3.11, we can computeγ(G)in time 2n−αn·nO(1)=O(20.7729n) =O(1.7088n). If the size of the maximal independent set is at mostαn, then we know thatγ(G)≤αn, and by trying all subsets of size at mostαn, we can find a minimum dominating set in

time

n αn

·nO(1)=O

n 0.22711n

.

By making use of the formula for the entropy function (Lemma3.13), we estimate O

n 0.22711n

=O(20.7729n) =O(1.7088n).

u t In Chap.6we present a faster algorithm for the MINIMUMDOMINATINGSET

problem based on the Branch & Reduce paradigm and Measure & Conquer analysis.

Exercise 3.15.Construct a greedy algorithm to compute some (no matter which) maximal independent set of an input graphG= (V,E)in polynomial time. (Note that such a procedure is needed as part of the algorithm of Corollary3.14).) Exercise 3.16.The EXACTSETCOVERproblem is a covering problem. For a given universeU of elements and a collectionSof (non-empty) subsets ofU, the task is to determine the minimum cardinality of a subsetS0⊆ SwhichpartitionsU, i.e.

S∈S0S=U

and for every S,S0∈ S0, ifS6=S0 thenS∩S0= /0. Construct an exact algorithm solving the EXACTSETCOVERproblem on any input withnelements andmsets in timeO(nm2n).

Exercise 3.17.The EXACT SAT problem (XSAT) is a variant of the SATISFIA

-BILITYproblem, where for a given CNF-formula, the task is to find a satisfying assignment such that in every clause exactly one literal is true. Show thatXSATcan be solved in timeO(2m)on input CNF-formulas withmclauses.

Hint: ReduceXSATto the EXACT HITTING SET problem by eliminating literals

3.3 TSP on Graphs of Bounded Degree 41