The weighted independent-set approximation algorithm
Lax263307.WeightedAlgorithm · concepts/Lax263307/WeightedAlgorithm.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
Clip negative weights, round the remaining weights to copy multiplicities, and run the unweighted algorithm on the independent blow-up. Project the answer back to the original vertices and discard nonpositive-weight vertices. Empty and nonpositive instances return the empty set.
Concept map
Lean source view on GitHub
| 1 | import Lax263307.RecursiveAlgorithm |
| 2 | import Lax263307.BlowUpBagBounds |
| 3 | import Lax263307.PositiveWeights |
| 4 | import Lax263307.WeightedProjection |
| 5 | import Mathlib.Algebra.BigOperators.Fin |
| 6 | |
| 7 | /-! |
| 8 | --- |
| 9 | title: The weighted independent-set approximation algorithm |
| 10 | type: definition |
| 11 | --- |
| 12 | Clip negative weights, round the remaining weights to copy multiplicities, |
| 13 | and run the unweighted algorithm on the independent blow-up. Project the |
| 14 | answer back to the original vertices and discard nonpositive-weight |
| 15 | vertices. Empty and nonpositive instances return the empty set. |
| 16 | |
| 17 | # Formalization notes |
| 18 | |
| 19 | The function takes fixed LP and flow solvers as arguments. Blow-up vertices |
| 20 | are numbered by the finite-sigma equivalence. The complete correctness, |
| 21 | RAM execution, and running-time guarantees are supplied by the proof of |
| 22 | the main QPTAS theorem. |
| 23 | -/ |
| 24 | |
| 25 | namespace Lax263307.WeightedAlgorithm |
| 26 | |
| 27 | open RecursiveAlgorithm (independentSet) |
| 28 | open WeightRounding IndependentBlowUp PositiveWeights |
| 29 | |
| 30 | def labeling {n : ℕ} (copies : Fin n → ℕ) : Fin (∑ v, copies v) ≃ Vertex copies := |
| 31 | finSigmaFinEquiv.symm |
| 32 | |
| 33 | def numbered {n : ℕ} (G : SimpleGraph (Fin n)) (copies : Fin n → ℕ) : |
| 34 | SimpleGraph (Fin (∑ v, copies v)) := (graph G copies).comap (labeling copies) |
| 35 | |
| 36 | instance {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (copies : Fin n → ℕ) : |
| 37 | DecidableRel (numbered G copies).Adj := fun _ _ => inferInstanceAs (Decidable (G.Adj _ _)) |
| 38 | |
| 39 | def solve {n : ℕ} (lp flow : List ℕ → List ℕ) (a K B : ℕ) |
| 40 | (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (w : Fin n → ℚ) (ε : ℚ) : Finset (Fin n) := |
| 41 | let w' := positiveWeights w |
| 42 | if n = 0 ∨ maximumWeight w' ≤ 0 then ∅ |
| 43 | else |
| 44 | let copies' := copies w' ε |
| 45 | let I := independentSet lp flow a K B (numbered G copies') (ε/2) |
| 46 | discardNonpositive w (project (I.image (labeling copies'))) |
| 47 | |
| 48 | end Lax263307.WeightedAlgorithm |
| 49 |
Formalization notes
The function takes fixed LP and flow solvers as arguments. Blow-up vertices are numbered by the finite-sigma equivalence. The complete correctness, RAM execution, and running-time guarantees are supplied by the proof of the main QPTAS theorem.
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments