Documentation

CslibFrontier.Computability.Distributed.OrientedCycle.MIS

Maximal independent sets on oriented cycles #

A maximal independent set (MIS) of the oriented n-cycle is computed by deterministic LOCAL algorithms in Θ(log* n) rounds, like a 3-colouring, and the two problems reduce to each other in a constant number of rounds.

IsMIS is the local description used by algorithms. For n ≠ 1 it agrees with Mathlib's maximal independent sets of OrientedCycle.graph n (isMIS_iff_maximal). On the one-node cycle the only node is its own neighbour, and no set is an IsMIS.

Main definitions #

Main results #

References #

Maximal independent sets #

s marks a maximal independent set of the oriented n-cycle: no node and its successor are both marked, and every node is marked or has a marked neighbour.

Instances For
    theorem Cslib.Distributed.OrientedCycle.isIndepSet_graph_iff {n : ℕ} (hn : n ≠ 1) {s : ZMod n → Bool} :
    (graph n).IsIndepSet {v : ZMod n | s v = true} ↔ ∀ (v : ZMod n), s v = true → s (v + 1) = false

    For n ≠ 1, IsMIS is Mathlib's notion of a maximal independent set of graph n.

    After t rounds, A marks a maximal independent set of every oriented n-cycle whose nodes carry distinct identifiers from {0, …, n - 1}. Like Algorithm.ColorsCycle, this is vacuous for n = 0; misOfColoring_run covers the infinite oriented path.

    From a colouring to a maximal independent set #

    Greedy colour classes. A node of colour 0 joins at once; in round r + 1 a node of colour r + 1 joins unless a neighbour has joined. The state is the colour and whether the node has joined; the output is whether it has joined.

    @[simp]
    theorem Cslib.Distributed.OrientedCycle.misOfColoring.state_fst {n : ℕ} (x : ZMod n → ℕ) (r : ℕ) (v : ZMod n) :
    (misOfColoring.state x r v).1 = x v
    theorem Cslib.Distributed.OrientedCycle.misOfColoring.state_snd_succ {n : ℕ} (x : ZMod n → ℕ) (r : ℕ) (v : ZMod n) :
    (misOfColoring.state x (r + 1) v).2 = ((misOfColoring.state x r v).2 || decide (x v = r + 1) && !(misOfColoring.state x r (v - 1)).2 && !(misOfColoring.state x r (v + 1)).2)
    theorem Cslib.Distributed.OrientedCycle.misOfColoring.invariant {n : ℕ} {x : ZMod n → ℕ} (hx : IsProperColoring x) (r : ℕ) :
    (∀ (v : ZMod n), (misOfColoring.state x r v).2 = true → x v ≤ r) ∧ (∀ (v : ZMod n), x v ≤ r → (misOfColoring.state x r v).2 = true ∨ (misOfColoring.state x r (v - 1)).2 = true ∨ (misOfColoring.state x r (v + 1)).2 = true) ∧ ∀ (v : ZMod n), (misOfColoring.state x r v).2 = true → (misOfColoring.state x r (v + 1)).2 = false

    The invariant after r rounds: joined nodes have colour at most r, every node of colour at most r has joined or has a joined neighbour, and no two neighbours have joined.

    theorem Cslib.Distributed.OrientedCycle.misOfColoring_run {n k : ℕ} {x : ZMod n → ℕ} (hx : IsProperColoring x) (hk : ∀ (v : ZMod n), x v < k) {r : ℕ} (hr : k - 1 ≤ r) :

    Colouring to MIS. From a proper colouring with colours below k, misOfColoring marks a maximal independent set within k - 1 rounds, on every oriented cycle and on the infinite oriented path.

    Cole–Vishkin with two reductions per round (fastThreeColoring s) for s + 3 rounds, then greedy colour classes on the resulting 3-colouring.

    theorem Cslib.Distributed.OrientedCycle.misAlgorithm_run {n N s : ℕ} {x : ZMod n → ℕ} (hx : IsProperColoring x) (hN : ∀ (v : ZMod n), x v < N) (hs : N.logStar ≤ 2 * s) {r : ℕ} (hr : s + 5 ≤ r) :

    From a proper colouring with colours below N, misAlgorithm s marks an MIS within s + 5 rounds when log* N ≤ 2s.

    theorem Cslib.Distributed.OrientedCycle.misAlgorithm_findsMIS {n s : ℕ} (hn : n ≠ 1) (hs : n.logStar ≤ 2 * s) {t : ℕ} (ht : s + 5 ≤ t) :

    MIS upper bound. On oriented n-cycles, n ≠ 1, with identifiers {0, …, n - 1}, misAlgorithm s finds an MIS within s + 5 rounds when log* n ≤ 2s, for instance for s = ⌈(log* n) / 2⌉.

    From a maximal independent set to a 3-colouring #

    One round from a maximal independent set to a 3-colouring: members get colour 0, nodes whose predecessor is a member colour 1, and the remaining nodes colour 2.

    MIS to 3-colouring. colorOfMIS turns a maximal independent set into a proper colouring.

    MIS lower bound. A t-round MIS algorithm followed by colorOfMIS 3-colours in t + 1 rounds, so the 3-colouring lower bound Algorithm.ColorsCycle.logStar_le_of_three of Linial gives log* n ≤ 2t + 4.

    theorem Cslib.Distributed.OrientedCycle.exists_findsMIS_and_logStar_le {n : ℕ} (hn : n ≠ 1) :
    (∃ (S : Type) (A : Algorithm ℕ S Bool), A.FindsMIS n ((n.logStar + 1) / 2 + 5)) ∧ ∀ {S : Type u_1} (A : Algorithm ℕ S Bool) (t : ℕ), A.FindsMIS n t → n.logStar ≤ 2 * t + 4

    The round complexity of MIS on oriented cycles is Θ(log* n). For n ≠ 1, some deterministic LOCAL algorithm marks a maximal independent set of every oriented n-cycle with identifiers {0, …, n - 1} within ⌈(log* n) / 2⌉ + 5 rounds, and every algorithm doing so within t rounds has log* n ≤ 2t + 4.