Luby's randomized maximal independent set algorithm #
Luby's algorithm [Lub86] finds a maximal independent set of a graph in phases; Alon, Babai and Itai [ABI86] gave a closely related randomized parallel algorithm at the same time. This module formalizes the random-priority variant of Métivier, Robson, Saheb-Djahromi and Zemmari [MRSDZ11], in the form of Algorithm 7.12 ("Fast MIS 2") of [Wat16]. In each phase:
- every live vertex draws a random priority;
- every live vertex whose priority is below those of all its live neighbours joins the set;
- the joined vertices and their neighbours stop being live.
The algorithm is a ProbComp program. phase draws a uniform ranking of the vertices (a uniform
random permutation, ProbComp.uniform (Ranking V)) and takes the deterministic step. run k
iterates phase k times from init, where nothing is chosen and every vertex is live
(OracleComp.iterate), and lubyMIS k answers the chosen set. All probability statements are
about the law ProbComp.eval.
Source conventions #
- Priorities. The source draws an independent real
r(v) ∈ [0, 1]for every vertex. Here every phase draws one uniform rankingσ : V ≃ Fin (card V)and compares ranks. Restricted to the live vertices, a uniform ranking orders them uniformly at random, which is the law of the order of independent continuous priorities (ties have probability zero there). This equivalence is not formalized; the analysis below is carried out for the ranking directly. - Model. This is a centralized simulation of the synchronous phases. It formalizes the state transition of a phase, not a LOCAL message-passing algorithm: messages, the rounds inside a phase and per-vertex views are not modelled.
- Running time. The source proves that one phase removes at least half the live edges in
expectation ([Wat16], Lemma 7.14), derives an expected bound of
3 log_{4/3} m + 1phases (Theorem 7.15) and anO(log n)bound with high probability by a Chernoff argument (Corollary 7.18). Here the edge-removal lemma is formalized, and the high probability bound is proved instead by iterating it and applying Markov's inequality to the number of live edges:O(log n)phases with explicit constants, failure at mostn ^ (-c)after(c + 2) ⌈log₂ n⌉ + 1phases. The expected number of phases (Theorem 7.15) is not formalized. - Luby's original algorithm, in the form of Algorithm 7.6 ("Fast MIS") of [Wat16]
(each vertex marks itself with probability
1 / (2 d(v))and joins unless a marked neighbour has higher degree), its pairwise-independent analysis and its derandomization are not formalized.
Main definitions #
Cslib.Algorithms.Lean.LubyMIS.State: the chosen vertices and the live vertices.Cslib.Algorithms.Lean.LubyMIS.liveGraph,liveEdges: the graph on the live vertices and its number of edges.Cslib.Algorithms.Lean.LubyMIS.Ranking: rankings of the vertices.Cslib.Algorithms.Lean.LubyMIS.joiners,step: the vertices that join under a ranking, and the resulting state.Cslib.Algorithms.Lean.LubyMIS.phase,run,lubyMIS: one phase,kphases, and the chosen set afterkphases.Cslib.Algorithms.Lean.LubyMIS.Invariant: the invariant of the chosen and live sets.
Main results #
isIndepSet_of_mem_support_lubyMIS: after any number of phases, every possible output is an independent set.Invariant.maximal_iff,maximal_of_mem_support_lubyMIS: the chosen set is maximal exactly when no vertex is live, which holds for every outcome afterk ≥ card Vphases.two_mul_expect_liveEdges_phase_le: one phase keeps at most half the live edges in expectation ([Wat16], Lemma 7.14), from the counting formtwo_mul_sum_liveEdges_step_le.two_pow_mul_expect_liveEdges_run_le: afterkphases, at most|E| / 2 ^ klive edges remain in expectation.two_pow_mul_toOuterMeasure_live_nonempty_le: afterk + 1phases, the algorithm is still running with probability at most|E| / 2 ^ k.toOuterMeasure_not_maximal_lubyMIS_le,one_sub_le_toOuterMeasure_maximal_lubyMIS: if|E| ≤ 2 ^ m, then afterm + t + 1phases the output is a maximal independent set with probability at least1 - 2 ^ (-t);_clogand_cardinstantiatemwith⌈log₂ |E|⌉and2 ⌈log₂ n⌉.toOuterMeasure_not_maximal_lubyMIS_le_inv_pow: after(c + 2) ⌈log₂ n⌉ + 1phases, the output fails to be maximal with probability at mostn ^ (-c).
References #
The live graph: the edges of G between live vertices, on the whole vertex type. It is
(G.induce L).spanningCoe (liveGraph_eq_spanningCoe_induce), stated directly so that its
adjacency is decidable and unfolds by Iff.rfl.
The live graph is the induced subgraph on the live vertices, viewed on all of V.
The number of live edges: edges of G with both endpoints live.
A ranking: a bijection of the vertices with {0, …, n - 1}. A uniform ranking is a uniform
random permutation of the vertices.
Instances For
The live vertices that rank below all their live neighbours.
One phase with ranking σ: the joiners are chosen, and they and their neighbours stop being
live.
One phase of Luby's algorithm: draw a uniform ranking and take the step.
The initial state: nothing chosen, every vertex live.
k phases of Luby's algorithm from the initial state.
The set chosen by k phases of Luby's algorithm.
The law of lubyMIS: pushing run G k forward along State.chosen.
The law of one phase: the step under a uniform ranking.
Correctness #
The invariant of Luby's algorithm.
- isIndepSet : G.IsIndepSet ↑s.chosen
The chosen vertices are independent.
A live vertex is neither chosen nor adjacent to a chosen vertex.
A vertex that is not live is chosen or adjacent to a chosen vertex.
A phase preserves the invariant, whatever the ranking.
A chosen set satisfying the invariant is maximal exactly when no vertex is live.
Every possible state after any number of phases satisfies the invariant.
Each phase with a live vertex removes at least one live vertex: the live vertex of least rank joins.
Las Vegas correctness. After k ≥ card V phases, every possible output is a maximal
independent set.
Independence. After any number of phases, every possible output is an independent set.
Random rankings #
In a uniform ranking, each vertex of a nonempty set S is the least of S with probability
1 / |S|: exactly (card V)! / |S| rankings put u first among S.
Progress #
Edge removal ([Wat16], Lemma 7.14), counting form: summed over all rankings, a phase keeps at most half of the live edges.
Edge removal ([Wat16], Lemma 7.14): one phase of Luby's algorithm keeps at most half of the live edges in expectation.
Round bounds #
After k phases the expected number of live edges is at most |E| / 2 ^ k.
With no live edge left, the next phase makes every live vertex join, and none stays live.
Round bound. After k + 1 phases, some vertex is still live with probability at most
|E| / 2 ^ k (Markov's inequality for the live edges after k phases).
High-probability round bound. If |E| ≤ 2 ^ m, then after m + t + 1 phases the chosen
set fails to be a maximal independent set with probability at most 2 ^ (-t).
The success form: if |E| ≤ 2 ^ m, then after m + t + 1 phases the output is a maximal
independent set with probability at least 1 - 2 ^ (-t).
The success form with m = ⌈log₂ |E|⌉: ⌈log₂ |E|⌉ + t + 1 phases suffice.
A graph on n vertices has at most 2 ^ (2 ⌈log₂ n⌉) edges.
The success form in terms of the number n of vertices: 2 ⌈log₂ n⌉ + t + 1 phases
suffice.
With high probability. After (c + 2) ⌈log₂ n⌉ + 1 phases, the output fails to be a
maximal independent set with probability at most n ^ (-c).