Repository navigation
Description
Source
MinimumHittingSet
Target
MinimumSetCovering/i32
Motivation
This direct incidence-transpose reduction connects two fundamental covering problems that currently have no path between them in the reduction graph. It preserves the complete source domain, including empty families, empty member sets, repeated sets, and elements that occur in no set.
Reference
Garey, M. R. and Johnson, D. S. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman, 1979, Appendix A (Hitting Set and Set Covering definitions). The direction below is derived directly from those definitions rather than attributed to a theorem not stated in the book.
Reduction Algorithm
Let the source instance have universe U = {0,...,n-1} and family C = (C_0,...,C_{m-1}).
- Create target universe
U' = {0,...,m-1}, with one target element for each source set. - For every source element
u in U, create a target setD_u = {j in U' : u in C_j}. - Give every
D_uweight 1. - A target configuration selecting
D_umaps back to the source configuration selectingu; the configuration vectors therefore have the same lengthn.
A selected family {D_u : u in H} covers target element j exactly when H intersects C_j. Thus feasible configurations correspond bijectively and have equal cardinality/objective value.
Corner cases are preserved: an empty source set becomes an uncovered target element, while a source element occurring nowhere becomes an empty target set.
Size Overhead
| Target metric | Formula |
|---|---|
universe_size |
num_sets |
num_sets |
universe_size |
Validation Method
- Exhaustively enumerate all source and target configurations and compare optimal values.
- Include empty sets, repeated sets, unused universe elements, and infeasible instances.
- A temporary Python checker exhaustively validated the canonical example and generated small set systems.
Example
- Source instance:
U={0,1,2,3,4}andC=[{0,1},{1,2,3},{0,3},{2,4}]. - Construction:
U'={0,1,2,3}andD_0={0,2},D_1={0,1},D_2={1,3},D_3={1,2},D_4={3},
all with weight 1.
- Target instance: Minimum Set Covering on these five sets.
- Round trip: source hitting set
{0,2}hits all four source sets. The corresponding target choice{D_0,D_2}covers{0,1,2,3}. Exhaustive enumeration confirms optimum 2; many singleton and suboptimal feasible configurations distinguish incorrect incidence mappings.
BibTeX
@book{GareyJohnson1979,
author = {Garey, Michael R. and Johnson, David S.},
title = {Computers and Intractability: A Guide to the Theory of NP-Completeness},
publisher = {W. H. Freeman},
year = {1979},
isbn = {978-0-7167-1045-5}
}Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsOnHold
Activity
isPANN commentedon Aug 1, 2026
Issue Quality Check — Rule
pred path MinimumHittingSet MinimumSetCovering --jsonreports no path, so this adds a missing connection.MinimumSetCovering/i32cannot preserve the fullusize-cardinality source domain because its objective sum can overflow.Overall: 4 passed, 1 failed, 0 warnings
Usefulness
Both endpoints resolve in the current registry:
MinimumHittingSethas size fieldsnum_setsanduniverse_size.MinimumSetCovering {weight: "i32"}has size fieldsnum_setsanduniverse_size.pred path MinimumHittingSet MinimumSetCovering --jsonreturns no reduction path. A redundancy analysis is therefore unnecessary under the check procedure. The motivation identifies the concrete missing graph connection between two fundamental covering formulations.Non-trivial
For source incidence relation
u ∈ C_j, the issue constructs the dual set system with target elementjand target setD_u = {j : u ∈ C_j}. This transposes anm × nincidence relation into ann-set cover overmtarget elements and defines an explicit solution map. It is a genuine structural transformation.Correctness
Reference verification:
[SP5] MINIMUM COVERand[SP8] HITTING SET. The entries define the same unrestricted finite-set-family incidence semantics used by the issue. The repository bibliography also contains this book asgarey1979.N_efor each source element, over the source-set vertices, and states that an optimal target cover maps to an optimal hitting set (solution, Problem 1).(T, P*), where each source pointpcreates the set of ranges containing it, and states that a hitting set of the primal is a set cover of the dual (Definition 1.16, Section 1.3).Direct proof check: for every selection vector
x ∈ {0,1}^nand target elementj,jis covered iff some selectedD_ucontainsj, iff some selectedulies inC_j, iff the corresponding source selection hitsC_j. Because each selected source element corresponds to one unit-weight target set, the intended cardinalities agree whenever the target numeric sum is representable.No better-overhead construction was found: materializing the dual incidence relation is the standard direct construction, with exactly
mtarget universe elements andntarget sets.Completeness
Literature scope: Garey–Johnson's
[SP5]and[SP8]entries use arbitrary collections of subsets of finite sets; neither definition assumes connectedness, nonempty members, distinct members, or that every universe element occurs. The independent dual-set-system construction likewise imposes no structural precondition on the incidence relation.Codebase scope:
MinimumHittingSet::newacceptsuniverse_size = 0, an empty outer family, empty member sets, repeated outer sets, and unused universe elements. It only rejects member indices outside0..universe_size; it sorts/deduplicates elements within each member set.minimumhittingset_ilp.rsandminimumvertexcover_minimumhittingset.rspreserve the same 1:1 source-variable interpretation and do not impose an additional source restriction.MinimumSetCovering<i32>::evaluateaccumulates selected unit weights in ani32sum.Hand traces beyond the worked example:
U={0,1,2}andC=[]. The construction produces target universeU'=∅and three empty target sets. The empty target selection is feasible with value 0 and maps to the empty hitting set, which vacuously hits every source member. Unused source elements remain harmless empty target sets.U={0,1}andC=[∅,{0}]. The construction producesU'={0,1},D_0={1}, andD_1=∅. Target element 0 cannot be covered, so the target is infeasible; the source is also infeasible because no selection can hit the empty member.The failure is the claimed complete source domain with the fixed
i32target variant.MinimumHittingSetmeasures cardinality inusize, whileMinimumSetCovering/i32sums unit weights ini32. For example, the source model can representuniverse_size = 2^31with an empty family. Its dual has2^31empty target sets. Since the target universe is empty, selecting all those sets is a feasible target configuration, but adding2^31uniti32weights overflows (panic with overflow checks; wrapped value otherwise). Thus the target objective is not a valid cardinality-preserving image for every legitimate source configuration, and a solver can no longer rely on the claimed equal objective/order.This must be resolved by using a target weight/sum type that represents the full source cardinality domain, or by exposing a genuine source restriction supported by the codebase. The current issue may not claim full-domain preservation with
MinimumSetCovering/i32.Well-written
All required template sections are substantive. Symbols
U,n,C,m,U', andD_uare defined before use. The overhead names match the target's actualsize_fields, and the exact counts are correct: targetuniverse_size = num_setsand targetnum_sets = universe_size. The extraction map is explicit. The five-element/four-member example is non-degenerate and contains feasible selections of different cardinalities, so it can support a meaningful closed-loop test.Recommendations
MinimumHittingSet::Value = Min<usize>.isPANN commentedon Aug 1, 2026
Rule Fix -- Failed
Checklist results:
MinimumHittingSetinstance to aMinimumSetCoveringinstance by transposing the incidence relation.universe_sizelength and the identity map is explicit.num_setsuniverse elements anduniverse_sizesets.Min<usize>, whileMinimumSetCovering/i32has valueMin<i32>; the target cannot represent all source cardinalities.i32weights overflows instead of preserving theusizeoptimum.Literature findings:
N_efor each source element, over the source-set vertices, and map an optimal cover back to the corresponding hitting set: https://www.cse.cuhk.edu.hk/~taoyf/course/3160/24-fall/ex/ex13-sol.pdf(T, P*)with one dual set for each primal point and state that a primal hitting set is a dual set cover: https://pure.mpg.de/rest/items/item_2169875_4/component/file_2169879/contenti32, whereas the source cardinality isusize.Failing instance:
universe_size = 2,147,483,648and the singleton familyC = ({u} : 0 <= u < universe_size).2,147,483,648.MinimumSetCovering/i32cannot represent that objective; evaluation overflows (panic with overflow checks, wrapping otherwise).Smoke test:
Attempts: No rewrite attempt was made. The
fix-rule-issueworkflow classifies type incompatibility as outside the fixable issue-body scope. Manual intervention is required: first provide an existingMinimumSetCoveringvariant whose accumulated objective represents the fullusizecardinality domain, then retarget this rule to that variant.isPANN commentedon Nov 3, 2026
Please kindly check the following items (PR #1232):
predcommandsJoin the discussion on Zulip — feel free to ask questions or leave feedback there.