MAXSAT: Given a set of m clauses over n-variables, determine the max number of clauses that can be satisfied.
Randomized Algorithm to solve MAXSAT
We set each variable xi to T or F with equal probability
Theorem - Given any m clauses, there is a truth assignment for the variables that satisfies at least 2m clauses. Proof -
We define Zi, 1≤i≤m which indicates if the clause has been satisfied or not.
Zi={10if clause i is satisfiedotherwise
Given that we randomly assign each variable xi a value,
P[Zi=1]=1−2−k
Given there are k literals in clause i (there’s only 1 assignment of the k literals which would result in Zi=0).
Since we know k≥1, we know P[Zi=1]≥21.
Calculating expected number of satisfied clauses,
E[i=1∑mZi]=i=1∑mE[Zi]≥2m
Now, we find the probability that the actual number of clauses is less than the expected value. Using a technique called reverse markov.
P[Z<E[Z]]=P[m−Z>m−E[Z]]<m−E[Z]E[m−Z]=1
Hence, there’s a non-zero chance that the actual number of clauses satisfied is greater than the expected value, directly implying
P[Z≥2m]=0
Hence proved.
This type of proof is known as Probabilistic Method, where you show the existence of an object by showing it has a non-zero probability of occurring when chosen randomly.
Performance Ratio
Given an instance I, let m∗(I) be the maximum number of clauses that can be satisfied. Let mA(I) be the number of clauses satisfiable by algorithm A.
We define the performance ratio of A to be defined as follows
PerfRatio(A)=infIm∗(I)mA(I)
If PerfRatio(A)=α, then A is an α−approximation algorithm. The randomized algorithm discussed above is a 21-approximation algorithm.
The approximation factor of our algorithm can be improved if we are allowed to assume that every clause has at least 2 literals, giving us a 43-approximation algorithm.
LP Relaxations & Randomized Rounding
Forming an Integer Program for MAXSAT
We define variable zj∀j∈[m]
zj={10if clause j is satisfiedotherwise
define variable yi∀i∈[n]
yi={10if xi is Trueotherwise
and Cj+ as the set of literals that appear unnegated in clause j, while Cj− is the set of literals that appear negated in clause j.
We want to maximize
j=1∑mzj
Subject to constraints
yi and zj∈{0,1}∀i∈[n],∀j∈[m].
i∈Cj+∑yi+i′∈Cj−∑(1−yi′)≥zj∀j∈[m]
Relaxing Integer Constraints
Solving an Integer Programming problem can take exponential time, as opposed to LP, which can take polynomial time, hence we relax the integer constraints on yi,zj, updating the first constraint to
yi and zj∈[0,1]∀i∈[n],∀j∈[m]
The LP will then provide us the solutions y^i,z^j such that j=1∑mzj≤j=1∑mz^j (the LP has essentially more solutions to work with, so it’s best case will be greater than or equal to the integer constraints case).
Randomized Rounding
Given y^i,z^j, we perform randomized rounding on them to obtain yi,zj
yi={10w.p y^iotherwise
zj={10w.p z^jotherwise
Lemma - Let clause Cj have k literals, The probability that Cj is satisfied by randomized rounding is ≥βkz^j where βk=1−(1−k1)k Proof -
Since we are working with one clause, we just assume nothing is negated for simplicity, i.e
Cj=x1∨x2∨⋯∨xk
From the linear program, we know that i=1∑ky^i≥z^j
For the clause to not be satisfied, all y^i should’ve been rounded down to 0, and we need to compute the probability of that not occurring.
P[Cj is satisfied]=1−i=1∏k(1−y^i)≥1−ki=1∑k(1−y^i)k≥1−[kk−z^j]k=1−(1−kz^j)k≥[1−(1−k1)k]z^j=βkz^j(AM-GM Inequality)(i=1∑ky^i≥zj)
The last step makes use of the claim that when f(x)=1−(1−kx)k and g(x)=βx, then f(x)≥g(x)∀x∈[0,1].