Skip to content

[Rule] ExactCoverBy3Sets to BoundedDiameterSpanningTree #913

@isPANN

Description

@isPANN

Source: ExactCoverBy3Sets (X3C)
Target: BoundedDiameterSpanningTree
Motivation: Establishes NP-completeness of BOUNDED DIAMETER SPANNING TREE for any fixed D ≥ 4 via transformation from X3C. The diameter constraint on spanning trees arises in communication network design where latency (hop count) must be bounded alongside total cost.
Reference: Garey & Johnson, Computers and Intractability, ND4, p.206

GJ Source Entry

[ND4] BOUNDED DIAMETER SPANNING TREE
INSTANCE: Graph G = (V, E), a weight w(e) in Z+ for each e in E, positive integers B and D.
QUESTION: Is there a spanning tree T = (V, E') for G such that sum_{e in E'} w(e) <= B and such that T contains no path of more than D edges?
Reference: [Garey and Johnson, ----]. Transformation from X3C.
Comment: NP-complete for any fixed D >= 4, even if w(e) in {1, 2} for all e in E. Can be solved in polynomial time for D <= 3 or if all weights are equal.

Reduction Algorithm

Given an X3C instance with universe X = {0, 1, …, 3q−1} and collection C = [S₀, S₁, …, S_{m−1}] where each Sᵢ is a 3-element subset of X.

All weights are in {1, 2}, consistent with the Z⁺ requirement in the problem definition.

Vertex indexing

  • r = 0
  • v₁ = 1, v₂ = 2
  • sᵢ = 3 + i for i ∈ [0, m−1]
  • eⱼ = 3 + m + j for j ∈ [0, 3q−1]

Total vertices: n = 3 + m + 3q

Edge construction

The graph contains only the edges below; no other edges are present.

  1. Forced-center path: (r, v₁) weight 1, (v₁, v₂) weight 1. Because dist(r, v₂) = 2, any feasible spanning tree of diameter ≤ 4 must keep every vertex within distance 2 of r.

  2. Root-to-set edges: For each sᵢ: (r, sᵢ) weight 2. Choosing this edge corresponds to selecting set Sᵢ.

  3. Set-to-element edges: If j ∈ Sᵢ: (sᵢ, eⱼ) weight 1. Each element connects through its covering set.

  4. Set clique: For all 0 ≤ i < j < m: (sᵢ, sⱼ) weight 1. Unselected sets attach to selected ones cheaply.

Parameters

  • D = 4
  • B = 4q + m + 2

Explanation of B: q selected sets cost 2q; remaining m − q sets use clique edges costing m − q; 3q element edges cost 3q; forced path costs 2. Total: 2q + (m − q) + 3q + 2 = 4q + m + 2.

Size Overhead

Target metric (code name) Expression
num_vertices m + 3q + 3
num_edges 2 + m + 3m + m(m−1)/2
weight_bound 4q + m + 2
diameter_bound 4

Correctness

Forward direction (X3C has exact cover ⟹ BDST feasible)

Let {Sᵢ₁, …, Sᵢ_q} be an exact cover. Construct the spanning tree:

  • Forced-center: (r, v₁), (v₁, v₂) — cost 2
  • Selected sets: (r, sᵢₖ) for k = 1, …, q — cost 2q
  • Elements: each eⱼ connects to its unique covering sᵢₖ — cost 3q
  • Unselected sets: each connects to any selected sᵢₖ via clique edge — cost m − q
  • Total weight: 2 + 2q + 3q + (m − q) = 4q + m + 2 = B ✓
  • Diameter: set vertices at depth 1, elements at depth 2, all within distance 2 of r, so diameter ≤ 4 ✓

Backward direction (BDST feasible ⟹ X3C has exact cover)

Let T be a spanning tree with weight ≤ B and diameter ≤ 4.

Step 1 — radius constraint. Since dist(r, v₂) = 2, any vertex at distance ≥ 3 from r would be at distance ≥ 5 from v₂, contradicting diameter ≤ 4. Hence all vertices are within distance 2 of r.

Step 2 — element attachment. Element vertices connect only to set vertices (no other edges exist in the graph). So each eⱼ must be at depth 2: eⱼ → sᵢ → r, meaning sᵢ is directly connected to r.

Step 3 — budget counting. Let k be the number of root-to-set edges in T. The minimum cost is: k · 2 + (m − k) · 1 + 3q · 1 + 2 · 1 = k + m + 3q + 2. Feasibility requires k + m + 3q + 2 ≤ 4q + m + 2, so k ≤ q.

Step 4 — covering. Each selected set covers at most 3 elements. To cover all 3q elements, k ≥ q. Thus k = q. Since exactly q sets of size 3 must account for all 3q element attachments, every selected set contributes all three of its elements and no element belongs to two selected sets. Therefore the selected sets are pairwise disjoint and form an exact cover.

Solution Extraction

selected = {i for i in range(m) if (r, s(i)) ∈ T or (s(i), r) ∈ T}

These are the set vertices connected to r via weight-2 edges. The corresponding sets form the exact cover.

Validation Method

  • Closed-loop: reduce X3C → BDST, solve, extract cover, verify
  • Negative: X3C with no exact cover → BDST infeasible
  • Tree validity: n−1 edges, connected, acyclic
  • Weight ≤ B, diameter ≤ D
  • Extraction: q sets, pairwise disjoint, union = X

Example

Source (X3C):
X = {0, 1, 2, 3, 4, 5}, q = 2.
C = [S₀={0,1,2}, S₁={3,4,5}, S₂={0,3,4}, S₃={1,2,5}].
Exact covers: {S₀, S₁} or {S₂, S₃}.

Constructed BDST (n=13, D=4, B=14):

  • Vertices: r(0), v₁(1), v₂(2), s₀(3), s₁(4), s₂(5), s₃(6), e₀(7), e₁(8), e₂(9), e₃(10), e₄(11), e₅(12)
  • Edges (24 total, all weights ∈ {1, 2}):
    • Forced: (0,1) w=1, (1,2) w=1
    • Root-to-set: (0,3) w=2, (0,4) w=2, (0,5) w=2, (0,6) w=2
    • Set-to-element: (3,7) w=1, (3,8) w=1, (3,9) w=1, (4,10) w=1, (4,11) w=1, (4,12) w=1, (5,7) w=1, (5,10) w=1, (5,11) w=1, (6,8) w=1, (6,9) w=1, (6,12) w=1
    • Clique: (3,4) w=1, (3,5) w=1, (3,6) w=1, (4,5) w=1, (4,6) w=1, (5,6) w=1

Solution (cover {S₀, S₁}):
Tree: (0,1)w=1, (1,2)w=1, (0,3)w=2, (0,4)w=2, (3,7)w=1, (3,8)w=1, (3,9)w=1, (4,10)w=1, (4,11)w=1, (4,12)w=1, (5,3)w=1, (6,4)w=1

  • 12 edges, 13 vertices ✓
  • Weight: 1+1+2+2+1+1+1+1+1+1+1+1 = 14 = B ✓
  • Diameter: e₀(7)–s₀(3)–r(0)–s₁(4)–e₃(10) = 4 edges ✓

NO instance:
C = [S₀={0,1,2}, S₁={0,3,4}, S₂={1,3,5}, S₃={2,4,5}].
Every pair overlaps → no exact cover → BDST infeasible with B=14.

References

  • [Garey and Johnson, 1979]: Computers and Intractability: A Guide to the Theory of NP-Completeness, W.H. Freeman, ND4, p.206.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Status

    Ready

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions