The recursive unweighted approximation algorithm
Lax263307.RecursiveAlgorithm · concepts/Lax263307/RecursiveAlgorithm.lean · lax-263307
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
The algorithm uses exhaustive search for small targets and projected round-or-cut search for larger targets. Recursive calls work on canonically labeled balanced parts. A descending target search selects the final set.
Concept map
Lean source view on GitHub
| 1 | import Lax263307.ProjectedOracle |
| 2 | import Lax263307.ExhaustiveTargets |
| 3 | import Lax263307.RecursionDepth |
| 4 | import Lax263307.TargetSearch |
| 5 | |
| 6 | /-! |
| 7 | --- |
| 8 | title: The recursive unweighted approximation algorithm |
| 9 | type: definition |
| 10 | --- |
| 11 | The algorithm uses exhaustive search for small targets and projected |
| 12 | round-or-cut search for larger targets. Recursive calls work on canonically |
| 13 | labeled balanced parts. A descending target search selects the final set. |
| 14 | |
| 15 | # Formalization notes |
| 16 | |
| 17 | The fuel parameter bounds recursion depth. `Correct` records the size |
| 18 | guarantee for a returned independent set and the upper bound certified by |
| 19 | failure. The accuracy denominator is |
| 20 | . |
| 21 | -/ |
| 22 | |
| 23 | namespace Lax263307.RecursiveAlgorithm |
| 24 | |
| 25 | open ExhaustiveTargets (findIndependentSet) |
| 26 | open RecursionDepth (depth) |
| 27 | open ComputedSeparators AlgorithmParameters |
| 28 | |
| 29 | def attempt (lp flow : List ℕ → List ℕ) (a K B D : ℕ) (fuel : ℕ) |
| 30 | {n : ℕ} (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (k : ℕ) : Option (Finset (Fin n)) := |
| 31 | if k ≤ cutoff a K B n D ∨ n ≤ 1 then findIndependentSet G k |
| 32 | else if n < k then none |
| 33 | else match fuel with |
| 34 | | 0 => none |
| 35 | | fuel + 1 => ProjectedOracle.search lp flow a K B D G k |
| 36 | (fun C t => (attempt lp flow a K B D fuel (restriction G C) t).map |
| 37 | (fun I => I.image (label C))) |
| 38 | termination_by fuel |
| 39 | |
| 40 | def solve {n : ℕ} (lp flow : List ℕ → List ℕ) (a K B D : ℕ) |
| 41 | (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] : Finset (Fin n) × ℕ := |
| 42 | TargetSearch.search (attempt lp flow a K B D (depth n) G) n |
| 43 | |
| 44 | def Correct {n : ℕ} (G : SimpleGraph (Fin n)) (k fuel D : ℕ) : Option (Finset (Fin n)) → Prop |
| 45 | | some I => G.IsIndepSet (I : Set (Fin n)) ∧ (1 - 4*(1/(D:ℝ)))^fuel * (k:ℝ) ≤ I.card |
| 46 | | none => ∀ J : Finset (Fin n), G.IsIndepSet (J : Set (Fin n)) → J.card < k |
| 47 | |
| 48 | def accuracyDenominator (n : ℕ) (ε : ℚ) : ℕ := |
| 49 | 4 * (depth n + 1) * ⌈ε⁻¹⌉₊ |
| 50 | |
| 51 | def independentSet {n : ℕ} (lp flow : List ℕ → List ℕ) (a K B : ℕ) |
| 52 | (G : SimpleGraph (Fin n)) [DecidableRel G.Adj] (ε : ℚ) : Finset (Fin n) := |
| 53 | (solve lp flow a K B (accuracyDenominator n ε) G).1 |
| 54 | |
| 55 | end Lax263307.RecursiveAlgorithm |
| 56 |
Formalization notes
The fuel parameter bounds recursion depth. records the size guarantee for a returned independent set and the upper bound certified by failure. The accuracy denominator is .
Builds on
Used by
From Mathlib
none
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments