Discrete Optimization 8 (2011) 139–145
Contents lists available at ScienceDirect
Discrete Optimization journal homepage: www.elsevier.com/locate/disopt
The parameterized complexity of k-flip local search for SAT and MAX SAT✩ Stefan Szeider Vienna University of Technology, Institute of Information Systems, Favoritenstraße 9-11, A-1040 Vienna, Austria
article
info
Article history: Received 29 November 2009 Received in revised form 3 July 2010 Accepted 13 July 2010 Available online 19 August 2010 Keywords: Parameterized complexity Local search Maximum satisfiability
abstract Sat and Max Sat are among the most prominent problems for which local search algorithms have been successfully applied. A fundamental task for such an algorithm is to increase the number of clauses satisfied by a given truth assignment by flipping the truth values of at most k variables (k-flip local search). For a total number of n variables the size of the search space is of order nk and grows quickly in k; hence most practical algorithms use 1-flip local search only. In this paper we investigate the worst-case complexity of k-flip local search, considering k as a parameter: is it possible to search significantly faster than the trivial nk bound? In addition to the unbounded case we consider instances with a bounded number of literals per clause and instances where each variable occurs in a bounded number of clauses. We also consider the related problem that asks whether we can satisfy all clauses by flipping the truth values of at most k variables. © 2010 Elsevier B.V. All rights reserved.
1. Introduction Local search (LS) is one of the most fundamental algorithmic concepts and has been successfully applied to a wide range of hard combinatorial optimization problems, most prominently to Maximum Satisfiability (Max Sat) and the Traveling Salesperson Problem (TSP). The basic idea is to move – as long as possible – from a candidate solution to a ‘‘better’’ neighboring candidate solution. For Max Sat the candidate solutions are truth assignments; two truth assignments are k-flip neighbors if they differ in the values of at most k variables; a truth assignment is better than the other if it satisfies more clauses. Numerous sophisticated variants of the basic LS algorithm for Max Sat have been suggested in the literature; for example LS algorithms that, if stuck at a local maximum, heuristically move to a non-improving solution. An in-depth coverage LS algorithms can be found in Hoos and Stützle’s book [1]. The number of k-flip neighbors of a truth assignment on n variables is of order nk , a size that grows rapidly in k. It is therefore not surprising that most practical algorithms consider 1-flip neighborhoods only; already 2- or 3-flip neighborhoods are too large for a brute-force search, as typical real-world instances have tens or hundreds of thousands of variables. In this paper we study the question of whether the k-flip neighborhood can be exhaustively searched in a more efficient way. In particular, we investigate whether the search can be carried out within a worst-case time bound that is polynomial for fixed k where the order of the polynomial is independent of k (in contrast to the nk time bound as required by brute forth search). Problems that admit an algorithmic solution of this type are called fixed-parameter tractable (FPT). Whether or not a problem is fixed-parameter tractable is studied in the theoretical framework of Parameterized Complexity [2–5]; we provide some basic definitions and concepts in Section 2.2. We study the parameterized complexity of LS for Max Sat
✩ A shortened and preliminary version appeared in the proceedings of SAT 2009, Twelfth International Conference on Theory and Applications of Satisfiability Testing. E-mail address:
[email protected].
1572-5286/$ – see front matter © 2010 Elsevier B.V. All rights reserved. doi:10.1016/j.disopt.2010.07.003
140
S. Szeider / Discrete Optimization 8 (2011) 139–145
in general and for special cases where clause-size or the number of occurrences of variables are bounded. Furthermore we study the parameterized complexity of a related problem where we ask whether a k-flip neighbor of the current truth assignment satisfies all clauses (i.e., if there is a full solution of distance at most k from the current one). More specifically, we consider the following two problems and special cases thereof with bounds on clause-size and the occurrence of variables. k-Flip Max Sat Instance: A CNF formula F and a truth assignment τ : var(F ) → {0, 1}. Question: Is there a k-flip neighbor τ ′ of τ that satisfies more clauses of F than τ ? k-Flip Sat Instance: A CNF formula F and a truth assignment τ : var(F ) → {0, 1}. Question: Is there a k-flip neighbor τ ′ of τ that satisfies all clauses of F ? The following table summarizes our results where ‘‘FPT’’ indicates fixed-parameter tractability, ‘‘W[1]-hard’’ and ‘‘W[2]hard’’ indicate that the considered problem is most likely not fixed-parameter tractable (see Section 2.2), and ‘‘(n)’’ indicates that the respective result is established by Theorem n. Size of clauses
Occurrence of variables
k-Flip Max Sat
k-Flip Sat
Unbounded
Unbounded
W[1]-hard (1, 3)
W[2]-hard (2)
Unbounded
Bounded
W[1]-hard (3)
W[1]-hard (3)
Bounded
Unbounded
W[1]-hard (1)
FPT [6] + (4)
Bounded
Bounded
FPT (5)
FPT (5)
Our focus lies on the question of whether the considered problems are fixed-parameter tractable or not; we do not aim at practical or fine-tuned algorithms or at completeness results. Related work k-flip LS plays an important role in various theoretical investigations, for example in Dantsin et al.’s work on worstcase upper bounds for the running time of 3-SAT algorithms [6]. The expected running time for searching 2- and 3-flip neighborhoods on random instances has been investigated by Yagiura and Ibaraki [7]. The study of the parameterized complexity of LS was initiated by Fellows [8]. To date a collection of positive and negative results on the parameterized complexity of LS for various combinatorial optimization problems are known, including results on problems involving rcenters, vertex covers, odd cycle transversals, max-cuts, min-bisections [9], feedback edge sets [10], Boolean constraints [11], traveling salesperson tours [12], stable matchings [13,14], and Bayesian networks [15]. 2. Preliminaries 2.1. CNF formulas and truth assignments We consider propositional formulas in conjunctive normal form, CNF formulas, given as sets of clauses. A clause is a set of literals, a literal is a propositional variable x (a positive literal) or a negated variable ¬x (a negative literal). A CNF formula F is a q-CNF formula if each clause of F contains at most q literals. We say that a variable x occurs in a clause C if x ∈ C or ¬x ∈ C . The variable occurrence of a CNF formula F is bounded by an integer p if each variable x of F occurs in at most p clauses of F . We write var(F ) for the set of variables that occur in F . A truth assignment is a mapping τ : X → {0, 1} defined on a set X of variables. A truth assignment τ satisfies a clause C if τ (x) = 1 for some x ∈ C or τ (x) = 0 for some ¬x ∈ C ; τ satisfies a CNF formula F if it satisfies all clauses of F . Let τ : var(F ) → {0, 1} and τ ′ : var(F ) → {0, 1} be truth assignments. We define dist(τ , τ ′ ) = |{x ∈ var(F ) : τ (x) ̸= τ (x′ )}| and sat(τ , F ) = |{C ∈ F : τ satisfies C }|. If dist(τ , τ ′ ) ≤ k then we say that τ and τ ′ are k-flip neighbors. 2.2. Parameterized complexity An instance of a parameterized problem is a pair (I , k) where I is the main part and k is the parameter; the latter is usually a non-negative integer. A parameterized problem is fixed-parameter tractable if there exist a computable function f and a constant c such that instances (I , k) can be solved in time O(f (k)‖I ‖c ) where ‖I ‖ denotes the size of I. FPT is the class of all fixed-parameter tractable decision problems. A kernelization of a parameterized problem L is a polynomial-time reduction from L to itself that maps an instance (I , k) to a decision-equivalent instance (I ′ , k′ ) such that k′ ≤ k and ‖I ′ ‖ = f (k) for a function f . I ′ is called a problem kernel of size f . It is known that a parameterized problem is fixed-parameter tractable if and only if it has a kernelization [3]. A parameterized reduction is a many-one reduction where the parameter for one problem maps into the parameter for the other. More specifically, problem L reduces to problem L′ if there is a mapping R from instances of L to instances of L′ such that (i) (I , k) is a yes-instance of L if and only if (I ′ , k′ ) = R(I , k) is a yes-instance of L′ , (ii) k′ = g (k) for a computable function g, and (iii) R can be computed in time O(f (k)‖I ‖c ) where f is a computable function and c is a constant.
S. Szeider / Discrete Optimization 8 (2011) 139–145
141
The Weft Hierarchy consists of parameterized complexity classes W[1] ⊆ W[2] ⊆ · · · which are defined as the closure of certain parameterized problems under parameterized reductions (see [2–4] for definitions). There is strong theoretical evidence that parameterized problems that are hard for classes W[i] are not fixed-parameter tractable. For example FPT = W[1] implies that the Exponential Time Hypothesis (ETH) fails; that is, FPT = W[1] implies the existence of a 2o(n) algorithm for n-variable 3-Sat [3,16]. We establish our hardness results by parameterized reductions from the following parameterized decision problems (k denotes the parameter). Independent Set Instance: A graph G = (V , E ), a non-negative integer k. Question: Is there a set I ⊆ V of size k such that for no edge uv ∈ E we have both u ∈ I and v ∈ I? (I is an independent set of G.) Remark: This problem is W[1]-complete; see [2]. Hitting Set Instance: Finite sets S1 , . . . , Sm , am non-negative integer k. Question: Is there a set H ⊆ i=1 Si of size at most k such that H ∩ Si ̸= ∅ for all 1 ≤ i ≤ m? (H is a hitting set of S1 , . . . , Sm .) Remark: This problem is W[2]-complete; see [2]. Partitioned Clique Instance: A k-partite graph G = (V , E ) with partition V1 , . . . , Vk such that |Vi | = |Vj | for 1 ≤ i < j ≤ k. Question: Are there k vertices v1 , . . . , vk such that vi ∈ Vi for 1 ≤ i ≤ k and vi vj ∈ E for 1 ≤ i < j ≤ k? (The graph K = ({v1 , . . . , vk }, {vi vj : 1 ≤ i < j ≤ k}) is a clique of G.) Remark: This problem, also known as Multicolored Clique, is W[1]-complete; see [17]. 3. W-hardness Theorem 1. k-Flip Max Sat is W[1]-hard and remains W[1]-hard for 2-CNF formulas. Proof. We devise a parameterized reduction from Independent Set; let (G, k) with G = (V , E ) be an instance of this problem. We denote the degree of a vertex v ∈ V in G by d(v) and we let ∆ = maxv∈V d(v); furthermore we put m = |E |. The variables of F are the vertices of G plus new variables a1 , . . . , a∆−1 , b1 , . . . , bk−1 , c1 , . . . , cm , and z. We define the clauses of F in five groups. 1. 2. 3. 4. 5.
For each edge uv ∈ E we introduce the clause {u, v}. For each v ∈ V and 1 ≤ i ≤ d(v) − 1 we introduce the clause {¬v, ai }. For each 1 ≤ i ≤ k − 1 we introduce the clause {¬z , bi }. For each v ∈ V we introduce the clause {¬v, z }. For each 1 ≤ i ≤ ∆ − 1, 1 ≤ i′ ≤ k − 1, and 1 ≤ j ≤ m we introduce the clauses {¬ai , cj }, {¬ai , ¬cj }, {¬bi′ , cj }, and {¬bi′ , ¬cj }.
5
We denote the set of clauses introduced in step i by Fi , 1 ≤ i ≤ 5. Setting F = i=1 Fi completes the construction of F . Clearly F can be constructed in polynomial time in terms of the size of G. Let τ : var(F ) → {0} be the all-0-assignment of F . Observe that τ satisfies all clauses of F except for the clauses in F1 ; thus sat(τ , F ) = |F | − |E |. Claim. G has an independent set of size k if and only if F has a truth assignment τ ′ such that dist(τ , τ ′ ) ≤ k + 1 and sat(τ ′ , F ) > sat(τ , F ). Let I be an independent set of G with |I | = k. We define a truth assignment τ ′ : var(F ) → {0, 1}. For v ∈ V we put τ (v) = 1 if and only if v ∈ I; we put τ ′ (z ) = 1 and let τ ′ (x) = 0 for all other variables x. By construction we have dist(τ , τ ′ ) = |I | + 1 = k + 1. We observe that τ ′ satisfies all clauses in F4 ∪ F5 and no clause in F3 . For each variable v ∈ I, τ ′ satisfies exactly d(v) clauses of F1 that contain v and does not satisfy any of the d(v) − 1 clauses in F2 that contain ¬v . On the other hand, for each variable v ∈ V \ I, τ ′ satisfies all the d(v) − 1 clauses in F2 that contain ¬v . Therefore we have sat(τ ′ , F1 ∪ F2 ) = sat(τ , F1 ∪ F2 ) + k. By definition of τ ′ we have sat(τ ′ , F3 ) = sat(τ , F3 ) − (k − 1), and sat(τ ′ , F4 ) = sat(τ , F4 ) = |V |. Thus, in total we have sat(τ ′ , F ) = sat(τ , F ) + 1 as claimed. Conversely, let τ ′ be a truth assignment of F with dist(τ , τ ′ ) ≤ k + 1 and sat(τ ′ , F ) > sat(τ , F ). Clearly τ ′ (ai ) = 0 for all 1 ≤ i ≤ ∆ − 1 and τ ′ (bi ) = 0 for all 1 ≤ i ≤ k − 1 since otherwise at least m clauses of F5 would not be satisfied (by symmetry of the clauses in F5 , changing the value of variables ci does not help), a deficit that cannot be compensated elsewhere. For v ∈ V let τv′ denote the truth assignment obtained from τ ′ by flipping the value of v ; that is, τv′ (v) = 1 − τ ′ (v) and τv′ (x) = τ ′ (x) for x ̸= v . ′
142
S. Szeider / Discrete Optimization 8 (2011) 139–145
We assume, w.l.o.g., that τ ′ has a certain minimality property: for each v ∈ V with τ ′ (v) = 1 we have sat(τv′ , F ) ≤ sat(τ ′ , F ). This assumption is justified as we can start with an arbitrary τ ′ and try to flip its variables one after the other while still satisfying at least as many clauses, until we are left with a truth assignment that has the minimality property. First we show that τ ′ (z ) = 1. Assume to the contrary that τ ′ (z ) = 0. There must be a variable v ∈ V with τ ′ (v) = 1, since there is no other way of increasing the number of satisfied clauses. The clauses of F that are satisfied by τv′ but not by τ ′ are exactly the d(v) − 1 clauses in F2 that contain v and the clause {¬v, z } ∈ F4 . On the other hand, at most d(v) clauses (clauses in F1 that contain v ) are satisfied by τ ′ but not by τv′ . Consequently sat(τv′ , F ) ≥ sat(τ ′ , F ), a contradiction to the minimality property of τ ′ . Hence indeed τ ′ (z ) = 1. It follows that none of the k − 1 clauses in F3 is satisfied by τ ′ . Hence to compensate this deficit we must have sat(τ ′ , F1 ∪ F2 ) ≥ sat(τ , F1 ∪ F2 ) + k. Each variable v ∈ V occurs in d(v) clauses of F1 positively and in d(v) − 1 clauses of F2 negatively. Hence by flipping the truth value of v from 0 to 1 we can increase the number of satisfied clauses in F1 ∪ F2 at most by one, and this is exactly the case if no other variable u with {u, v} ∈ F1 is already set to 1. Thus, the only possibility to have sat(τ ′ , F1 ∪ F2 ) ≥ sat(τ , F1 ∪ F2 ) + k is that there are exactly k variables v ∈ V with τ ′ (v) = 1 such that for any two variables u, v ∈ V with τ ′ (u) = τ ′ (v) = 1 we have {u, v} ̸∈ F1 . This, however, implies that I = {v ∈ V : τ ′ (v) = 1} is an independent set of G of size k. Hence the claim is shown true. We conclude that our construction provides indeed a parameterized reduction from Independent Set to k-Flip Max Sat by mapping the instance (G, k) of the former problem to the instance (F , τ , k + 1) of the latter. Theorem 2. k-Flip Sat is W[2]-hard. Proof. The result follows easily by a reduction from Hitting Set. Let (H , k) be an instance of Hitting Set with H = {S1 , . . . , Sm } and X = m i=1 Si . We consider H as a positive CNF formula and let τ : X → {0} be the all-0-assignment on X . It is evident that H has a satisfying truth assignment τ ′ : X → {0, 1} such that dist(τ , τ ′ ) ≤ k if and only if H has a hitting set of size at most k. Remark 1. One can easily show that k-Flip Sat is W[2]-complete by reduction to the problem Bounded CNF Satisfiability (the W[2]-complete problem that asks whether a CNF formula has a satisfying assignment that sets at most k variables to 1; see [18]). However, we do not know if k-Flip Max Sat is in W[1], thus we do not know if k-Flip Sat is of higher parameterized complexity than k-Flip Max Sat. Theorem 3. The problems k-Flip Sat and k-Flip Max Sat remain W[1]-hard if each variable occurs in at most 3 clauses. Proof. We devise a parameterized reduction from Partitioned Clique; let G = (V , E ) with partition V1 , . . . , Vk , |V1 | = · · · = |Vk | = n, be an instance of this problem. We construct a CNF formula F where each variable occurs in at most k + 1 clauses; we will show later how the number of occurrences can be further reduced to 3. The variables of F are the vertices and edges of G plus a new variable z; we define the clauses of F as follows: 1. We introduce the clause {z }. 2. For each 1 ≤ i ≤ k we introduce the clause Ci = Vi ∪ {¬z }. 3. For each v ∈ Vi , 1 ≤ i ≤ k, and each j ∈ {1, . . . , k} \ {i}, we add the clause Ci,j,v = {¬v} ∪ {v u : u ∈ Vj and v u ∈ E }. This completes the construction of F . Let τ : var(F ) → {0} be the all-0-assignment of F . Observe that τ satisfies all clauses of F except clause {z }. Increasing the number of satisfied clauses is equivalent to satisfying all clauses of F , thus solutions to Sat and Max Sat coincide for (F , τ ). Let k′ = k +
k 2
+ 1.
Claim 1. G contains a clique on k vertices if and only if F is satisfied by a truth assignment τ ′ : var(F ) → {0, 1} with dist(τ , τ ′ ) ≤ k′ . Let K = (V ′ , E ′ ) with V ′ = {v1 , . . . , vk } and vi ∈ Vi , 1 ≤ i ≤ k, be a clique of G. Let τ ′ be the truth assignment that sets all variables in V ′ ∪ E ′ ∪ {z } to 1 and all other variables to 0. It is easy to verify that dist(τ , τ ′ ) = k′ and τ ′ satisfies F . Conversely, let τ ′ : var(F ) → {0, 1} be a truth assignment that satisfies F with dist(τ , τ ′ ) ≤ k′ . Because of the clause {z } ∈ F clearly τ ′ (z ) = 1. Because of the clauses Ci it follows that each set Vi , 1 ≤ i ≤ k, must contain some variable vi with τ ′ (vi ) = 1. ′ Hence there is a set V ′ = {v1 , . . . , vk }, with vi ∈ Vi and τ ′ (vi ) = 1 for 1 ≤ i ≤ k. Let E ′ = {e ∈ E : τ ′ (e) = 1}.Since τ sets at most k′ variables to 1, and among these variables are v1 , . . . , vk and z, we conclude that |E ′ | ≤ k′ − k − 1 =
k 2
. Because
of the clauses Ci,j,vi it follows that for each vi and each j ∈ {1, . . . , k} \ {i} there is an edge vi uj ∈ E for some uj ∈ Vj . Since ′
|E ′ | ≤
k 2
it follows that uj = vj . Hence E ′ = {vi vj : 1 ≤ i < j ≤ k} and |E ′ | =
k 2
; thus K = (V ′ , E ′ ) is indeed a clique
of G with k vertices. This completes the proof of the claim. We conclude that the above construction specifies a parameterized reduction from Partitioned Clique to k-Flip (Max) Sat by mapping an instance (G, k) of the former problem to the instance (F , τ , k′ ) of the latter.
S. Szeider / Discrete Optimization 8 (2011) 139–145
143
Next we show how the reduction can be modified so that each variable occurs in at most three clauses. Consider the CNF formula F constructed above in the first part of the proof. We observe that each variable occurs in at most k + 1 clauses. More specifically, each v ∈ Vi , 1 ≤ i ≤ k, occurs in exactly k clauses: in clause Ci and in k − 1 clauses Ci,j,v (j ∈ {1, . . . , k} \ {i}). Each e ∈ E occurs in exactly two clauses: if e = uv and u ∈ Vi , v ∈ Vj , then e occurs in clause Ci,j,u and in clause Cj,i,v . Variable z occurs in k + 1 clauses: in all clauses Ci , 1 ≤ i ≤ k, and in clause {z }. Let α(x) denote the number of clauses of F in which variable x occurs. From F we construct a new CNF formula by replacing ′ each variable x of F with α(x) > 3 by new variables x1 , . . . , xα(x) . In particular, if x occurs in clauses C1′ , . . . , Cα( x) we replace ′ ′ ′ ′ ′ Ci with clause (Ci \ {x}) ∪ {xi } if x ∈ Ci and with clause (Ci \ {¬x}) ∪ {¬xi } if ¬x ∈ Ci , 1 ≤ i ≤ α(x). Furthermore we add binary clauses {¬x1 , x2 }, {¬x2 , x3 }, . . . , {¬xα(x)−1 , xα(x) }, {¬xα(x) , x1 }. Let F ∗ denote the CNF formula obtained from F by performing this replacement for all variables of F that occur in more than three clauses (that is, for all variables in V ∪ {z }). ∗ Accordingly, each variable of F ∗ occurs in at most three clauses of F . Let σ be the all-0-assignment of F ∗ and let k∗ = k2 +
k 2
+ k + 1.
Claim 2. G contains a clique on k vertices if and only if F ∗ is satisfied by a truth assignment σ ′ : var(F ) → {0, 1} with dist(σ , σ ′ ) ≤ k∗ . Note that each satisfying assignment of F ∗ gives all variables x1 , . . . , xα(x) the same truth value (since otherwise one of the binary clauses forming the implication cycle would not be satisfied). Hence satisfying assignments of F and of F ∗ are in a one-to-one correspondence. By the previous claim, each satisfying truth assignment τ ′ of F with dist(τ , τ ′ ) ≤ k′ sets exactly k′ variables to 1: k variables from V ,
k 2
variables from E, and variable z. Each variable of V corresponds to k variables of F ∗ ,
each variable of E corresponds to just one variable of F ∗ , and z corresponds to k + 1 variables of F ∗ . Hence τ ′ corresponds to a satisfying assignment σ ′ of F ∗ which sets exactly k∗ variables to 1. Thus the claim follows. This completes the proof of the theorem. Remark 2. The CNF formulas F and F ∗ as constructed in the proof of Theorem 3 are anti-Horn (each clause contains at most one negative literal). We can give a dual reduction that produces Horn formulas (each clause contains at most one positive literal). Hence Theorem 3 remains valid for Horn and for anti-Horn formulas. Remark 3. It seems not very interesting to consider k-Flip Sat or k-Flip Max Sat for instances where each variable occurs in at most two clauses, since already SAT and Max Sat can be solved in polynomial time for such instances [19,20]. 4. Fixed-parameter tractability The following was already observed by Dantsin et al. [6]; for the sake of completeness we give a proof. Theorem 4 ([6]). Let q be an arbitrary but fixed positive integer. k-Flip Sat is fixed-parameter tractable for q-CNF formulas. Proof. Let F be a q-CNF formula, τ : var(F ) → {0, 1} a truth assignment, and k ≥ 0 the parameter. We devise a bounded search tree algorithm (see [2]). Each node of the search tree except the root will be labeled with a variable. We associate with each node v the truth assignment τv obtained from τ by flipping the values for all the variables that appear on the path from the root to v . Starting from the root we extend the search tree in an obvious way: as long as no assignment associated with a node of the tree satisfies F and there exists a leaf v of depth < k we extend the tree. We pick a clause C ∈ F that is not satisfied by τv . For each literal ℓ ∈ C we add a child vℓ to v and label it with the variable underlying ℓ. Clearly each node can be constructed in polynomial time, and if the instance has a solution then we find it with the search tree. Since each node of the search tree has at most q children and the depth of the tree is at most k, we have at most O(qk ) nodes. Hence k-Flip Sat is fixed-parameter tractable for q-CNF formulas. Theorem 5. Let p, q be arbitrary but fixed positive integers. k-Flip Max Sat is fixed-parameter tractable for q-CNF formulas where each variable occurs in at most p clauses. Proof. Let p, q be arbitrary but fixed positive integers and consider an instance (F , τ , k) of k-Flip Max Sat where F is a q-CNF formula where each variable occurs in at most p clauses and |var(F )| = n. We consider the graph G whose vertices are the variables of F and where two variables are connected by an edge if and only if they occur together (positively or negatively) in the same clause. For a set D ⊆ var(F ) let τD : var(F ) → {0, 1} denote the truth assignment obtained from τ by changing the values of the variables in D. We say that a truth assignment τ is connected if τ = τD for a set D such that the subgraph G[D] = (D, {uv ∈ E : u, v ∈ D}) of G induced by D is a connected graph. We show that when searching for a solution to k-Flip Max Sat we can restrict our scope to connected truth assignments. Assume there is a k-flip neighbor τ ′ of τ such that sat(τ ′ , F ) > sat(τ , F ). Let D ⊆ var(F ) such that τ ′ = τD . Let G1 , . . . , Gt be the ∑t connected components of G[D]. Evidently, every Gi is induced by a subset Di of D. We have sat(τD , F ) − sat(τ , F ) = i=1 (sat(τDi , F ) − sat(τ , F )). Since by assumption sat(τD , F ) − sat(τ , F ) > 0, there must be at least one i ∈ {1, . . . , t } such that sat(τDi , F ) − sat(τ , F ) > 0. Thus, we conclude that if (F , τ , k) has a solution, it has a
144
S. Szeider / Discrete Optimization 8 (2011) 139–145
connected solution τD . We can find such a set D by (i) guessing a root v ∈ var(F ) of a spanning tree T of G[D] and (ii) guessing for each node of T the set of its children in T . Since the maximum vertex degree of G is bounded by pq, each node has at most 2pq possible sets of children. Hence there are less than n · (2pq )k possible sets D to check. The result follows. Remark 4. As outlined in [21] it is also possible to take a logic approach, and to establish Theorem 5 by means of the algorithmic meta-theorem of Frick and Grohe [22]. The logic approach provides less practical algorithms but gives a more general result: the fixed-parameter tractability of k-Flip Max Sat for any class of CNF formulas whose corresponding class of incidence graphs (the bipartite graphs on clauses and variables where a variable is adjacent to all clauses within it occurs) is of bounded local treewidth. This includes among others the class of planar graphs (or more generally, graph classes of bounded genus) and classes of bounded degree as important special cases. 5. Conclusion We have studied the parameterized complexity of k-flip local search for Sat and Max Sat. Our results show that k-flip local search is not fixed-parameter tractable in general for these problems (subject to the commonly believed assumption FPT ̸= W[1]). However, the problems are fixed-parameter tractable for important special cases where the size of clauses or the number of occurrences of variables are bounded by fixed constants p and q, respectively, as shown in Theorems 4 and 5. In fact, the proofs of these results show that the considered problems are even fixed-parameter tractable if the bounds p and q are part of the parameter and not constants. More specifically, k-Flip Sat is fixed-parameter tractable for parameter k + p and k-Flip Max Sat is fixed-parameter tractable for parameter k + p + q. As our primary aim was to classify the parameterized complexities of problems, we have used the basic method of bounded search trees to establish our fixed-parameter tractability results. There remains ample space for improvements required for practically feasible parameterized algorithms. One line of further research could be the development of kernelizations for the fixed-parameter tractable problems. However, it is unlikely that k-Flip Max Sat admits a problem kernel of polynomial size (for bounded p and q) since the kernel-lower-bound technique of Bodlaender et al. [23] readily applies to this problem. For k-Flip Sat on q-CNF formulas this technique apparently does not apply, and so it remains open whether this problem admits a kernel of polynomial size. Acknowledgements The author wishes to thank the anonymous referees for suggestions that helped to improve the presentation of the paper. Financial support by the European Research Council, grant reference 239962, is acknowledged. References [1] H.H. Hoos, T. Stützle, Stochastic Local Search: Foundations and Applications, Elsevier, Morgan Kaufmann, 2004. [2] R.G. Downey, M.R. Fellows, Parameterized Complexity, in: Monographs in Computer Science, Springer Verlag, New York, 1999. [3] J. Flum, M. Grohe, Parameterized Complexity Theory, in: Texts in Theoretical Computer Science. An EATCS Series, vol. XIV, Springer Verlag, Berlin, 2006. [4] R. Niedermeier, Invitation to Fixed-Parameter Algorithms, in: Oxford Lecture Series in Mathematics and its Applications, Oxford University Press, Oxford, 2006. [5] M. Samer, S. Szeider, Fixed-parameter tractability, in: A. Biere, M. Heule, H. van Maaren, T. Walsh (Eds.), Handbook of Satisfiability, IOS Press, 2009, pp. 425–454. (Chapter 13). [6] E. Dantsin, A. Goerdt, E.A. Hirsch, R. Kannan, J.M. Kleinberg, C.H. Papadimitriou, P. Raghavan, U. Schöning, A deterministic (2 − 2/(k + 1))n algorithm for k-SAT based on local search, Theoret. Comput. Sci. 289 (1) (2002) 69–83. [7] M. Yagiura, T. Ibaraki, Analyses on the 2 and 3-flip neighborhoods for the MAX SAT, J. Comb. Optim. 3 (1) (1999) 95–114. [8] M.R. Fellows, Blow-ups, win/win’s, and crown rules: Some new directions in FPT, in: H.L. Bodlaender (Ed.), Graph-Theoretic Concepts in Computer Science (WG 2003), in: Lecture Notes in Computer Science, vol. 2880, Springer Verlag, 2003, pp. 1–12. [9] M.R. Fellows, F.A. Rosamond, F.V. Fomin, D. Lokshtanov, S. Saurabh, Y. Villanger, Local search: is brute-force avoidable? in: C. Boutilier (Ed.), IJCAI 2009, Proceedings of the 21st International Joint Conference on Artificial Intelligence, Pasadena, California, USA, July 11–17, 2009, 2009, pp. 486–491. [10] S. Khuller, R. Bhatia, R. Pless, On local search and placement of meters in networks, SIAM J. Comput. 32 (2) (2003) 470–487. [11] A.A. Krokhin, D. Marx, On the hardness of losing weight, in: Automata, Languages and Programming, 35th International Colloquium, ICALP 2008, Reykjavik, Iceland, July 7–11, 2008, Proceedings, Part I: Track A: Algorithms, Automata, Complexity, and Games, in: Lecture Notes in Computer Science, vol. 5125, Springer Verlag, 2008, pp. 662–673. [12] D. Marx, Searching the k-change neighborhood for TSP is W[1]-hard, Oper. Res. Lett. 36 (1) (2008) 31–36. [13] D. Marx, I. Schlotter, Parameterized complexity and local search approaches for the stable marriage problem with ties, Algorithmica 58 (1) (2009) 170–187. [14] D. Marx, I. Schlotter, Stable assignment with couples: parameterized complexity and local search, in: Proceedings of IWPEC 2009, 4th International Workshop on Parameterized and Exact Computation, 10–11 September 2009, IT University of Copenhagen, Denmark, in: Lecture Notes in Computer Science, vol. 5917, 2009, pp. 300–311. [15] S. Ordyniak, S. Szeider, Algorithms and complexity results for exact bayesian structure learning, in: P. Grünwald, P. Spirtes (Eds.), Proceedings of UAI 2010, The 26th Conference on Uncertainty in Artificial Intelligence, Catalina Island, California, USA, July 8–11, 2010, AUAI Press, Corvallis, Oregon, 2010, pp. 401–408. [16] R. Impagliazzo, R. Paturi, F. Zane, Which problems have strongly exponential complexity?, J. Comput. System Sci. 63 (4) (2001) 512–530. [17] K. Pietrzak, On the parameterized complexity of the fixed alphabet shortest common supersequence and longest common subsequence problems, J. Computer System Sci. 67 (4) (2003) 757–771.
S. Szeider / Discrete Optimization 8 (2011) 139–145
145
[18] S. Dantchev, B. Martin, S. Szeider, Parameterized proof complexity, in: Proceedings of the 48th Annual Symposium on Foundations of Computer Science, FOCS 2007, October 20–23, 2007, Providence, RI, USA, IEEE Press, 2007, pp. 150–160. [19] C.A. Tovey, A simplified NP-complete satisfiability problem, Discrete Appl. Math. 8 (1) (1984) 85–89. [20] V. Raman, B. Ravikumar, S.S. Rao, A simplified NP-complete MAXSAT problem, Inform. Process. Lett. 65 (1) (1998) 1–6. [21] S. Szeider, The parameterized complexity of k-flip local search for SAT and MAX SAT, in: O. Kullmann (Ed.), Theory and Applications of Satisfiability Testing—SAT 2009, 12th International Conference, SAT 2009, Swansea, UK, June 30–July 3, 2009. Proceedings, in: Lecture Notes in Computer Science, vol. 5584, Springer Verlag, 2009, pp. 276–283. [22] M. Frick, M. Grohe, Deciding first-order properties of locally tree-decomposable structures, J. ACM 48 (6) (2001) 1184–1206. [23] H.L. Bodlaender, R.G. Downey, M.R. Fellows, D. Hermelin, On problems without polynomial kernels, J. Comput. System Sci. 75 (8) (2009) 423–434.