Set Cover #
Finite set systems (Cslib.Complexity.SetSystem) and weighted set systems
(Cslib.Complexity.WeightedSetSystem) over natural-number elements, encoded with binary
element labels and frame delimiters (encSetSystem, encWeightedSetSystem).
An unweighted instance (S, k) belongs to Cslib.Complexity.SetCover when at most k sets from
S.sets (selected by index Fin S.sets.length) cover every element of S.ground. A weighted
instance (W, k) belongs to Cslib.Complexity.WeightedSetCover when a covering selection of sets
has total weight at most k. Both problems lie in NP (SetCover_mem_NP,
WeightedSetCover_mem_NP) via subset witnesses (Cslib.Complexity.mem_NP_of_subsetWitness), and
connect directly to the library's greedy algorithm (Cslib.Algorithms.Lean.SetCover.greedy).
This set-system encoding is designed to be shared with related problems (HittingSet and
Karp's set-system problems).
Main definitions #
Cslib.Complexity.SetSystem,Cslib.Complexity.encSetSystem: finite set systems and their binary-labeled encoding.Cslib.Complexity.SetSystem.IsCover,Cslib.Complexity.SetSystem.optCoverSize: covering predicates and minimum cover cardinality on coverable set systems.Cslib.Complexity.SetCover,Cslib.Complexity.encSetCover: the unweighted Set Cover decision problem and its encoding.Cslib.Complexity.WeightedSet,Cslib.Complexity.WeightedSetSystem,Cslib.Complexity.encWeightedSetSystem,Cslib.Complexity.WeightedSetCover: weighted set systems, minimum cover weight (optCoverWeight), and the weighted Set Cover decision problem.
Main results #
Cslib.Complexity.SetCover_mem_NP,Cslib.Complexity.WeightedSetCover_mem_NP: membership inNP.Cslib.Complexity.SetSystem.greedyIndices_isCover,Cslib.Complexity.SetSystem.greedyIndices_length_le_one_add_log,Cslib.Complexity.WeightedSetSystem.greedyIndices_isCover,Cslib.Complexity.WeightedSetSystem.greedyWeight_le_one_add_log: bridge to the greedy algorithm.
Unweighted set systems #
A finite set system over natural-number elements: a ground list ground together with a list
of candidate subsets sets. Duplicates in ground or a candidate set are harmless, while distinct
indices in S.sets are kept distinct.
Elements of the ground set that must be covered.
Candidate subsets available for covering
ground.
Instances For
A set system is coverable when some finite index selection covers its ground set.
Boolean test for whether every element of S.ground appears in at least one candidate set.
The minimum number of sets needed to cover S when S.Coverable holds (and 0 otherwise).
Indices chosen by Cslib.Algorithms.Lean.SetCover.greedy on S with unit weights.
Unweighted Set Cover is in NP via subset witnesses over List.range S.sets.length.
Weighted set systems #
Framed encoding of a WeightedSet with binary elements and binary weight.
The tuple of the fields of encWeightedSet.
A finite weighted set system over natural-number elements.
Elements of the ground set that must be covered.
- sets : List WeightedSet
Weighted candidate subsets available for covering
ground.
Instances For
The tuple of the fields of encWeightedSetSystem.
Framed encoding of a WeightedSetSystem.
Framed pair of a WeightedSetSystem and a binary target weight bound k.
Forget the weights of a WeightedSetSystem to obtain an unweighted SetSystem.
A selection of indices C covers W when every element of W.ground belongs to
W.sets[i].elements for some i ∈ C.
A weighted set system is coverable when some finite index selection covers its ground set.
Total weight of a selection C of sets in W.
Boolean test for whether W is coverable.
Minimum weight of a cover of W when W.Coverable holds (and 0 otherwise).
Indices chosen by Cslib.Algorithms.Lean.SetCover.greedy on W.
Weighted Set Cover: pairs (W, k) admitting a cover of W.ground of total weight at
most k.
Weighted Set Cover is in NP via subset witnesses over List.range W.sets.length.