How to reduce k-independent set problem to 3-SAT

1.4k views Asked by At

So I got this homework question and we are asked to reduce a k-independent set satisfiability problem to a 3-SAT set of clauses under the conjunctive normal form.

So for G(V, E) we have verticies set
V = {x1, x2, x3, x4, x5, x6}
and edges set
E = { e1 = (x1,x3), e2 = (x1,x5), e3 = (x1,x6), e4 = (x2,x5), e5 = (x2,x6), e6 = (x3,x4), e7 = (x3,x5), e8 = (x5,x6) }

My first approach to this is to have a clause per edge as we can't have an edge between two vertex in the independent set :
e1: (¬x1 v ¬x3)
e2: (¬x1 v ¬x5)
e3: (¬x1 v ¬x6)
e4: (¬x2 v ¬x5)
e5: (¬x2 v ¬x6)
e6: (¬x3 v ¬x4)
e7: (¬x3 v ¬x5)
e8: (¬x5 v ¬x6)

But the problem is, for k = 3 for example, how to write clauses to ensure that at least 3 different variables (xi) are set to true ?
This is achievable using Weighted-2-satisfiability, but seems hard to achieve just using good old 3-SAT.
Any hints to how to proceed ?

1

There are 1 answers

0
David Eisenstat On

If it's this G and k = 3 that you care about, it's probably easiest to write clauses (xi ∨ xj ∨ xk ∨ x) for all {i, j, k, ℓ} ⊆ V and then reduce them to 3-CNF, e.g., (x ∨ y ∨ z ∨ w) becomes (v ∨ x ∨ y) ∧ (¬v ∨ z ∨ w), where v is a new variable.

In general, you're going to want to

  1. Define a Boolean circuit to compute x1 + … + xn ≥ k (you can evaluate x1 + … + xn − k in two's complement arithmetic using ripple-carry adders and then invert the sign bit).

  2. Translate this circuit into a 3-CNF formula. First, replace gates with more than two inputs with several two-input gates. Then for each node in the circuit create a variable. For each gate write four clauses constraining the output, one for each possible input, e.g., if there's an AND gate with inputs x and y and output z, then write clauses (x ∨ y ∨ ¬z) ∧ (x ∨ ¬y ∧ ¬z) ∧ (¬x ∨ y ∨ ¬z) ∧ (¬x ∨ ¬y ∨ z). A XOR gate would be (x ∨ y ∨ ¬z) ∧ (x ∨ ¬y ∧ z) ∧ (¬x ∨ y ∨ z) ∧ (¬x ∨ ¬y ∨ ¬z).