Documentation

CslibFrontier.Computability.Distributed.LocalGraph.Coloring

Deterministic (Δ + 1)-Coloring on Bounded-Degree Graphs in the LOCAL Model #

Deterministic synchronous LOCAL vertex-coloring protocols on finite simple graphs G : SimpleGraph V of maximum degree G.maxDegree ≤ Δ (steps towards #7505, after Cole and Vishkin, Goldberg, Plotkin and Shannon, Kuhn and Wattenhofer, Wattenhofer Chapter 1, and Hirvonen and Suomela Chapter 4).

Three reusable building blocks are provided on BroadcastProtocol (and hence also on PortProtocol via BroadcastProtocol.toPortProtocol):

  1. One-round greedy local-maximum color reduction (greedyColorReduction Δ): following Hirvonen and Suomela, §4.5, Lemma 4.1, p. 69, every node whose current color strictly exceeds all neighbor colors recolors itself to the smallest color in {0, …, Δ} absent from its neighborhood. Each round preserves properness and reduces a palette of size q to max (q - 1) (Δ + 1), reaching Δ + 1 colors within q - (Δ + 1) rounds from any initial proper q-coloring (greedyColorReduction_run).
  2. Kuhn–Wattenhofer one-round disjoint-block palette compression (kwCompressProtocol Δ m): following Kuhn and Wattenhofer, §5, Theorem 5.1, p. 12, one broadcast round compresses any proper m-coloring on a graph of maximum degree ≤ Δ into kwBound Δ m = ⌈m (Δ + 1) / (Δ + 2)⌉ colors (kwCompressProtocol_run), strictly shrinking every palette with Δ + 2 ≤ m (kwBound_lt).
  3. Orientation-decomposed Cole–Vishkin (Δ + 1)-coloring (deltaPlusOneColoring Δ C): from injective node identifiers below C, Round 0 collects and sorts each node's ≤ Δ neighbor identifiers to decompose incident constraints into Δ functional out-edge slots; the next Nat.logStar C rounds run Cslib.Distributed.OrientedCycle.cvColor in parallel across all Δ slots to obtain Δ proper 6-colorings; and Δ merging phases of 5 (Δ + 1) greedy reduction rounds fold the slot colorings into a single proper Fin (Δ + 1)-coloring within deltaPlusOneRounds Δ C = 1 + Nat.logStar C + 5 * Δ * (Δ + 1) rounds (O(log* C + Δ²), hence O(Δ log* C + Δ²)), stabilizing for all later rounds (deltaPlusOneColoring_isProperColoring). Polynomial cover-free set-system reduction (O(log* C + Δ log Δ)) and linear-in-Δ coloring remain open under #7505.

Main definitions #

Main results #

References #

Smallest unused color and one-round greedy local-maximum reduction #

The smallest natural number in {0, …, Δ} not belonging to used (defaulting to 0 when all Δ + 1 values lie in used, which never occurs when used.card ≤ Δ).

firstFreeColor Δ used always lies in {0, …, Δ}.

theorem Cslib.Distributed.LocalGraph.firstFreeColor_notMem {Δ : ℕ} {used : Finset ℕ} (hcard : used.card ≤ Δ) :
firstFreeColor Δ used ∉ used

Whenever at most Δ colors are excluded (used.card ≤ Δ), firstFreeColor Δ used is absent from used.

One step of greedy local-maximum color reduction (Hirvonen and Suomela, §4.5, Lemma 4.1, p. 69): a node whose color strictly exceeds every neighbor's color recolors to firstFreeColor Δ nbrs; all other nodes keep their color.

theorem Cslib.Distributed.LocalGraph.greedyStep_ne_of_adj {V : Type u_1} {H : SimpleGraph V} [H.LocallyFinite] {Δ : ℕ} (hdeg : ∀ (w : V), H.degree w ≤ Δ) {f : V → ℕ} (hf : ∀ (u v : V), H.Adj u v → f u ≠ f v) {u v : V} (huv : H.Adj u v) :

On any graph H where every vertex has degree at most Δ, applying greedyStep Δ to a proper coloring f : V → ℕ preserves properness.

theorem Cslib.Distributed.LocalGraph.greedyStep_lt {V : Type u_1} {H : SimpleGraph V} [H.LocallyFinite] {Δ q : ℕ} {f : V → ℕ} (hf : ∀ (u v : V), H.Adj u v → f u ≠ f v) (hq : ∀ (w : V), f w < q) (u : V) :
greedyStep Δ (f u) (Finset.image f (H.neighborFinset u)) < max (q - 1) (Δ + 1)

On any graph H where every vertex has degree at most Δ, if f is proper on H and bounded below q, then greedyStep Δ produces colors bounded below max (q - 1) (Δ + 1).

One-round greedy local-maximum color reduction as a BroadcastProtocol.

theorem Cslib.Distributed.LocalGraph.greedyColorReduction_run {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] {Δ q : ℕ} (hΔ : G.maxDegree ≤ Δ) {x : V → ℕ} (hx : ∀ (u v : V), G.Adj u v → x u ≠ x v) (hq : ∀ (u : V), x u < q) (r : ℕ) :
(∀ (u v : V), G.Adj u v → (greedyColorReduction Δ).run G x r u ≠ (greedyColorReduction Δ).run G x r v) ∧ ∀ (u : V), (greedyColorReduction Δ).run G x r u < max (q - r) (Δ + 1)

Step towards #7505 (not the cited endpoint, after Lemma 4.1 of Hirvonen and Suomela, §4.5, p. 69): running greedyColorReduction Δ for r rounds on a finite simple graph G with G.maxDegree ≤ Δ from a proper q-coloring preserves properness and bounds every output color below max (q - r) (Δ + 1).

Kuhn–Wattenhofer one-round disjoint-block palette compression #

The Kuhn–Wattenhofer one-round target palette size ⌈m (Δ + 1) / (Δ + 2)⌉ (Kuhn and Wattenhofer, §5, Theorem 5.1, p. 12).

theorem Cslib.Distributed.LocalGraph.kwBound_lt {Δ m : ℕ} (hm : Δ + 2 ≤ m) :
Δ + 1 ≤ kwBound Δ m ∧ kwBound Δ m < m

Whenever Δ + 2 ≤ m, kwBound Δ m strictly shrinks the palette (kwBound Δ m < m) while remaining at least Δ + 1.

Kuhn–Wattenhofer local compression rule: colors below q = kwBound Δ m stay fixed; a high color own ≥ q with i = own - q picks the first color in block {i (Δ + 1), …, (i + 1)(Δ + 1) - 1} unused by its neighbors' initial colors.

Kuhn–Wattenhofer one-round palette compression as a BroadcastProtocol.

theorem Cslib.Distributed.LocalGraph.kwCompressProtocol_run {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] {Δ m : ℕ} (hΔ : G.maxDegree ≤ Δ) {x : V → ℕ} (hx : ∀ (u v : V), G.Adj u v → x u ≠ x v) (hm : ∀ (u : V), x u < m) :
(∀ (u v : V), G.Adj u v → (kwCompressProtocol Δ m).run G x 1 u ≠ (kwCompressProtocol Δ m).run G x 1 v) ∧ ∀ (u : V), (kwCompressProtocol Δ m).run G x 1 u < kwBound Δ m

Step towards #7505 (not the cited endpoint, after Theorem 5.1 of Kuhn and Wattenhofer, §5, p. 12): in a single broadcast round on any finite simple graph G with G.maxDegree ≤ Δ, kwCompressProtocol Δ m turns any proper m-coloring into a proper coloring with colors below kwBound Δ m = ⌈m (Δ + 1) / (Δ + 2)⌉.

Orientation-decomposed Cole–Vishkin (Δ + 1)-coloring in O(log* C + Δ²) rounds #

Local node state for deltaPlusOneColoring Δ C.

  • uid : ℕ

    Node's permanent initial identifier.

  • nbrUIDs : List ℕ

    Sorted list of neighbor UIDs recorded in Round 0 (length = G.degree u ≤ Δ).

  • slotColor : Fin Δ → ℕ

    Per-slot Cole–Vishkin color across the Δ functional out-edge orientations.

  • mergedColor : ℕ

    Merged color maintained across the Δ greedy orientation-merging phases.

Round bound for deltaPlusOneColoring Δ C: 1 discovery round, Nat.logStar C parallel Cole–Vishkin rounds, and Δ merging phases of 5 (Δ + 1) greedy reduction rounds each.

theorem Cslib.Distributed.LocalGraph.deltaPlusOneRounds_le {Δ : ℕ} (hΔ : 1 ≤ Δ) (C : ℕ) :
deltaPlusOneRounds Δ C ≤ Δ * C.logStar + 10 * Δ ^ 2 + 1

Explicit O(Δ log* C + Δ²) bound: for 1 ≤ Δ, deltaPlusOneRounds Δ C is bounded by Δ * Nat.logStar C + 10 * Δ ^ 2 + 1 (and in fact equals 1 + Nat.logStar C + 5 * Δ * (Δ + 1)).

Deterministic (Δ + 1)-coloring step function at round r.

Deterministic synchronous LOCAL (Δ + 1)-coloring protocol (BroadcastProtocol) from injective node identifiers below C on graphs of maximum degree ≤ Δ.

After deltaPlusOneRounds Δ C rounds, every node's state remains permanently fixed.

theorem Cslib.Distributed.LocalGraph.deltaPlusOneColoring_isProperColoring {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] {Δ C : ℕ} (hΔ : G.maxDegree ≤ Δ) {x : V → ℕ} (hx : Function.Injective x) (hC : ∀ (u : V), x u < C) {r : ℕ} (hr : deltaPlusOneRounds Δ C ≤ r) :

Step towards #7505 (not the cited endpoint, after Cole and Vishkin, Goldberg, Plotkin and Shannon, and Hirvonen and Suomela, §4.5): on any finite simple graph G with G.maxDegree ≤ Δ and injective node identifiers x : V → ℕ bounded below C, deltaPlusOneColoring Δ C outputs a proper Fin (Δ + 1)-coloring (G.IsProperColoring) in every round r ≥ deltaPlusOneRounds Δ C (= 1 + Nat.logStar C + 5 * Δ * (Δ + 1)).

def Cslib.Distributed.LocalGraph.deltaPlusOneGraphColoring {V : Type u_1} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] {Δ C : ℕ} (hΔ : G.maxDegree ≤ Δ) {x : V → ℕ} (hx : Function.Injective x) (hC : ∀ (u : V), x u < C) {r : ℕ} (hr : deltaPlusOneRounds Δ C ≤ r) :
G.Coloring (Fin (Δ + 1))

Construct a SimpleGraph.Coloring directly from deltaPlusOneColoring Δ C after r ≥ deltaPlusOneRounds Δ C synchronous LOCAL rounds.