随机算法 (Fall 2015)/Lovász Local Lemma
Lovász Local Lemma
Suppose that we are give a set of "bad" events
Obviously, a necessary condition for this is that for none of the bad events its occurrence is certain, i.e.
- Case 1: mutual independence.
If all the bad events
and hence this probability is positive if
- Case 2: arbitrary dependency.
On the other extreme, if we know nothing about the dependencies between these bad event, the best we can do is to apply the union bound:
which is positive if
Lovász Local Lemma (symmetric case)
In most situations, the dependencies between events are somewhere between these two extremal cases: the events are not independent of each other, but on the other hand the dependencies between them are not total out of control. For these more general cases, we would like to exploit the tradeoff between probabilities of bad events and dependencies between them.
The Lovász local lemma is such a powerful tool for showing the possibility of rare event under limited dependencies. The structure of dependencies between a set of events is described by a dependency graph, which is a graph with events as vertices and each event is adjacent to the events which are dependent with it in the dependency graph.
Definition (dependency graph) - Let
be a set of events. A graph with set of vertices is called a dependency graph for the events if every event is mutually independent of all the events in .
- Let
The maximum degree
- Remark on the mutual independence
- In probability theory, an event
is said to be independent of events if for any disjoint , we have ,
- that is, occurrences of events among
have no influence on the occurrence of .
- Example
- Let
be a set of mutually independent random variables. Each event is a predicate defined on a number of variables among . Let be the unique smallest set of variables which determine . The dependency graph is defined as that any two events are adjacent in if and only if they share variables, i.e. .
The following theorem was proved by Erdős and Lovász in 1975 and then later improved by Lovász in 1977. Now it is commonly referred as the Lovász local lemma. It is a very powerful tool, especially when being used with the probabilistic method, as it supplies a way for dealing with rare events.
Lovász Local Lemma (symmetric case) - Let
be a set of events, and assume that the followings hold:
for every event ;- every event
is mutually independent of all other events except at most of them, and
.
- Then
.
- Let
Here
Intuitively, the Lovász Local Lemma says that if a rare (but hopefully possible) event is formulated as to avoid a series of bad events simultaneously, then the rare event is indeed possible if:
- none of these bad events is too probable;
- none of these bad events is dependent with too many other bad events;
Here the tradeoff between "too probable" and "too many" is characterized by the
According to a result of Shearer in 1985, the condition of the Lovász Local Lemma cannot be substantially improved if only the bounds on
Lovász Local Lemma (asymmetric case)
Sometimes when applying the local lemma, a few bad events are much more probable than others or are dependent with more other bad events. In this case, using the same upper bounds
We need to introduce a few notations that will be frequently used onwards.
Let
- inclusive neighborhood:
denotes the set of events in , including itself, that are dependent with . More precisely, is mutually independent of all events in . - neighborhood:
, that is, contains the events in that are dependent with , not including itself.
The following is the asymmetric version of the Lovász Local Lemma. This generalization is due to Spencer.
Lovász Local Lemma (general case) - Let
be a set of events, where every event is mutually independent of all other events excepts those in its neighborhood in the dependency graph. Suppose there exist real numbers such that for every , .
- Then
.
- Let
This generalized version of the local lemma immediately implies the symmetric version of the lemma. Namely,
for all ; , where is the maximum degree of the dependency graph.
To see this, for every
With the above two conditions satisfied, for all
,
which according to the Lovász Local Lemma (general case), implies that
.
This gives the symmetric version of the local lemma.
A non-constructive proof of LLL
We then give the proof of the generalized Lovász Local Lemma. In particular, this proof is non-constructive, in contrast to the constructive proofs that we are going to introduce later, which are basically algorithms.
Apply the chain rule. The probability that none of the bad events occurs can be expressed as:
It is then sufficient to show that
,
which will prove the lemma.
We then prove a slightly more general statement:
- (induction hypothesis)
for any distinct events .
The proof is by induction on
.
For general
Then applying the following basic conditional probability identity
,
we have
Due to the mutual independence between
which according to the assumption in the Lovász Local Lemma, is bounded as
Applying the chain rule to the
Note that there are always less than
where the last inequality is due to the fact that
Combining everything together, we have
As we argued in the beginning, this proves the general Lovász Local Lemma.
Random Search for Exact- -SAT
We start by giving the definition of
Definition (exact- -CNF)- A logic expression
defined on Boolean variables is said to be a conjunctive normal form (CNF) if can be written as a conjunction(AND) of clauses as , where each clause is a disjunction(OR) of literals, where every literal is either a variable or the negation of a variable.- We call a CNF formula a exact-
-CNF if every clause consists of exact distinct literals.
- We call a CNF formula a exact-
- A logic expression
For example:
is an exact-
- Remark
- The notion of exact-
-CNF is slightly more restrictive than the -CNF, where each clause consists of at most variables. The discussion of the subtle differences between these two definitions can be found here.
A logic expression
The exact-
exact- -SAT- Input: an exact-
-CNF formula . - Output: whether
is satisfiable.
- Input: an exact-
It is well known that
Satisfiability of exact- -CNF
Inspired by the Lovasz local lemma, we now consider the dependencies between clauses in a CNF formula.
Given a CNF formula
By the Lovasz local lemma, we almost immediately have the following theorem for the satisfiability of exact-
Theorem - Let
be an exact- -CNF formula with maximum degree . If then is always satisfiable.
- Let
Proof. Let
be Boolean random variables sampled uniformly and independently from . We are going to show that is satisfied by this random assignment with positive probability. Due to the probabilistic method, this will prove the existence of a satisfying assignment for .Suppose there are
clauses in . Let denote the bad event that is not satisfied by the random assignment . Clearly, each is dependent with at most other 's. And our goal is to show that .
Recall that in an exact-
-CNF, every clause consists of exact variable, and is violated by precisely one local assignment among all possibilities. Thus the probability that is not satisfied is .Assuming that
, i.e. , by the Lovasz local lemma (symmetric case), we have .
The random search algorithm
The above theorem basically says that for a CNF if every individual clause is easy to satisfy and is dependent with few other clauses then the CNF should be always satisfiable. However, the theorem only states the existence of a satisfying solution, but does not specify a way to find this solution. Next we give a simple randomized algorithm and prove it can find the satisfying solution efficiently under a slightly stronger assumption than the Lovasz local lemma.
Given as input a CNF formula
The following algorithm is due to Moser in 2009. The algorithm consists of two components: the main function Solve() and a sub-routine Fix().
Solve(CNF )- Pick values of
uniformly and independently at random; - While there is an unsatisfied clause
in- Fix(
);
- Fix(
- Pick values of
The sub-routine Fix() is a recursive procedure:
Fix(Clause )- Replace the values of variables in
with new uniform and independent random values; - While there is unsatisfied clause
(including itself) that- Fix(
);
- Fix(
- Replace the values of variables in
It is an amazing discovery that this simple algorithm works well as long as the condition of Lovasz local lemma is satisfied. Here we prove a slightly weakened statement for the convenience of analysis.
Theorem - Let
be an exact- -CNF formula with maximum degree . - If
then the algorithm Solve( ) finds a satisfying assignment for in time with high probability.
- Let
The analysis is based on a technique called entropy compression. This is a very clever idea and may be very different from what you might have seen so far about algorithm analysis.
We first give a high level description of the ideas behind the analysis of this brilliant algorithm:
- We use
to abstractly denote an algorithm running on an input with random bits . For an algorithm with no access to the random bits , once the input is fixed, the behavior of the algorithm as well as its output is deterministic. But for randomized algorithms, the behavior of is a random variable even when the input is fixed. - Fix an arbitrary (worst-case) input
. We try to construct a succinct representation of the behavior of in such a manner that the random bits can always be fully recovered from this succinct representation. In other words, gives an encoding (a 1-1 mapping) of the random bits to a succinct representation. - It is a fundamental law that random bits cannot be compressed significantly by any encoding. Therefore if it is the case that a longer running time of
would imply that the random bits can be encoded to a much shorter succinct representation, then we prove the running time of the algorithm cannot be too long.
We consider a restrictive case.
Let
In this particular model, the dependency graph
Observe that
means that the the
The satisfiability of
However, the condition of the Lovasz local lemma has an extra assumption on the degree of dependency graph. In our model, this means that each clause shares variables with at most
Therefore, proving the Lovasz local lemma on the restricted forms of events as described above, can be reduced to the following problem:
- Problem
- Find a condition on
and , such that any -CNF with bounded degree is satisfiable.
In 2009, Moser comes up with the following procedure solving the problem. He later generalizes the procedure to general forms of events. This not only gives a beautiful constructive proof to the Lovasz local lemma, but also provides an efficient randomized algorithm for finding a satisfiable assignment for a number of events with bounded dependencies.
Let
Solve( )- Pick a random assignment of
. - While there is an unsatisfied clause
in- Fix(
).
- Fix(
- Pick a random assignment of
The sub-routine Fix is defined as follows:
Fix( )- Replace the variables in
with new random values. - While there is unsatisfied clause
that- Fix(
).
- Fix(
- Replace the variables in
The procedure looks very simple. It just recursively fixes the unsatisfied clauses by randomly replacing the assignment to the variables.
We then prove it works.
Number of top-level callings of Fix
In Solve(
Assume Fix(
- Observation
- Every clause that was satisfied before Fix(
) was called will still remain satisfied and will also be satisfied after Fix( ) returns.
The observation can be proved by induction on the structure of recursion. Since there are
We then prove that Fix(
Termination of Fix
The idea of the proof is to reconstruct a random string.
Suppose that during the running of Solve(
Let
We then reconstruct
Recall that Solve(
- Observation 1
- Fix a
. The recursion trees which capture the total running history of Solve( ) can be encoded in bits.
Each root node corresponds to a clause. There are
The smart part is how to encode the branches of the tree. Note that Fix(
- Observation 2
- The random sequence
can be encoded in bits.
With
We then observe that with these information, the sequence of the random bits
The key step is that a clause
The following theorem lies in the heart of the Kolmogorov complexity. The theorem states that random sequence is incompressible.
Theorem (Kolmogorov) - For any encoding scheme , with high probability, a random sequence
is encoded in at least bits.
- For any encoding scheme , with high probability, a random sequence
Applying the theorem, we have that with high probability,
.
Therefore,
In order to bound
,
which hold for
Back to the local lemma
We showed that for
Recall that the symmetric version of the local lemma:
Theorem (The local lemma: symmetric case) - Let
be a set of events, and assume that the following hold:- for all
, ; - the maximum degree of the dependency graph for the events
is , and
.
- for all
- Then
.
- Let
Suppose the underlying probability space is a number of mutually independent uniform random boolean variables, and the evens
thus, the condition
which means the Moser's procedure is asymptotically optimal on the degree of dependency.