• Aucun résultat trouvé

Branch & Recharge

that

• A\ {v}is also lexicographically embeddible;

• Every vertexu6∈Aadjacent tov, is assigned to a slot with numberσ(v)orσ(v)−

1.

By making use of this observation, we perform dynamic programming over all sub-sets ofV to compute all lexicographically embeddible subsets ofV. This compu-tation requires O(2n) steps and space. Finally, if the setV is lexicographically embeddible,V=An⊃An−1⊃ · · · ⊃A1⊃A0=/0. Then by Lemma11.1, these sets can be used to construct a layout of width at mostB.

Since we tryO(3n)assignments, we have that in total the running time of the algorithm isO(2n·3n) =O(6n)and we conclude with the following theorem.

Theorem 11.2.TheBANDWIDTHMINIMIZATIONproblem is solvable in timeO(6n) using exponential space.

Exercise 11.3.Improve the running time of the algorithm of Theorem 11.2 to O(5n).

11.2 Branch & Recharge

In Chap.6a Measure & Conquer analysis of branching algorithms has been pre-sented. In this section a branching algorithm is established which solves an enu-meration problem for generalized domination. To analyse the running time of the algorithms weights are attributed to the vertices of the graph and these weights are redistributed over the graph by a recharging mechanism. This recharging is used to guarantee that all branchings have essentially the same branching vector, which leads to an easy time analysis. This approach allows us to construct and analyse a branching algorithm for a class of problems while the branching algorithms in previous chapters are problem dependent.

(σ,ρ)-Dominating Set Enumeration Problem. Letσandρbe two nonempty sets of nonnegative integers. In the(σ,ρ)-DOMINATING SET ENUMERATION PROBLEM

(Enum-(σ,ρ)-DS) we are given an undirected graphG= (V,E). The task is to enumerate all(σ,ρ)-dominating setsS⊆V ofG, i.e.Sis a vertex subset satisfying that|N(v)∩S| ∈σ for allv∈Sand|N(v)∩S| ∈ρfor allv∈V\S.

The table in Fig.11.2shows a few previously defined and studied graph invari-ants which can be expressed in this framework.

We consider theEnum-(σ,ρ)-DSproblem assuming that σ is successor-free, i.e. does not contain a pair of consecutive integers, and that bothσ andρare finite.

These conditions are satisfied, for example, for perfect codes and strong stable sets (see Fig.11.2).

σ ρ (σ,ρ)-dominating set {0,1,2, . . .} {1,2,3, . . .} dominating set

{0} {0,1,2, . . .} independent set

{0} {1} perfect code

{0} {0,1} strong stable set {0} {1,2,3, . . .}independent dominating set {1} {1} total perfect dominating set

Fig. 11.2 Examples of(σ,ρ)-dominating sets

We present an algorithm enumerating all(σ,ρ)-dominating sets using a Branch

& Recharge approach. The upper bound of the running time of the branching algo-rithm immediately implies a combinatorial upper bound on the number of(σ, ρ)-dominating sets.

Theorem 11.4.Ifσ is successor-free and both setsσ andρ are finite then all the (σ,ρ)-dominating sets of an input graph G= (V,E)without isolated vertices can be enumerated in timeO(cn), where c=cp,q<2is a constant depending only on p=maxσ and q=maxρ. Moreover, every isolate-free graph G containsO(cn) (σ,ρ)-dominating sets, where c=cp,q<2(is the same constant).

To see that one may assume max{p,q}>0, notice that ifσ=ρ={0}then for every isolate-free graph the empty set is the unique(σ,ρ)-dominating set.

Now we describe the details of the branching algorithm. The recursive algorithm enum-sigma-rhodescribed in Fig.11.3is the principal part of the branching al-gorithm solvingEnum-(σ,ρ)-DSfor an input graphG= (V,E). The overall enu-meration algorithm first computes an (arbitrary) breadth-first search (BFS) order-ingv1,v2, . . . ,vnof the input graphG. Then we callenum-sigma-rho(G,/0,/0,[]) where [] is an empty list. This algorithm outputs a listL containing all (σ, ρ)-dominating sets. (The list is organized in such a way that it does not contain multi-ples and also concatenation does not create multimulti-ples.) A simple check of the output listLremoves all setsSwhich are not(σ,ρ)-dominating sets and outputs the list of all(σ,ρ)-dominating sets.

Similar to Measure & Conquer analysis of graph algorithms, weights are used to analyse the branching algorithm. To analyse the branching algorithm enum-sigma-rhoone first assigns a weight of 1 to each vertex of the input graph. Thus the input graph has (total) weightw(G) =∑v∈Vw(v) =n. In every instance of a subproblem (G,S,S,L), the weight of a vertex of the graphGis a real in[0,1]. Furthermore the total weight of the graph of a subproblem is smaller than the weight of the original problem. Finally if a vertex is assigned to Sor S then its weight is set to 0. This set-up is similar to the analyses in Chaps.2and6.

Now the new idea of the analysis is to guarantee the branching vector(1,1+ε) for all branchings, whereε=max{p,q}1 >0 and p=maxσ,q=maxρ. Because of ε>0 this immediately implies a running time ofO(cn), wherec<2 is the positive real root of the characteristic polynomialx1+ε−xε−1.

11.2 Branch & Recharge 177

Algorithmenum-sigma-rho(G,S,S,L).

Input: A graphG= (V,E), disjoint vertex subsetsS,S, and a listLof candidate vertex subsets.

Output: ListLof all(σ,ρ)-dominating setsDinGsatisfyingSDandSD=/0.

ifthere is no free vertexthen L:=L∪ {S}

else

letvbe the last free vertex in the BFS ordering ofV ifv is the first vertex in the BFS orderingthen

L:=L∪ {S,S∪ {v}}

Halt else

iffree vertex x s.t. x adjacent to v and|N(x)S|=max{p,q}then S:=S∪ {v}

else

if∃xS s.t. v is its unique free neighborthen if|N(x)∩S| ∈σthenS:=S∪ {v}

if|N(x)∩S|+1σthenS:=S∪ {v}

if{|N(x)S|,|N(x)S|+1} ∩σ=/0thenHalt if∃x s.t.|N(x)S|>max{p,q}thenHalt

ifv is (still) freethen

concatenate the listsenum-sigma-rho(G,S,S∪ {v},L)and enum-sigma-rho(G,S∪ {v},S,L)

elseenum-sigma-rho(G,S,S,L)

Fig. 11.3 Algorithmenum-sigma-rhocomputes a listLcontaining all(σ,ρ)-dominating sets of a graphG(and possibly some more vertex sets) when called forG,S=/0,S=/0 and empty listL.

How can this be achieved? Firstly algorithmenum-sigma-rhocontains only one branching rule. Suppose the algorithm branches on the free vertexvandw(v)<

1. Recharging guarantees that the weight ofvis increased such thatw(v) =1 before the branching on vertexvis performed. How recharging is done will be explained later. If the algorithm branches on a vertexv, then vertexvis either selected, i.e.

chosen in the solutionS⊆V, ordiscarded, i.e. not chosen in the solutionS⊆Vand thus taken intoS. When branching on a vertexv, guaranteed to have weight 1, then the weight of the graph decreases by at least 1 whenvis discarded, and it decreases by at least 1+εwhenvis selected in the so far generated candidateSfor a(σ, ρ)-dominating set. In each case the weight ofGdecreases by 1 since the weight ofvis set to 0. In case of selection a free neighbor ofvsends a weight ofε, i.e. its weight is decreased byε, and the weight ofGis decreased by 1+ε.

It remains to describe how the weight of the vertexv, chosen to branch on since it is the last free vertex in the BFS ordering ofG, can be reset to 1 ifw(v)>1. Let us emphasize that this recharging is done without changing the weight of the graph.

The procedurerechargeis described in Fig.11.4. Notice that this procedure takes as input the vertex vwhose weight has to be increased to 1, the current weight functionw:V→[0,1]of the graphGand a directed graphHon the same vertex set

asGstoring all exchanges of weights such that there is a directed edge fromutov inHiffusent a weight ofεtov, in the execution producing the current instance.

Procedurerecharge(v,S,S,w,H)

Note that in the procedurerechargethe verticesw1, . . . ,wt are distinct, while u1, . . . ,utneed not be. If someuis the chosen free neighbor of several, sayk, vertices fromw1, . . . ,wt, then its weight drops bykεand alsokedges starting atuare added toH. It can be shown that eachwihas another free neighbor inG. To guarantee that recharging works correctly and is always possible it is crucial thatσ is successor-free. The process of recharging a vertexvis illustrated in Fig.11.5.

Fig. 11.5 Recharging vertexv

On the left side of Fig.11.5, a vertexvsent a weight ofεto each of its neighbors w1,w2,w3,w4andw5, at the time whenwiwas assigned toS. Sinceσis successor-free, each wi,i∈ {1, . . . ,5}, has a free neighbor uk, k∈ {1, . . . ,5} (otherwise,v would be forced by a reduction rule and thus the algorithm would not branch on v). The value ofεensures that each free vertexukhas a weight no smaller thanε (otherwise, such a vertex would have more neighbors inSthan allowed byσandρ).

On the right side of Fig.11.5, the vertexvis recharged. For eachk, a weight ofεis sent fromukto one or morewi. The redistribution of the weights ensuresw(v) =1.

The correctness of the recharging procedure and the fact that the weight of the vertexvto branch on can always be reset to 1 by redistribution of weights (without

11.3 Subexponential Algorithms and ETH 179