Skip to content

[Rule] GraphBandwidth to KSatisfiability #137

@QingyunQian

Description

@QingyunQian

Source: GraphBandwidth
Target: KSatisfiability (3-SAT)
Motivation: Enables solving the decision version of GraphBandwidth ("is bandwidth ≤ k?") using SAT solvers. Optimization via binary search on k with O(log n) SAT calls.
Reference:

Reduction Algorithm

Notation:

  • Source: GraphBandwidth instance with G = (V, E), n = |V|, m = |E|, bandwidth bound k
  • Target: KSatisfiability<K3> instance

Variable mapping:

Boolean variables x_{i,p} for i ∈ V, p ∈ {0, ..., n−1}. x_{i,p} = true iff vertex i is at position p. Total: n² variables.
For implementation, a standard indexing is id(i,p) = i·n + p + 1 (1-based literal IDs in DIMACS CNF).

Constraint/objective transformation:

  1. At-least-one (ALO): ∀i: (x_{i,0} ∨ x_{i,1} ∨ ... ∨ x_{i,n-1}) — each vertex gets a position
  2. At-most-one (AMO): ∀i, p < q: (¬x_{i,p} ∨ ¬x_{i,q}) — each vertex at most one position
  3. ALO columns: ∀p: (x_{0,p} ∨ x_{1,p} ∨ ... ∨ x_{n-1,p}) — each position occupied
  4. AMO columns: ∀p, i < j: (¬x_{i,p} ∨ ¬x_{j,p}) — each position at most one vertex
  5. Forbidden pairs: ∀(u,v) ∈ E, |p−q| > k: (¬x_{u,p} ∨ ¬x_{v,q})

ALO clauses (length n) are converted to 3-SAT via sequential encoding with auxiliary variables. AMO and forbidden-pair clauses are padded to length 3 by literal duplication, e.g. (A ∨ B) → (A ∨ B ∨ B). Final output is a KSatisfiability<K3> instance with all clauses of length exactly 3.

Note: keeping all four groups (ALO rows, AMO rows, ALO cols, AMO cols) is an intentional redundant modeling choice to strengthen unit propagation in CDCL SAT solvers.

Size Overhead

Target metric (code name) Polynomial (using symbols above)
num_vars n² + O(n²) auxiliary
num_clauses O(n³ + m·n²) with pairwise AMO; O(n² + m·n²) with sequential AMO

Validation Method

  • Cross-check with brute-force solver on small instances (n ≤ 8)
  • Compare with ILP reduction results on the same instances
  • Test both SAT (bandwidth ≤ k) and UNSAT (bandwidth > k) cases against known values

Example

Source: P₄ (path of 4 vertices), k = 1

Vertices: {0, 1, 2, 3}
Edges: {(0,1), (1,2), (2,3)}
Bandwidth bound: k = 1
Decision: is B*(P₄) ≤ 1?  (YES)

Target CNF (before 3-SAT conversion)

Variables: x_{i,p} for i,p ∈ {0..3}  (16 Boolean variables)

Clauses:
  ALO rows (4):    (x_{0,0} ∨ x_{0,1} ∨ x_{0,2} ∨ x_{0,3}), ...
  AMO rows (24):   (¬x_{0,0} ∨ ¬x_{0,1}), (¬x_{0,0} ∨ ¬x_{0,2}), ...
  ALO cols (4):    (x_{0,0} ∨ x_{1,0} ∨ x_{2,0} ∨ x_{3,0}), ...
  AMO cols (24):   (¬x_{0,0} ∨ ¬x_{1,0}), ...
  Forbidden (18):  for each edge, pairs with |p−q| > 1
    e.g. edge (0,1): (¬x_{0,0} ∨ ¬x_{1,2}), (¬x_{0,0} ∨ ¬x_{1,3}), ...

Solution: SAT. Model: x_{0,0}=T, x_{1,1}=T, x_{2,2}=T, x_{3,3}=T → f = [0,1,2,3], all spans = 1 ≤ k ✓

Base Overhead: n=4, m=3, k=1 → base num_vars = 16, base num_clauses = 74.

After strict 3-SAT conversion, auxiliary variables and clauses are added (from ALO conversion), so final counts are larger than the base CNF counts above.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions