Skip to content

[Rule] MinimumVertexCover to MinimumHittingSet #200

@isPANN

Description

@isPANN

Source: MinimumVertexCover (unit-weight / cardinality variant)
Target: MinimumHittingSet
Motivation: Establishes NP-completeness of HITTING SET via polynomial-time reduction from VERTEX COVER, showing that every graph edge can be viewed as a 2-element subset to be "hit", making HITTING SET a strict generalization of VERTEX COVER.

Reference: Garey & Johnson, Computers and Intractability, Section 3.2.1, p.64

Scope

This reduction is between the unweighted (unit-weight) Vertex Cover and the cardinality Hitting Set.
The source type is MinimumVertexCover<SimpleGraph, One> (weight type One, minimising vertex count)
and the target type is MinimumHittingSet (minimising number of elements selected).

A reduction from the weighted MinimumVertexCover<SimpleGraph, i32> to MinimumHittingSet would be unsound: the target problem has no weight field, so vertex weights cannot be preserved and the optimal cardinality of the hitting set does not equal the optimal weight of the vertex cover when weights differ from 1.

Prerequisite: Add MinimumVertexCover<SimpleGraph, One> to the declare_variants! block in
src/models/graph/minimum_vertex_cover.rs. This can be done in the same PR as the rule itself.

Reduction Algorithm

(2) HITTING SET
INSTANCE: Collection C of subsets of a set S, positive integer K.
QUESTION: Does S contain a hitting set for C of size K or less, that is, a subset S' ⊆ S with |S'| <= K and such that S' contains at least one element from each subset in C?

Proof: Restrict to VC by allowing only instances having |c|=2 for all c E C.

Summary:
Given a MinimumVertexCover instance (G, k) where G = (V, E) with unit weights, construct a HittingSet instance as follows:

  1. Universe construction: The universe S = V (one element per vertex). The universe has |V| = n elements.
  2. Collection construction: For each edge {u, v} ∈ E, add the 2-element subset {u, v} to the collection C. Each edge becomes exactly one subset of size 2. The collection has |E| = m subsets.
  3. Budget parameter: Set K' = k (the target hitting-set size equals the vertex-cover budget).
  4. Solution extraction: A hitting set H ⊆ V of size ≤ k hits every subset {u, v} ∈ C if and only if H contains at least one of u, v for every edge {u, v} ∈ E — which is exactly the vertex cover condition.

Key invariant: Every vertex cover for G is a hitting set for C (and vice versa), because each subset in C corresponds to exactly one edge in G and has size 2. Because both problems use unit weights / cardinality objectives, the optimal values are equal.

Size Overhead

Symbols:

  • n = num_vertices of source graph G (getter on MinimumVertexCover<SimpleGraph, One>)
  • m = num_edges of source graph G (getter on MinimumVertexCover<SimpleGraph, One>)
Target metric (code name) Polynomial (using symbols above)
universe_size num_vertices
num_sets num_edges

Derivation:

  • Universe: one element per vertex in G → |S| = n
  • Collection: one 2-element subset per edge in G → |C| = m
  • Each subset has exactly size 2 (one per edge endpoint)
  • Budget parameter is passed through unchanged: K' = k

Validation Method

  • Closed-loop test: reduce a MinimumVertexCover<SimpleGraph, One> instance to MinimumHittingSet, solve the HittingSet with BruteForce, extract the hitting set H, verify H is a valid vertex cover on the original graph
  • Check that the minimum hitting set size equals the minimum vertex cover size on the same graph
  • Test with a graph where greedy vertex selection fails (e.g., a star K_{1,5}) to ensure optimality is required
  • Verify that adding a non-edge subset to C would break the correspondence (i.e., the restriction to 2-element edge sets is what makes the two problems equivalent)

Example

Source instance (MinimumVertexCover<SimpleGraph, One>):
Graph G with 6 vertices {0, 1, 2, 3, 4, 5} and 8 edges:

  • Edges: {0,1}, {0,2}, {1,3}, {2,3}, {2,4}, {3,5}, {4,5}, {1,4}
  • (A graph with chords — non-trivial structure requiring careful cover selection)
  • Minimum vertex cover: k = 3, for example {0, 3, 4} covers:
    • {0,1} by 0 ✓, {0,2} by 0 ✓, {1,3} by 3 ✓, {2,3} by 3 ✓
    • {2,4} by 4 ✓, {3,5} by 3 ✓, {4,5} by 4 ✓, {1,4} by 4 ✓
  • Alternative optimal: {1, 2, 5} (also size 3)
  • Suboptimal example: {1, 2, 3, 4} is a valid cover of size 4 but not minimal

Constructed target instance (MinimumHittingSet):
Universe S = {0, 1, 2, 3, 4, 5} (same 6 vertices)
Collection C (one 2-element subset per edge):

  • {0, 1}, {0, 2}, {1, 3}, {2, 3}, {2, 4}, {3, 5}, {4, 5}, {1, 4}

Budget K' = 3

Solution mapping:

  • Minimum hitting set: H = {0, 3, 4}
  • Verification against each subset in C:
    • {0,1}: 0 ∈ H ✓
    • {0,2}: 0 ∈ H ✓
    • {1,3}: 3 ∈ H ✓
    • {2,3}: 3 ∈ H ✓
    • {2,4}: 4 ∈ H ✓
    • {3,5}: 3 ∈ H ✓
    • {4,5}: 4 ∈ H ✓
    • {1,4}: 4 ∈ H ✓
  • All 8 subsets are hit, |H| = 3 = K' ✓
  • Extracted vertex cover in G: {0, 3, 4} — same as hitting set ✓

Round-trip verification (brute-force):

  • Total configurations: 2⁶ = 64
  • Feasible vertex covers: 16
  • Optimal (size 3): 2 solutions — {0,3,4} and {1,2,5}
  • Suboptimal feasible: 14 (sizes 4, 5, 6)

Greedy trap: Vertices 1, 2, 3, 4 each have degree 3 while vertices 0 and 5 have degree 2. A greedy algorithm picking highest-degree vertices might select {1, 2, 3} which misses edge {4,5}. The optimal solution {0, 3, 4} includes the low-degree vertex 0, demonstrating that degree-greedy is not optimal.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions