Maximum Satisfiability

Satisfiability problems essentially involve solving CNF formulas

(x1x2x3)(x1xˉ2x5)(x_{1} \lor x_{2} \lor x_{3}) \land (x_{1}\lor \bar x_{2} \lor x_{5}) \land \dots

MAXSAT\text{MAXSAT}: Given a set of mm clauses over nn-variables, determine the max number of clauses that can be satisfied.

Randomized Algorithm to solve MAXSAT\text{MAXSAT}

We set each variable xix_{i} to TT or FF with equal probability

Theorem - Given any mm clauses, there is a truth assignment for the variables that satisfies at least m2\frac{m}{2} clauses.
Proof -
We define ZiZ_{i}, 1im1 \leq i \leq m which indicates if the clause has been satisfied or not.

Zi={1if clause i is satisfied0otherwiseZ_{i} = \begin{cases} 1 & \text{if clause } i \text{ is satisfied} \\ 0 & \text{otherwise} \end{cases}

Given that we randomly assign each variable xix_{i} a value,

P[Zi=1]=12k\mathbb{P}[Z_{i}=1] = 1 - 2^{-k}

Given there are kk literals in clause ii (there’s only 1 assignment of the kk literals which would result in Zi=0Z_{i} = 0).

Since we know k1k \geq 1, we know P[Zi=1]12\mathbb{P}[Z_{i} = 1] \geq \frac{1}{2}.

Calculating expected number of satisfied clauses,

E[i=1mZi]=i=1mE[Zi]m2\mathbb{E}\left[\sum\limits_{i=1}^{m}Z_{i}\right]= \sum\limits_{i=1}^{m}\mathbb{E}[Z_{i}] \geq \frac{m}{2}

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[mZ>mE[Z]]<E[mZ]mE[Z]=1\mathbb{P}[Z < \mathbb{E}[Z]] = \mathbb{P}[m - Z > m - \mathbb{E}[Z]] < \frac{\mathbb{E}[m -Z]}{m-\mathbb{E}[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[Zm2]0\mathbb{P}\left[Z \geq \frac{m}{2}\right]\neq 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 II, let m(I)m_{*}(I) be the maximum number of clauses that can be satisfied. Let mA(I)m_{A}(I) be the number of clauses satisfiable by algorithm AA.

We define the performance ratio of AA to be defined as follows

PerfRatio(A)=infImA(I)m(I)\text{PerfRatio(A)} = \text{inf}_{I} \frac{m_{A}(I)}{m_{*}(I)}

If PerfRatio(A)=α\text{PerfRatio(A)} = \alpha, then AA is an α\alpha-approximation algorithm. The randomized algorithm discussed above is a 12\frac{1}{2}-approximation algorithm.

The approximation factor of our algorithm can be improved if we are allowed to assume that every clause has at least 22 literals, giving us a 34\frac{3}{4}-approximation algorithm.

LP Relaxations & Randomized Rounding

Forming an Integer Program for MAXSAT\text{MAXSAT}

We define variable zj j[m]z_{j}\ \forall j \in [m]

zj={1if clause j is satisfied0otherwisez_{j}= \begin{cases} 1 & \text{if clause } j \text{ is satisfied} \\ 0 & \text{otherwise} \end{cases}

define variable yi i[n]y_{i}\ \forall i \in [n]

yi={1if xi is True0otherwisey_{i} = \begin{cases} 1 & \text{if } x_{i} \text{ is True} \\ 0 & \text{otherwise} \end{cases}

and Cj+C_{j}^{+} as the set of literals that appear unnegated in clause jj, while CjC_{j}^{-} is the set of literals that appear negated in clause jj.

We want to maximize

j=1mzj\sum\limits_{j=1}^{m}z_{j}

Subject to constraints

  1. yiy_{i} and zj{0,1} i[n],j[m]z_{j} \in \{0, 1\}\ \forall i \in [n], \forall j \in [m].
  2. iCj+yi+iCj(1yi)zj j[m]\sum\limits_{i\in C_{j}^{+}} y_{i} + \sum\limits_{i' \in C_{j}^{-}}(1 - y_{i'}) \geq z_{j}\ \forall j \in [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,zjy_{i}, z_{j}, updating the first constraint to

  1. yiy_{i} and zj[0,1] i[n],j[m]z_{j} \in [0, 1]\ \forall i \in [n], \forall j \in [m]

The LP will then provide us the solutions y^i,z^j\hat y_{i}, \hat z_{j} such that j=1mzjj=1mz^j\sum\limits_{j=1}^{m} z_{j} \leq \sum\limits_{j=1}^{m} \hat z_{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\hat y_{i}, \hat z_{j}, we perform randomized rounding on them to obtain yi,zjy_{i}, z_{j}

yi={1w.p y^i0otherwisey_{i} = \begin{cases} 1 & \text{w.p } \hat y_{i}\\ 0 & \text{otherwise} \end{cases}
zj={1w.p z^j0otherwisez_{j} = \begin{cases} 1 & \text{w.p } \hat z_{j}\\ 0 & \text{otherwise} \end{cases}

Lemma - Let clause CjC_{j} have kk literals, The probability that CjC_{j} is satisfied by randomized rounding is βkz^j\geq \beta_{k}\hat z_{j} where βk=1(11k)k\beta_{k} = 1 - (1 - \frac{1}{k})^{k}
Proof -
Since we are working with one clause, we just assume nothing is negated for simplicity, i.e

Cj=x1x2xkC_{j} = x_{1} \lor x_{2} \lor \dots \lor x_{k}

From the linear program, we know that i=1ky^iz^j\sum\limits_{i=1}^{k} \hat y_{i} \geq \hat z_{j}
For the clause to not be satisfied, all y^i\hat y_{i} should’ve been rounded down to 00, and we need to compute the probability of that not occurring.

P[Cj is satisfied]=1i=1k(1y^i)1[i=1k(1y^i)k]k(AM-GM Inequality)1[kz^jk]k(i=1ky^izj)=1(1z^jk)k[1(11k)k]z^j=βkz^j\begin{aligned} \mathbb{P}[C_{j} \text{ is satisfied}] &= 1 - \prod_{i=1}^{k} ( 1 - \hat y_{i})\\ & \geq 1 - \left[\frac{\sum\limits_{i=1}^{k}(1 - \hat y_{i})}{k}\right]^{k} & \text{(AM-GM Inequality)}\\ & \geq 1 - \left[\frac{k - \hat z_{j}}{k}\right]^{k} & \left(\sum\limits_{i=1}^{k}\hat y_{i} \geq z_{j}\right)\\ &= 1 - \left(1 - \frac{\hat z_{j}}{k}\right)^{k}\\ & \geq \left[1 - \left(1 - \frac{1}{k}\right)^{k}\right]\hat z_{j}\\ &= \beta_{k} \hat z_{j} \end{aligned}

The last step makes use of the claim that when f(x)=1(1xk)kf(x) = 1 - (1 - \frac{x}{k})^{k} and g(x)=βxg(x) = \beta x, then f(x)g(x) x[0,1]f(x) \geq g(x)\ \forall x \in [0, 1].

Published Feb 2, 2023