Skip to content

[Rule] KSatisfiability to MultivariateQuadratic #131

Description

@QingyunQian

Source: KSatisfiability (k = 3)
Target: MultivariateQuadratic (over F₂)
Motivation: 3-SAT can be reduced to MQ over F₂ in polynomial time via the standard CNF-to-ANF conversion. This connects the well-studied KSatisfiability family to algebraic formulations, enabling solving via Gröbner basis or XL-style algorithms. Together with the reverse reduction (issue #132), it establishes polynomial-time equivalence between 3-SAT and MQ over F₂. Depends on model issue #129.
Reference:

Reduction Algorithm

Notation:

  • Source: KSatisfiability instance with num_vars Boolean variables x₁, ..., x_n and num_clauses clauses, each with exactly 3 literals
  • Target: MultivariateQuadratic instance over F₂

Variable mapping:

  1. Original variables: For each x_i ∈ {0, 1}, create an MQ variable x_i ∈ F₂.
  2. Auxiliary variables: For each clause C_j, introduce one auxiliary variable t_j ∈ F₂ to reduce the cubic polynomial to two quadratic equations.

Constraint transformation:

For each 3-SAT clause C_j = (ℓ₁ ∨ ℓ₂ ∨ ℓ₃):

  1. Negate literals: Define

    • α = 1 + ℓ₁ (in F₂, so 1 + x_i for a positive literal, x_i for a negated literal)
    • β = 1 + ℓ₂
    • γ = 1 + ℓ₃

    Clause satisfaction is equivalent to α·β·γ = 0 in F₂.

  2. Quadratize: Introduce auxiliary variable t_j and replace the single cubic equation with two quadratic equations:

    • t_j + α·β = 0 (mod 2)
    • t_j·γ = 0 (mod 2)

    These two equations jointly enforce α·β·γ = 0:

    • If α·β·γ = 0, set t_j = α·β; then t_j + α·β = 0 and t_j·γ = α·β·γ = 0.
    • If α·β·γ = 1, then α = β = γ = 1, so t_j + 1 = 0 ⟹ t_j = 1, but t_j·γ = 1·1 = 1 ≠ 0 — no solution.

Both equations are quadratic (degree ≤ 2), so they fit MultivariateQuadratic.

Solution extraction:

Read the original variables x₁, ..., x_n from any satisfying MQ assignment; auxiliary variables t_j are discarded.

Size Overhead

Target metric (code name) Formula
num_variables num_vars + num_clauses
num_equations 2 * num_clauses

Where:

  • num_vars — number of source Boolean variables
  • num_clauses — number of source 3-SAT clauses
  • Original variables: num_vars
  • Auxiliary variables: num_clauses (one per clause)
  • Total MQ variables: num_vars + num_clauses
  • Total MQ equations: 2 * num_clauses (two quadratic equations per clause)

Validation Method

  • Build a closed-loop test on small KSatisfiability (k=3) instances.
  • Reduce the source instance to a MultivariateQuadratic instance over F₂.
  • Solve the MQ instance with brute-force search.
  • Extract the x_i assignment from the MQ solution and verify that every source clause is satisfied.
  • Cross-check against exhaustive search on the source problem to confirm the MQ instance is satisfiable iff the 3-SAT instance is satisfiable.

Example

Source KSatisfiability instance (k = 3):

Variables: x₁, x₂, x₃
Clauses:
  C₁: (x₁ ∨ ¬x₂ ∨ x₃)
  C₂: (¬x₁ ∨ x₂ ∨ x₃)

Target MultivariateQuadratic instance (F₂):

Field: F₂ = {0, 1}
Variables: x₁, x₂, x₃, t₁, t₂
Equations:
  # Clause C₁: (x₁ ∨ ¬x₂ ∨ x₃)
  # α = 1+x₁, β = x₂, γ = 1+x₃
  f₁: t₁ + (1 + x₁)·x₂ = 0    i.e.  t₁ + x₂ + x₁·x₂ = 0
  f₂: t₁·(1 + x₃) = 0          i.e.  t₁ + t₁·x₃ = 0

  # Clause C₂: (¬x₁ ∨ x₂ ∨ x₃)
  # α = x₁, β = 1+x₂, γ = 1+x₃
  f₃: t₂ + x₁·(1 + x₂) = 0    i.e.  t₂ + x₁ + x₁·x₂ = 0
  f₄: t₂·(1 + x₃) = 0          i.e.  t₂ + t₂·x₃ = 0

Solution:

  • 3-SAT solution: x₁=1, x₂=1, x₃=1 (satisfies both clauses)
  • MQ extension: t₁ = (1+1)·1 = 0, t₂ = 1·(1+1) = 0
  • Verification:
    • f₁: 0 + (1+1)·1 = 0 ✓
    • f₂: 0·(1+1) = 0 ✓
    • f₃: 0 + 1·(1+1) = 0 ✓
    • f₄: 0·(1+1) = 0 ✓

Overhead verification:

  • num_vars = 3, num_clauses = 2
  • num_variables = 3 + 2 = 5
  • num_equations = 2 × 2 = 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoodAn issue passed all checks.ruleA new reduction rule to be added.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions