Greedy Cardinality-Constrained Submodular Maximization #
This module formalizes the Nemhauser–Wolsey–Fisher greedy algorithm for maximizing a monotone
submodular set function f : Finset α → β over a finite ground list xs : List α subject to a
cardinality constraint |S| ≤ k ([NWF78], Section 4, Theorem 4.2), together
with its exact 1 - (1 - 1/k)^k tightness family for every budget k ≥ 1
([NW78], Section 3; [NWF78], Section 4, Theorem 4.1(c) and
Theorem 4.2, pp. 280–283).
Algorithm design #
- First-occurrence deduplication
xs.eraseDups(coreList.eraseDups) produces the ordered listuof distinct ground elements once upfront (u.length = xs.toFinset.card). - Each greedy round filters
uto candidatesc ∉ S. If none remain,Sis returned unchanged with zero oracle evaluations. Otherwise, maximizingmarginalGain f S c = f (insert c S) - f Sfor fixedSis equivalent to maximizingf (insert c S), so the algorithm needs only[DecidableEq α] [LinearOrder β](no subtraction in the algorithm itself) and breaks ties in favor of earlier candidates (bestVal < v). - Monadic (
submodularGreedyM) and pure (submodularGreedy) presentations are connected by@[simp]pure/Id.runlemmas and@[grind .] IsMonadHomnaturality bridges so the same correctness and approximation theorems transfer directly to theFreeM (ValueQuery α β)query tree.
Main definitions #
Cslib.Algorithms.Lean.Submodular.submodularGreedyM,Cslib.Algorithms.Lean.Submodular.submodularGreedy: monadic and purek-step greedy algorithms.Cslib.Algorithms.Lean.Submodular.tightCandidates,Cslib.Algorithms.Lean.Submodular.tightObjective,Cslib.Algorithms.Lean.Submodular.tightOpt: the2k-element witness family showing exact tightness of1 - (1 - 1/k)^k.
Main results #
submodularGreedy_subset_toFinset,card_submodularGreedy_eq_min,card_submodularGreedy_le: feasibility and exact output cardinalitymin k xs.toFinset.card.one_sub_pow_mul_le_submodularGreedy_steps,one_sub_pow_mul_le_submodularGreedy:(1 - (1 - 1 / (k : β)) ^ m) * f OPT ≤ f (submodularGreedy f xs m)over any[Field β] [LinearOrder β] [IsStrictOrderedRing β](ℚ,ℝ, …).one_sub_exp_neg_div_mul_le_submodularGreedy,one_sub_exp_neg_one_mul_le_submodularGreedy:(1 - Real.exp (-1)) * f OPT ≤ f (submodularGreedy f xs k)overℝfor everyk : ℕ.submodularGreedy_tightObjective_eq,exists_tight_submodularGreedy: for everyk ≥ 1, there exists a nonnegative monotone submodular objective on2kelements withf ∅ = 0,f OPT = 1(|OPT| = k), andf (submodularGreedy f xs k) = 1 - (1 - 1 / (k : β)) ^ k.
References #
Monadic and pure greedy algorithm #
Pure left-to-right scan selecting the first candidate achieving the maximum of
f (insert c S).
One pure greedy round over distinct ground list u: inserts the remaining element c ∉ S
maximizing f (insert c S) (breaking ties toward earlier elements of u), or returns S if no
candidate remains.
Tail-recursive k-step pure greedy loop over deduplicated ground list u.
Pure k-step Nemhauser–Wolsey–Fisher greedy algorithm on ground list xs.
Monadic left-to-right scan evaluating evalSet (insert c S) once per candidate in cs.
One monadic greedy round over deduplicated ground list u.
Monadic k-step greedy loop over deduplicated ground list u.
Monadic k-step Nemhauser–Wolsey–Fisher greedy algorithm with value-oracle callback
evalSet : Finset α → m β.
Scan invariants, feasibility, and exact output cardinality #
Nemhauser–Wolsey–Fisher (1 - 1/e) approximation guarantee #
Single-step residual contraction ([NWF78], Section 4): for any set OPT of
at most k ≥ 1 elements drawn from u, one greedy step shrinks f OPT - f S by at least a factor
of 1 - 1 / (k : β).
Residual gap bound after m greedy steps against any cardinality-k benchmark OPT (k ≥ 1):
f OPT - f (submodularGreedy f xs m) ≤ (1 - 1 / (k : β)) ^ m * (f OPT - f ∅).
Nemhauser–Wolsey–Fisher m-Step Approximation Guarantee ([NWF78],
Section 4, Theorem 4.2): for monotone submodular f with 0 ≤ f ∅, running m greedy steps
achieves at least 1 - (1 - 1 / (k : β)) ^ m of any subset OPT ⊆ xs.toFinset with
OPT.card ≤ k (0 < k).
Nemhauser–Wolsey–Fisher Exact Algebraic Bound ([NWF78], Theorem 4.2):
after k ≥ 1 greedy steps, (1 - (1 - 1 / (k : β)) ^ k) * f OPT ≤ f (submodularGreedy f xs k)
for every OPT ⊆ xs.toFinset with OPT.card ≤ k.
Real m-step exponential approximation bound: running m greedy steps achieves at least
(1 - Real.exp (-(m : ℝ) / (k : ℝ))) * f OPT against any OPT ⊆ xs.toFinset with
OPT.card ≤ k (0 < k).
Nemhauser–Wolsey–Fisher (1 - 1/e) Theorem ([NWF78], Section 4,
Theorem 4.2): for every nonnegative monotone submodular function f : Finset α → ℝ (0 ≤ f ∅),
ground list xs : List α, budget k : ℕ, and feasible set OPT ⊆ xs.toFinset with
OPT.card ≤ k,
(1 - Real.exp (-1)) * f OPT ≤ f (submodularGreedy f xs k).
Exact 1 - (1 - 1/k)^k tightness family for every k ≥ 1 #
Tight monotone submodular objective ∑ j : Fin k, tightComponent k j S on Fin k ⊕ Fin k
([NW78], Section 3; [NWF78], Section 4, Theorem 4.1(c) and
Theorem 4.2, pp. 280–283).
At each step t < k from {Sum.inl 0, …, Sum.inl (t - 1)}, every remaining Sum.inl i and
Sum.inr j has the exact same marginal gain (1 / k) * (1 - 1 / k) ^ t; ordering Sum.inl
before Sum.inr in tightCandidates k lets submodularGreedy's deterministic left-to-right
tie-breaking attain 1 - (1 - 1 / k) ^ k exactly without an ε > 0 perturbation.
Exact Tightness of 1 - (1 - 1/k)^k ([NW78], Section 3;
[NWF78], Section 4, Theorem 4.1(c) and Theorem 4.2, pp. 280–283): for every
budget k ≥ 1, running submodularGreedy on tightObjective k and tightCandidates k (under
left-to-right tie-breaking across tied marginal gains (1 / k) * (1 - 1 / k) ^ t) returns a set
of exact value 1 - (1 - 1 / (k : β)) ^ k, whereas tightOpt k has cardinality k and value
1.
Existential summary: for every k ≥ 1, no constant strictly larger than 1 - (1 - 1/k)^k
can lower-bound the approximation ratio of submodularGreedy on 2k-element nonnegative monotone
submodular instances.