The LOCAL model on oriented cycles #
Deterministic synchronous distributed algorithms in the LOCAL model of Linial on
consistently oriented cycles. The nodes of the oriented n-cycle are ZMod n; node v has
predecessor v - 1 and successor v + 1. For n = 0 the graph ZMod 0 = ℤ is the infinite
oriented path. Each node receives an input, for instance a unique identifier or an initial colour.
In every round each node exchanges messages with its two neighbours and updates its state.
Messages are unbounded, so an Algorithm simply sends its whole state. A MessageAlgorithm
with explicit messages reduces to this form (MessageAlgorithm.toAlgorithm_state). The round
number is common knowledge. Algorithms are non-uniform: one may be chosen for each cycle length
n, so every node knows n.
The equivalent view formulation: after r rounds the state of a node is a function of the
inputs at distance at most r (Algorithm.state_eq_viewState), so an r-round algorithm computes
a LocalRule of radius r (Algorithm.run_eq_apply). Conversely every rule of radius r is
computed in r rounds by flooding (LocalRule.toAlgorithm_run). Lower bounds can thus be proved
for rules and transferred to algorithms. LocalRule.andThen runs a rule and then an algorithm on
its outputs, and Algorithm.seq runs one algorithm for a fixed number of rounds and then another
on its outputs.
Identifiers are natural numbers. Algorithm.ColorsCycle uses identifiers {0, …, n - 1}; the
standard convention {1, …, n} is the same up to a shift by one, made precise by
Algorithm.colorsCycle_comapInput_succ_iff. For n = 0 no identifier assignment qualifies, so
ColorsCycle 0 t c holds vacuously; results on the infinite oriented path are stated directly for
Algorithm.run (for instance threeColoring_run).
Main definitions #
Cslib.Distributed.OrientedCycle.Algorithm,Algorithm.state,Algorithm.run: algorithms and their executions.Cslib.Distributed.OrientedCycle.Algorithm.comapInput: pre-processing the inputs.Cslib.Distributed.OrientedCycle.MessageAlgorithm: algorithms with explicit messages.Cslib.Distributed.OrientedCycle.Algorithm.seq: running one algorithm after another.Cslib.Distributed.OrientedCycle.LocalRule: rules of radiusron input windows.Cslib.Distributed.OrientedCycle.LocalRule.andThen: a rule followed by an algorithm.Cslib.Distributed.OrientedCycle.LocalRule.comp: a rule applied to the outputs of a rule.Cslib.Distributed.OrientedCycle.Algorithm.const: the 0-round algorithm with a constant output.Cslib.Distributed.OrientedCycle.IsProperColoring: proper colourings of the oriented cycle.Cslib.Distributed.OrientedCycle.Algorithm.ColorsCycle:Aproperlyc-colours every orientedn-cycle with identifiers{0, …, n - 1}introunds.
Main results #
Cslib.Distributed.OrientedCycle.Algorithm.state_eq_viewState: locality ofr-round states.Cslib.Distributed.OrientedCycle.Algorithm.run_eq_apply:rrounds compute a radius-rrule.Cslib.Distributed.OrientedCycle.LocalRule.toAlgorithm_run: every radius-rrule is computed inrrounds.Cslib.Distributed.OrientedCycle.LocalRule.andThen_run: composition of a rule and an algorithm.Cslib.Distributed.OrientedCycle.LocalRule.apply_comp: composition of rules.Cslib.Distributed.OrientedCycle.Algorithm.seq_run: sequential composition of algorithms.Cslib.Distributed.OrientedCycle.MessageAlgorithm.toAlgorithm_state: message passing as state exchange.Cslib.Distributed.OrientedCycle.Algorithm.colorsCycle_comapInput_succ_iff: the identifier conventions{0, …, n - 1}and{1, …, n}agree up to a shift.
References #
A deterministic synchronous algorithm in the LOCAL model on consistently oriented cycles.
Every node starts in state init x from its input x (an identifier or an initial colour). In
round r + 1 every node exchanges its whole state with its two neighbours and moves to
step r p s q, where s is its own state, p that of its predecessor and q that of its
successor. After the last round a node outputs output s. Messages and local computation are
unbounded, the round number is common knowledge, and every node knows the cycle length, since an
algorithm may be chosen separately for each n.
- init : I → State
The state of a node with input
xbefore the first round. - step : ℕ → State → State → State → State
The new state in round
r + 1from the predecessor's, own and successor's states. - output : State → O
The output of a node in a given state.
A message-passing algorithm on oriented cycles: in round r + 1 every node sends
toPred r s to its predecessor and toSucc r s to its successor, and then updates its state from
the message m₁ of its predecessor and the message m₂ of its successor.
- init : I → State
The initial state.
- toPred : ℕ → State → M
The message sent to the predecessor.
- toSucc : ℕ → State → M
The message sent to the successor.
- receive : ℕ → State → M → M → State
The new state from the old state, the predecessor's message and the successor's message.
- output : State → O
The output.
A message-passing algorithm as a state-exchange Algorithm: a node can compute the messages
its neighbours would send from their states.
The state-exchange simulation of a message-passing algorithm goes through the same states.
Sequential composition: run A for t rounds, then run B on the outputs of A. During the
first t rounds every node keeps B in its initial state for the current output of A.
Sequential composition. Running A.seq t B for t + r rounds is running B for r
rounds on the outputs of A after t rounds.
A rule of radius r: a function of input windows ℤ → I that only depends on the offsets
-r, …, r. Applied to every node of a cycle (LocalRule.apply) it computes the output of an
r-round LOCAL algorithm, and conversely (Algorithm.toLocalRule, LocalRule.toAlgorithm).
- toFun : (ℤ → I) → O
The output from a window of inputs.
Only the offsets
-r, …, rmatter.
The output after r rounds is the radius-r rule A.toLocalRule r applied at every node.
The full-information algorithm for a local rule: every node floods the window it has learnt
(its state is a window, correct on offsets -s, …, s after s rounds) and finally applies the
rule.
Running a rule F of radius r and then an algorithm B on its outputs: the flooding
algorithm F.toAlgorithm for r rounds, followed by B (Algorithm.seq).
Composition. Running F.andThen B for r + t rounds is running B for t rounds on the
outputs of F.
Distinct identifiers form a proper colouring, except on the one-node cycle, whose only node is its own successor.
After t rounds, A properly colours every oriented n-cycle whose nodes carry distinct
identifiers from {0, …, n - 1}, with colours 0, …, c - 1.
For n = 0 this is vacuous, since no x : ℤ → ℕ has all values below 0; colourings of the
infinite oriented path are stated directly for Algorithm.run, as in threeColoring_run and
fastThreeColoring_run.
Identifiers from {1, …, n}. An algorithm A properly c-colours every oriented n-cycle
with distinct identifiers from {1, …, n} in t rounds iff A.comapInput (· + 1), which first
adds one to every identifier, satisfies ColorsCycle n t c. Upper and lower bounds for the
{0, …, n - 1} convention therefore transfer to the {1, …, n} convention.