Documentation

CslibFrontier.Computability.Complexity.Problems.IndependentSet.Sparse

A reduction of linear size to independent sets #

Karp's reduction Cslib.Complexity.SAT.toIndependentSet joins all complementary occurrences of a variable, so its graph can have quadratically many edges in the number of clauses even for formulas with three literals per clause. SAT.toSparseIndependentSet is the reduction with variable edges Garey and Johnson, Theorem 3.3, stated for independent sets. It has

and asks for an independent set of n + m vertices, for m clauses. An independent set has at most one vertex in each variable edge and in each clause clique, so one of n + m vertices has exactly one in each: the literal vertices chosen give an assignment, and the position chosen in a clause is not joined to its literal, which therefore holds. Conversely, a satisfying assignment chooses the true literal of each variable and a true position of each clause.

On formulas whose clauses have at most k literals the graph has at most (k ^ 2 + 5 k) m vertices and edges in total (Cslib.Complexity.SAT.length_toSparseIndependentSet_le), which is linear in m for fixed k.

Main definitions #

Main results #

References #

The graph #

The vertex of the literal l of φ, its variable numbered by its position in φ.distinctVars.

The vertex of position j of clause i.

The vertices: the two literals of every variable of φ, and every position of every clause.

The edges between the two literals of each variable.

The edges between any two positions of a clause.

The edges from each position of a clause to the complement of its literal.

The reduction from SAT to IndependentSet with variable edges Garey and Johnson, Theorem 3.3: the graph of φ with the target n + m, for n distinct variables and m clauses.

Vertices and edges #

theorem Cslib.Complexity.SAT.SparseIndependentSet.mem_vertices {φ : Logic.PL.CNF ℕ} {v : ℕ} :
v ∈ vertices φ ↔ (∃ x ∈ φ.vars, ∃ (b : Bool), v = literalVertex φ (x, b)) ∨ ∃ (i : ℕ) (hi : i < List.length φ), ∃ j < List.length φ[i], v = occurrenceVertex i j

Correctness #

Correctness of the reduction with variable edges. A formula is satisfiable exactly when its graph has an independent set of n + m vertices, for n distinct variables and m clauses.

Size #

The graph has linear size. On formulas with m clauses of at most k literals, the graph of toSparseIndependentSet has at most (k ^ 2 + 5 k) m vertices and edges in total, counted as listed.

Polynomial-time reduction #

The reduction toSparseIndependentSet is computable in polynomial time: vertex labels are computed in unary from clause, position and variable indices, then converted to binary.