Local Do PDF
Local Do PDF
Stefan Szeider
Vienna University of Technology, Institute of Information Systems
Favoritenstrae 9-11, A-1040 Vienna, Austria, [email protected]
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 satised by a given truth assignment by ipping
the truth values of at most k variables (k-ip local search). For a total number of n
variables the size of the search space is of order n
k
and grows quickly in k; hence
most practical algorithms use 1-ip local search only. In this paper we investigate
the worst-case complexity of k-ip local search, considering k as a parameter: is it
possible to search signicantly faster than the trivial n
k
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 ipping
the truth values of at most k variables.
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 Satisability (MAX SAT) and the Traveling Salesperson Prob-
lem (TSP). The basic idea is to moveas long as possiblefrom a candidate solution to
a better neighboring candidate solution. For MAX SAT the candidate solutions are truth
assignments; two truth assignments are k-ip neighbors if they differ in the values of at
most k variables; a truth assignment is better than the other if it satises more clauses.
Numerous sophisticated variants of the basic LS algorithm for MAX SAT have been sug-
gested 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 utzles book [9].
The number of k-ip neighbors of a truth assignment on n variables is of order n
k
, a
size that grows rapidly in k. It is therefore not surprising that most practical algorithms
consider 1-ip neighborhoods only; already 2- or 3-ip neighborhoods are too large for a
brute-force search, as typical real-world instances have tens or hundreds of thousands of
variables.
A shortened and preliminary version appeared in the proceedings of SAT 2009, Twelfth International Con-
ference on Theory and Applications of Satisability Testing
1
In this paper we study the question of whether the k-ip neighborhood can be exhaus-
tively searched in a more efcient way. In particular, we investigate whether the search
can be carried out within a worst-case time bound that is polynomial for xed k where the
order of the polynomial is independent of k (in contrast to the n
k
time bound as required
by brute forth search). Problems that admit an algorithmic solution of this type are called
xed-parameter tractable (FPT). Whether or not a problem is xed-parameter tractable
is studied in the theoretical framework of Parameterized Complexity [4, 7, 16, 20]; we
provide some basic denitions and concepts in Section 2.2. We study the parameterized
complexity of LS for MAX SAT 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-ip neighbor of the current
truth assignment satises all clauses (i.e., if there is a full solution of distance at most k
from the current one). More specically, 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-ip neighbor
: var(F) 0, 1
be truth assignments. We dene dist(,
) = [ x var(F) : (x) ,= (x
) [ and
sat(, F) = [ C F : satises C [. If dist(,
are
k-ip 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 xed-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 xed-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
, 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.
The Weft Hierarchy consists of parameterized complexity classes W[1] W[2]
which are dened as the closure of certain parameterized problems under parameterized
reductions (see [4, 7, 16] for denitions). There is strong theoretical evidence that pa-
rameterized problems that are hard for classes W[i] are not xed-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 2
o(n)
algorithm for n-variable 3SAT [7, 10].
3
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 [4].
HITTING SET
Instance: Finite sets S
1
, . . . , S
m
, a non-negative integer k.
Question: Is there a set H
m
i=1
S
i
of size at most k such that H S
i
,=
for all 1 i m? (H is a hitting set of S
1
, . . . , S
m
.)
Remark: This problem is W[2]-complete, see [4].
PARTITIONED CLIQUE
Instance: A k-partite graph G = (V, E) with partition V
1
, . . . , V
k
such that
[V
i
[ = [V
j
[ for 1 i < j k.
Question: Are there k vertices v
1
, . . . , v
k
such that v
i
V
i
for 1 i k and
v
i
v
j
E for 1 i < j k? (The graph K = (v
1
, . . . , v
k
, v
i
v
j
: 1
i < j k ) is a clique of G.)
Remark: This problem, also known as MULTICOLORED CLIQUE, is W[1]-com-
plete, see [18].
3 W-Hardness
Theorem 1. k-FLIP MAX SAT is W[1]-hard and remains W[1]-hard for 2-CNF formu-
las.
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 = max
vV
d(v); furthermore we put m = [E[. The variables of F
are the vertices of G plus new variables a
1
, . . . , a
1
, b
1
, . . . , b
k1
, c
1
, . . . , c
m
, and z.
We dene the clauses of F in ve groups.
1. For each edge uv E we introduce the clause u, v.
2. For each v V and 1 i d(v) 1 we introduce the clause v, a
i
.
3. For each 1 i k 1 we introduce the clause z, b
i
.
4. For each v V we introduce the clause v, z.
5. For each 1 i 1, 1 i
5
i=1
F
i
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 satises all
clauses of F except for the clauses in F
1
; thus sat(, F) = [F[ [E[.
Claim: G has an independent set of size k if and only if F has a truth assignment
) k + 1 and sat(
:
var(F) 0, 1. For v V we put
(z) = 1 and
let
) = [I[ + 1 =
k + 1.
We observe that
, F
1
F
2
) = sat(, F
1
F
2
) + k.
By denition of
we have sat(
, F
3
) = sat(, F
3
) (k 1), and sat(
, F
4
) =
sat(, F
4
) = [V [. Thus, in total we have sat(
, F) = sat(, F) + 1 as claimed.
Conversely, let
) k + 1 and sat(
, F) >
sat(, F). Clearly
(a
i
) = 0 for all 1 i 1 and
(b
i
) = 0 for all 1 i k 1
since otherwise at least m clauses of F
5
would not be satised (by symmetry of the
clauses in F
5
, changing the value of variables c
i
does not help), a decit that cannot be
compensated elsewhere.
For v V let
v
denote the truth assignment obtained from
v
(v) = 1
(v) and
v
(x) =
(x) for x ,= v.
We assume, w.l.o.g., that
v
, F) sat(
and try to ip 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
v
but not by
are exactly
the d(v) 1 clauses in F
2
that contain v and the clause v, z F
4
. On the other
hand, at most d(v) clauses (clauses in F
1
that contain v) are satised by
but not by
v
.
Consequently sat(
v
, F) sat(
.
Hence indeed
(z) = 1.
It follows that none of the k 1 clauses in F
3
is satised by
. Hence to compensate
this decit we must have sat(
, F
1
F
2
) sat(, F
1
F
2
) + k. Each variable v V
occurs in d(v) clauses of F
1
positively and in d(v) 1 clauses of F
2
negatively. Hence by
ipping the truth value of v from 0 to 1 we can increase the number of satised clauses in
F
1
F
2
at most by one, and this is exactly the case if no other variable u with u, v F
1
is already set to 1. Thus, the only possibility to have sat(
, F
1
F
2
) sat(, F
1
F
2
)+k
is that there are exactly k variables v V with
(u) =
(v) = 1 we have u, v / F
1
. This, however, implies that
I = v V :
m
i=1
S
i
. 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
) 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
[2]). 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 V
1
, . . . , V
k
, [V
1
[ = = [V
k
[ = 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 dene the clauses of F as
follows:
1. We introduce the clause z.
2. For each 1 i k we introduce the clause C
i
= V
i
z.
3. For each v V
i
, 1 i k, and each j 1, . . . , k i, we add the clause
C
i,j,v
= v vu : u V
j
and vu E .
This completes the construction of F.
Let : var(F) 0 be the all-0-assignment of F. Observe that satises all
clauses of F except clause z. Increasing the number of satised 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 satised by a truth
assignment
) k
.
Let K = (V
, E
) with V
= v
1
, . . . , v
k
and v
i
V
i
, 1 i k, be a clique of G.
Let
) = k
and
satises F. Conversely,
let
) k
.
Because of the clause z F clearly
(v
i
) = 1. Hence
there is a set V
= v
1
, . . . , v
k
, with v
i
V
i
and
(v
i
) = 1 for 1 i k. Let
E
= e E :
(e) = 1 . Since
sets at most k
[ k
k 1 =
k
2
. Because of
the clauses C
i,j,vi
it follows that for each v
i
and each j 1, . . . , k i there is an
edge v
i
u
j
E
for some u
j
V
j
. Since [E
k
2
it follows that u
j
= v
j
. Hence
E
= v
i
v
j
: 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 species 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.
Next we show how the reduction can be modied so that each variable occurs in at
most three clauses.
Consider the CNF formula F constructed above in the rst part of the proof. We
observe that each variable occurs in at most k + 1 clauses. More specically, each v
V
i
, 1 i k, occurs in exactly k clauses: in clause C
i
and in k 1 clauses C
i,j,v
(j 1, . . . , k i). Each e E occurs in exactly two clauses: if e = uv and
u V
i
, v V
j
, then e occurs in clause C
i,j,u
and in clause C
j,i,v
. Variable z occurs in
k + 1 clauses: in all clauses C
i
, 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 x
1
, . . . , x
(x)
. In particular, if x occurs in clauses C
1
, . . . , C
(x)
we
replace C
i
with clause (C
i
x) x
i
if x C
i
and with clause (C
i
x)
x
i
if x C
i
, 1 i (x). Furthermore we add binary clauses x
1
, x
2
,
x
2
, x
3
, . . . x
(x)1
, x
(x)
, x
(x)
, x
1
. Let F
.
Let be the all-0-assignment of F
and let k
= k
2
+
k
2
+ k + 1.
Claim 2: G contains a clique on k vertices if and only if F
is satised by a truth
assignment
) k
.
Note that each satisfying assignment 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 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
. Hence
of F
variables to 1.
Thus the claim follows. This completes the proof of the theorem.
Remark 2 The CNF formulas F and F
of
such that sat(
=
D
. Let G
1
, . . . , G
t
be the connected components of G[D]. Evidently, every G
i
is induced by a subset D
i
of D. We have sat(
D
, F) sat(, F) =
t
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 connected solution
D
. We can nd 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 2
pq
possible sets of children. Hence there are less than n (2
pq
)
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 es-
tablish Theorem 5 by means of the algorithmic meta-theorem of Frick and Grohe [8].
The logic approach provides less practical algorithms but gives a more general result: the
xed-parameter tractability of k-FLIP MAX SAT for any class of CNF-formulas whose
8
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-ip local search for SAT and MAX
SAT. Our results show that k-ip local search is not xed-parameter tractable in general
for these problems (subject to the commonly believed assumption FPT ,= W[1]). How-
ever, the problems are xed-parameter tractable for important special cases where the
size of clauses or the number of occurrences of variables are bounded by xed constants
p and q, respectively, as shown in Theorems 4 and 5. In fact, the proofs of these re-
sults show that the considered problems are even xed-parameter tractable if the bounds
p and q are part of the parameter and not constants. More specically, k-FLIP SAT is
xed-parameter tractable for parameter k + p and k-FLIP MAX SAT is xed-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 xed-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 xed-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. [1] 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.
Acknowledgments
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. L. Bodlaender, R. G. Downey, M. R. Fellows, and D. Hermelin. On problems
without polynomial kernels. J. of Computer and System Sciences, 75(8):423434,
2009.
[2] S. Dantchev, B. Martin, and S. Szeider. Parameterized proof complexity. In Proceed-
ings of the 48th Annual Symposium on Foundations of Computer Science (FOCS
2007), October 20-23, 2007, Providence, RI, USA, pages 150160. IEEE Press,
2007.
[3] E. Dantsin, A. Goerdt, E. A. Hirsch, R. Kannan, J. M. Kleinberg, C. H. Papadim-
itriou, P. Raghavan, and U. Sch oning. A deterministic (2 2/(k + 1))
n
algorithm
for k-SAT based on local search. Theoret. Comput. Sci., 289(1):6983, 2002.
9
[4] R. G. Downey and M. R. Fellows. Parameterized Complexity. Monographs in
Computer Science. Springer Verlag, New York, 1999.
[5] M. R. Fellows. Blow-ups, win/wins, and crown rules: Some new directions in FPT.
In H. L. Bodlaender, editor, Graph-Theoretic Concepts in Computer Science (WG
2003), volume 2880 of Lecture Notes in Computer Science, pages 112. Springer
Verlag, 2003.
[6] M. R. Fellows, F. A. Rosamond, F. V. Fomin, D. Lokshtanov, S. Saurabh, and Y. Vil-
langer. Local search: Is brute-force avoidable? In C. Boutilier, editor, IJCAI 2009,
Proceedings of the 21st International Joint Conference on Articial Intelligence,
Pasadena, California, USA, July 11-17, 2009, pages 486491, 2009.
[7] J. Flum and M. Grohe. Parameterized Complexity Theory, volume XIV of Texts in
Theoretical Computer Science. An EATCS Series. Springer Verlag, Berlin, 2006.
[8] M. Frick and M. Grohe. Deciding rst-order properties of locally tree-decomposable
structures. J. ACM, 48(6):11841206, 2001.
[9] H. H. Hoos and T. St utzle. Stochastic Local Search: Foundations and Applications.
Elsevier/Morgan Kaufmann, 2004.
[10] R. Impagliazzo, R. Paturi, and F. Zane. Which problems have strongly exponential
complexity? J. of Computer and System Sciences, 63(4):512530, 2001.
[11] S. Khuller, R. Bhatia, and R. Pless. On local search and placement of meters in
networks. SIAM J. Comput., 32(2):470487, 2003.
[12] A. A. Krokhin and D. Marx. On the hardness of losing weight. In Automata, Lan-
guages and Programming, 35th International Colloquium, ICALP 2008, Reykjavik,
Iceland, July 7-11, 2008, Proceedings, Part I: Track A: Algorithms, Automata, Com-
plexity, and Games, volume 5125 of Lecture Notes in Computer Science, pages 662
673. Springer Verlag, 2008.
[13] D. Marx. Searching the k-change neighborhood for TSP is W[1]-hard. Oper. Res.
Lett., 36(1):3136, 2008.
[14] D. Marx and I. Schlotter. Parameterized complexity and local search approaches for
the stable marriage problem with ties. Algorithmica, 58(1):170187, 2009.
[15] D. Marx and I. Schlotter. Stable assignment with couples: parameterized complex-
ity 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, Lecture Notes in Computer Science, vol. 5971, 2009.
[16] R. Niedermeier. Invitation to Fixed-Parameter Algorithms. Oxford Lecture Series
in Mathematics and its Applications. Oxford University Press, Oxford, 2006.
[17] S. Ordyniak and S. Szeider. Algorithms and complexity results for exact bayesian
structure learning. In P. Gr unwald and P. Spirtes, editors, Proceedings of UAI 2010,
The 26th Conference on Uncertainty in Articial Intelligence, Catalina Island, Cal-
ifornia, USA, July 8-11, 2010. AUAI Press, Corvallis, Oregon, pp. 401408, 2010.
10
[18] K. Pietrzak. On the parameterized complexity of the xed alphabet shortest common
supersequence and longest common subsequence problems. J. of Computer and
System Sciences, 67(4):757771, 2003.
[19] V. Raman, B. Ravikumar, and S. S. Rao. A simplied NP-complete MAXSAT
problem. Information Processing Letters, 65(1):16, 1998.
[20] M. Samer and S. Szeider. Fixed-parameter tractability. In A. Biere, M. Heule,
H. van Maaren, and T. Walsh, editors, Handbook of Satisability, chapter 13, pages
425454. IOS Press, 2009.
[21] S. Szeider. The parameterized complexity of k-ip local search for SAT and MAX
SAT. In O. Kullmann, editor, Theory and Applications of Satisability Testing -
SAT 2009, 12th International Conference, SAT 2009, Swansea, UK, June 30 - July
3, 2009. Proceedings, volume 5584 of Lecture Notes in Computer Science, pages
276283. Springer Verlag, 2009.
[22] C. A. Tovey. A simplied NP-complete satisability problem. Discr. Appl. Math.,
8(1):8589, 1984.
[23] M. Yagiura and T. Ibaraki. Analyses on the 2 and 3-ip neighborhoods for the MAX
SAT. J. Comb. Optim., 3(1):95114, 1999.
11