简体   繁体   中英

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

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?

If it's this G and k = 3 that you care about, it's probably easiest to write clauses (x i ∨ x j ∨ x k ∨ x ) for all {i, j, k, ℓ} ⊆ V and then reduce them to 3-CNF, eg, (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 x 1 + … + x n − 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, eg, 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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM