Skip to content

[Rule] HAMILTONIAN CIRCUIT to BOUNDED COMPONENT SPANNING FOREST #238

@isPANN

Description

@isPANN

name: Rule
about: Propose a new reduction rule
title: "[Rule] HAMILTONIAN CIRCUIT to BOUNDED COMPONENT SPANNING FOREST"
labels: rule
assignees: ''
canonical_source_name: 'HamiltonianCircuit'
canonical_target_name: 'BoundedComponentSpanningForest'
source_in_codebase: true
target_in_codebase: true

Source: HamiltonianCircuit
Target: BoundedComponentSpanningForest
Motivation: Establishes NP-hardness of the path-component specialization of BOUNDED COMPONENT SPANNING FOREST via polynomial-time reduction from HAMILTONIAN CIRCUIT. A pendant-vertex gadget pins the spanning path's endpoints so that any YES certificate for BCSF directly yields a Hamiltonian circuit. The GJ comment on ND10 explicitly notes "NP-complete even for K=|V|-1 (i.e., spanning trees)."

Note on model variant: The codebase BoundedComponentSpanningForest model partitions vertices into at most max_components connected components, each of total weight at most max_weight. It does not enforce that each component is a path. This reduction targets the specialization where max_components = 1 and unit weights force the single component to span all vertices. The backward direction additionally requires the degree-2 path structure imposed by the pendant vertices; if the model gains a path_components constraint in the future, the backward argument becomes unconditional.

Reference: Garey & Johnson, Computers and Intractability, ND10, p. 208

GJ Source Entry

[ND10] BOUNDED COMPONENT SPANNING FOREST
INSTANCE: Graph G=(V,E), positive integers K and B, non-negative integer weight w(v) for each v in V.
QUESTION: Can the vertices of V be partitioned into at most K disjoint subsets, each inducing a connected subgraph, with the total vertex weight of each subset at most B?
Reference: [Garey and Johnson, 1979]. Transformation from HAMILTONIAN CIRCUIT.
Comment: NP-complete even for K=|V|-1 (i.e., spanning trees).

Reduction Algorithm

Summary:
Given a Hamiltonian Circuit instance G = (V, E) with n = |V| vertices, construct a BOUNDED COMPONENT SPANNING FOREST instance as follows:

  1. Pick an edge: Choose any edge {u, v} in E. If E is empty, output a trivial NO instance.
  2. Add pendant vertices: Construct G' = (V', E') where:
    • V' = V union {s, t} (two new vertices, so |V'| = n + 2)
    • E' = E union {{s, u}, {t, v}}
    • s is connected only to u; t is connected only to v (both have degree 1 in G').
  3. Set weights: All vertices receive unit weight 1.
  4. Set parameters: max_components = 1, max_weight = n + 2.

Correctness argument:

  • Forward (HC implies BCSF): If G has a Hamiltonian circuit C, remove edge {u, v} from C to obtain a Hamiltonian path P in G from u to v. Extend P to the path s-u-...-v-t in G'. This path spans all n + 2 vertices. Placing all vertices in a single component gives weight n + 2 = max_weight and 1 component = max_components. The BCSF instance is satisfied.

  • Backward (BCSF implies HC): Suppose G' admits a partition into at most 1 connected component of total weight at most n + 2. Since all n + 2 vertices have unit weight and max_weight = n + 2, every vertex must belong to the single component (otherwise some vertices would be unassigned, which is not a valid partition). Now, s has degree 1 in G' (adjacent only to u) and t has degree 1 in G' (adjacent only to v). Within this connected component, consider any spanning tree T of G'. In T, the unique path from s to t must pass through u (since s's only neighbor is u) and through v (since t's only neighbor is v). Key structural argument: If G' is connected with the pendant structure, then G must contain a path from u to v that visits all original vertices. Specifically, removing s and t from T yields a spanning tree of G; the path from u to v in T (which exists since T is connected) visits all vertices of G because T spans V'. Since {u, v} is in E(G), appending edge {u, v} closes the path into a Hamiltonian circuit of G.

    Caveat: The backward direction relies on the degree-1 pendant structure forcing the spanning path topology. In the general BCSF model (which does not require components to be paths), the single-component partition could use a non-path spanning tree. The backward direction is therefore valid only under the additional assumption that the spanning structure is a path, which holds when the model enforces path components or when the graph structure leaves no alternative.

Size Overhead

Symbols:

  • n = num_vertices of source HamiltonianCircuit
  • m = num_edges of source HamiltonianCircuit
Target metric (getter) Expression
num_vertices num_vertices + 2
num_edges num_edges + 2
max_components 1
max_weight num_vertices + 2

Derivation: Two pendant vertices s and t are added, each contributing one new edge. max_components = 1 forces a single connected component. max_weight = n + 2 because all n + 2 vertices have unit weight and must all belong to the single component.

Validation Method

  • Closed-loop test: construct a graph G known to have a Hamiltonian circuit; pick any edge {u, v}; add pendant vertices s (adjacent to u) and t (adjacent to v); reduce to BCSF with unit weights, max_components = 1, max_weight = n + 2; solve the target; verify all vertices are in one connected component; confirm removing s, t yields a Hamiltonian path from u to v in G; since {u, v} is in E(G), close to a Hamiltonian circuit.
  • Negative test: construct a graph known to have no Hamiltonian circuit (e.g., Petersen graph); verify the constructed BCSF instance is also a NO instance.
  • Pendant-degree check: verify s and t each have degree exactly 1 in G'.
  • Parameter verification: check max_components = 1 and max_weight = n + 2.

Example

Source instance (HamiltonianCircuit):
Graph G with 7 vertices {0, 1, 2, 3, 4, 5, 6} and 10 edges:

  • Edges: {0,1}, {1,2}, {2,3}, {3,4}, {4,5}, {5,6}, {6,0}, {0,3}, {1,4}, {2,5}
  • Hamiltonian circuit exists: 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 0
    • Check: {0,1}, {1,2}, {2,3}, {3,4}, {4,5}, {5,6}, {6,0} -- all edges present.

Construction:

  • Pick edge {u, v} = {6, 0} in E(G).
  • Add pendant vertex s (vertex 7) connected only to vertex 6, and pendant vertex t (vertex 8) connected only to vertex 0.
  • G' has 9 vertices {0, ..., 8} and 12 edges (original 10 plus {7, 6} and {8, 0}).
  • All weights = 1, max_components = 1, max_weight = 9.

Solution mapping:

  • Remove edge {6, 0} from the Hamiltonian circuit to get path 0-1-2-3-4-5-6 in G.
  • Extend to path 8-0-1-2-3-4-5-6-7 in G'.
  • Partition: all 9 vertices in component 0. Weight = 9 = max_weight, components = 1 = max_components.
  • Reverse: single connected component spans all vertices. Since s=7 connects only to 6 and t=8 connects only to 0, the spanning structure runs from s through G to t. Removing s, t gives a Hamiltonian path 0-1-2-3-4-5-6 in G. Since {6, 0} is in E(G), close to circuit 0-1-2-3-4-5-6-0.

References

  • [Garey and Johnson, 1979]: M. R. Garey and D. S. Johnson (1979). Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, San Francisco. Problem ND10, p. 208.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IncompleteReduction doesn't cover all source instances (Rule Check 5)PoorWrittenWrongruleA new reduction rule to be added.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    OnHold

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions