• Aucun résultat trouvé

f -width and Rank-width

Width parameters of graphs, which are often defined by graph decompositions, are of great importance in graph theory as well as in the design and analysis of graph algorithms. One of the best known width parameters of graphs is the treewidth to which Chap.5is devoted. Other well-known width parameters of graphs are clique-width and rank-clique-width. In this section we consider a generalization of rank-clique-width.

The f -widthof a finite setU is a general framework for width parameters. Note that thef-width can be seen as the width parameter of a graphG= (V,E). Though in general f-width is independent of the edge setE, various interesting width parame-ters for graphs can be obtained as the f-width of the vertex setVvia the choice of f. If f is a cut-rank function then the f-width ofV is the well-known graph parameter rank-width. Other width parameters of graphs that can be obtained as the f-width ofV are thecarving-widthand thebranching-width of a connectivity function f. In this section we present a fast subset convolution basedO(2n)time algorithm to compute the f-width of a graph, assuming that f is given by an oracle and that the integer values of f are small.

f -width of Sets. LetU be a set ofn elements and let f : 2U →Z be a function assigning to each subset ofU an integer. Arooted binary tree T is a directed tree with a specified vertexrcalled the root such that the rootrhas two incoming edges and no outgoing edges and every vertex other than the root has exactly one outgoing edge and either two or zero incoming edges. A leaf of a rooted binary tree is a vertex with no incoming edges. A descendent of an edgeeof a rooted binary treeT is the set of vertices from which there exists a directed path toe.

Adecompositionof a setU is a pair(T,µ)of a rooted binary treeT and a bijec-tionµfromU to the set of all leaves ofT. For a decomposition(T,µ)ofU and an edgeeof the binary rooted treeT, letXe⊆ Ube the set of all elements ofU being assigned to a leaf ofT which is also a descendent ofe. Now we define the f -width of a decomposition(T,µ)ofU as the minimum of f(µ−1(Xe))over all edgeseof T. Finally, the f -widthof a finite setU, denoted bywf(U), is the minimumf-width over all possible decompositions ofU. If|U | ≤1 thenU has no decomposition but we letwf(U) =f(U).

7.4 f-width and Rank-width 137 LetG= (V,E)be a graph. There are three important width parameters ofGthat can be defined via f-width.

Branch-width.For branch-width, we putU=E, the edge set ofG. For everyX⊆E itsborderδ(X)is the set of vertices fromV such that everyv∈δ(X)is adjacent to an edge fromX and to an edge fromE\X. Thebranch-widthofGis the f-width ofU=Ewith f(X) =|δ(X)|. This definition can be extended to hypergraphs and matroids.

Carving-width.Thecarving-widthof a graphG= (V,E)is the f-width ofU =V, with f(X) =CU T(X,V\X), the number of edges betweenXandV\X.

Rank-width.Therank-widthof a graphG= (V,E)is the f-width ofU=V, where f=ρG, the cut-rank function ofG. Here the cut-rank function is defined as follows.

For a vertex subsetX⊆V, let

BG(X) = (bi,j)i∈X,j∈V\X,

be the|X| × |V\X|matrix over the binary field GF(2)such thatbi,j=1 if and only if{i,j} ∈E. In other words,BG(X)is the adjacency matrix of the bipartite graph formed fromGby removing all edges but the edges betweenX andV\X. Finally, ρG(X)is the rank ofBG(X).

The following recursive definition of wf will be used to compute the f-width wf(U).

Lemma 7.16.LetU be a finite set and let f : 2U →Zbe a function. Then for all nonempty subsets X⊆ U,

wf(X) = ( min

/0⊆Y⊆Xmax f(Y),f(X\Y),wf(Y),wf(X\Y)

if|X| ≥2

f(X) if|X|=1

(7.12) Lemma7.16allows a simple dynamic programming exponential time algorithm to compute the f-width of a finite setUbased on the recurrence (7.12).

Let us assume that n=|U |andM=maxX⊆U|f(X)|. Furthermore we assume that an oracle computes the integer value of any f(X)in time nO(1). Under these assumptions the simple dynamic programming algorithm to computewf(X)for all X ⊆ U needs time O(2n) to compute f(X) for allX ⊆ U using the oracle and then time∑nk=2 nk

2klogMnO(1)to computewf(X)for allX⊆ U. Hence the overall running time is 3nlogMnO(1).

Is it possible to computewf(X)for allX⊆ U faster, say in time proportional to 2n? Or at least, canwf(U)be computed faster, which is the value of interest in case of rank-width of graphs, carving-width of graphs, etc.

Here we can observe some typical indications that fast subset convolution should be considered. There is a 3nfactor in the running time of the algorithm when im-plementing it directly. One may hope to replace it by 2nvia fast subset convolution.

The algorithm deals with subsets of sets and it computeswf(X)for all subsets ofU.

Unfortunately when inspecting (7.12), we observe that the crucial part of the computation, the one that should be done by fast subset convolution, is

/0⊆Y⊆Xmin max(f(Y),f(X\Y),wf(Y),wf(X\Y)).

The following theorem shows how to avoid this obstacle.

Theorem 7.17.There is an2nlog2MnO(1) algorithm to compute the f -width of a finite setU.

Proof. We construct auxiliary functions in order to apply the fast subset convolu-tion. We start by computing and keeping in a table all values f(X),X ⊆ U. This takes time 2nlogMnO(1).

We first design an algorithm that decides for any fixed valuekwhetherwf(X)≤k for allX⊆ U, assuming thatf(X)for allX⊆ Uis given in a table. First we transform this into a binary table where the entry forXis 1 if and only if f(X)≤k. We define functionsgifor alli∈ {1,2, . . . ,n}and for allX⊆ U as follows:

gi(X) =





1, if 1≤ |X| ≤i,f(X)≤k,wf(X)≤k,X6=U, 1, i=n,X=U,wf(X)≤k,

0, otherwise.

(7.13)

Hence by Lemma7.16, wf(X)≤kif and only if

((g|X|−1∗g|X|−1)(X)6=0, if|X| ≥2,

f(X)≤k, if|X|=1. (7.14)

By (7.14), the algorithm recursively computesgi+1fromgi fori∈ {1,2, . . . ,n}as follows. Constructingg1is easy. By Theorem7.8,gi∗gican be computed by fast subset convolution in timeO(2nlogM).

Finally, to computewf(X)for allX⊆ U we need to run the above algorithm for all possible values ofk, i.e.M times. Should we only need to computewf(U)then binary search will do and thus we have to run the above algorithm logMtimes. ut

This has the following consequences.

Corollary 7.18.Let G be a graph with n vertices and m edges. The rank-width and the carving-width of G can be computed in timeO(2n). The branch-width of G can be computed in timeO(2m).

Notes

The history of fast transforms can be traced back to the work of Yates [222]. We refer to Sect. 4.6 of Knuths’s book [135] for more information on Yates’s algorithm and

7.4 f-width and Rank-width 139 fast Fourier transform. The influential paper of Rota advanced the general theory of M¨obius inversions on posets [192].

The algorithm for fast subset convolution is due to Bj¨orklund, Husfeldt, Kaski, and Koivisto [26]. The proofs in [26] are given in a more general setting for rings and semirings. FFT is discussed in many textbooks on algorithms, see, e.g. [52].

The proof of Theorem7.8by making use of FFT was brought to our attention by K. Venkata and Saket Saurabh. Exact algorithms for the DOMATICNUMBER prob-lem were given by several authors [89,180]. TheO(2n)algorithm for DOMATIC

NUMBERis due to Bj¨orklund, Husfeldt, and Koivisto [30]. The algorithm evaluating the Tutte polynomial is due to Bj¨orklund, Husfeldt, Kaski, and Koivisto [27].

The results of Sect.7.4are based on the work of Oum [167]. Branch-width was defined by Robertson and Seymour in their fundamental work on Graph Minors [184]. The rank-width was defined by Oum and Seymour in [168]. Surveys [94, 113] provide more information on these parameters. The existence of anO(2n) algorithm computing the branch-width of ann-vertex graph is an open problem. The best known vertex-exponential algorithm for this problem runs in timeO((2√

3)n) [93].

Lokshtanov and Nederlof develop a general framework of transforming dynamic programming algorithms to algorithms using only polynomial space [154]. In par-ticular, their approach provides polynomial space and pseudo-polynomial time al-gorithms for SUBSETSUMand KNAPSACK.

Subset convolution can also be used in dynamic programming algorithms for graphs of bounded treewidth. For example, van Rooij, Bodlaender, and Rossmanith [189] used subset convolution to show that the number of perfect matchings can be counted in timeO(2tn)for graphs of treewidth at mostt.

Chapter 8

Local Search and SAT

In Chap.2, we discuss a branching algorithm for thek-SATISFIABILITYproblem.

In this chapter we consider more techniques for solvingk-SAT. Both techniques are based on performing local search in balls in the Hamming space around some assignments. The first algorithm randomly chooses an assignment and performs a random walk of short length (in Hamming distance) to search for the solution. The second algorithm is deterministic and uses a similar idea; but instead of using a random walk, it finds a covering of the Hamming space by balls of specified radius and performs a search inside these balls.

The algorithms in this chapter are heavily based on the notions of Hamming space and Hamming distance.

Hamming space (of dimension n) is the set of all 2n binary strings of length n. TheHamming distance between two binary strings is the number of positions in which the corresponding symbols of the strings are different. For example, the distance between the strings(0,1,1,1,0)and(1,1,1,0,0)is 2. Clearly the distance between two strings of lengthnis always at mostn.

It is convenient to view satisfying assignments of CNF formulae as elements of the Hamming space. For a given CNF formula withnvariables, we fix (arbitrarily) an ordering of the variables. Then every satisfying assignment corresponds to a binary string of lengthn. The value of theith variable in the satisfying assignment is true if and only if the element in theith position of the string is 1. Furthermore, we also will view the set of all truth assignments as the Hamming spaceHn={0,1}n. TheHamming distancebetween two truth assignmentsaandbis the number of bits on which the two assignments differ. In other words, this is the number of bits one has to flip to obtainbfroma. For a truth assignmentaand an integerd, we denote byH(a,d)theball of radius d centered in a, which is the set of all truth assignments at Hamming distance at mostdfrom assignmenta. The number of assignments at distance exactlyifrom assignmentais ni

and the volume of the ball, which is the cardinality ofH(a,d), is

|H(a,d)|=

d i=0

n i

.

F.V. Fomin, D. Kratsch,Exact Exponential Algorithms, Texts in Theoretical 141 Computer Science. An EATCS Series, DOI 10.1007/978-3-642-16533-7 8,

c Springer-Verlag Berlin Heidelberg 2010