DGA 1

1. LOCAL model

The LOCAL model provides a clean abstraction of computation in a network or graph. In the LOCAL model, we want to solve some graph problem on the given graph. Each vertex, or node, of the graph is regarded as a computational entity and these entities work together in order to solve the given problem. For this, they are allowed to communicate over the edges of the graph.

1.1. Synchronous Rounds

In each round r = 1, 2, 3, . . ., each node performs two steps.

  1. it sends an arbitrarily large message to each of its neighbors,
  2. it is allowed to perform some arbitrarily complex internal computation on the knowledge it has accumulated so far.

Each node is required to execute the same algorithm, which is what we call a distributed algorithm.

1.2. A list coloring problem

A list of colors is assigned to each node as input, and the task is to assign to each node a color from the respective list such that the entire coloring satisfies certain constraints, e.g., being a proper coloring

1.3. Some principles

  • The distributed algorithm executed in each node
    1. is not only responsible for determining which messages to send,
    2. but also to decide when the node finishes its computation/communication.

This means each node has to decide at some point that it terminates, at which point it has to output its local problem.

When considering problems where the output is “on edges”, e.g., if the task is to compute some coloring of the edges, or if the considered problem is a matching problem, we will assume that each node has to output the local part of the global output corresponding to each incident edge.

1.4. Symmetry Breaking Information

In a symmetric input graph, e.g., a cycle, each node has exactly the same information at the beginning of the computation and since each node executes the exact same algorithm, each node will send precisely the same messages to its neighbors in the first round. Now, after the first round of communication, we still have exactly the same knowledge at each node, so also in the second round each node will send the exact same messages. By induction, we obtain that, in each round, each node will behave exactly the same as any other node; in particular, each node will give the exact same output.

But this implies that certain problems cannot be solved at all; for instance, it is impossible to compute a proper coloring as, no matter which algorithm is chosen, each node will output the same color.

A simple way to avoid these impossibilities is providing some symmetry breaking information.

This symmetry breaking information is different when talking about deterministic and randomized algorithms (or the deterministic and randomized LOCAL model):

  • In the deterministic LOCAL model, each node (additionally to the information already specified before) is equipped with a unique numerical identifier (ID) from \({1, \dots, n^{c}}\), for some constant \(c\ge 1\).
  • In the randomized LOCAL model, each node (additionally to the information already specified before) is equipped with its own private random bit string of arbitrary length. Each bit of the random bit string is chosen uniformly at random, and the randomized LOCAL model does not provide unique IDs.

2. Complexity

What is the runtime of a distributed algorithm?

2.1. Deterministic algorithms

We begin with the definition of the runtime or (time) complexity of an algorithm on a fixed graph.

2.1.1. Definition 2.1

The deterministic (time) complexity (or runtime) \(T_{\mathcal{A}}(G)\) of an algorithm \(\mathcal{A}\) on a graph \(G\) is the number of rounds until the last node terminates when executing \(\mathcal{A}\) on \(G\).

In general, we may omit parts of a piece of notation if they are clear from the context; e.g., we may simply write \(T(G)\) if it is obvious which algorithm we are talking about.

2.1.2. Definition 2.2

Let \(\mathcal{G}\) be a graph class, and, for each positive integer \(n\), let \(\mathcal{G}_n\) denote the class of all n-node graphs in \(\mathcal{G}\). The (time) complexity of a deterministic algorithm \(\mathcal{A}\) on graph class \(\mathcal{G}\) is the function \(T(n)=T_{\mathcal{A}}(n)\) satisfying \(T_{\mathcal{A}}(n)=max_{G \in \mathcal{G}_n}\ T_{\mathcal{A}}(G)\).

In other words, the complexity of an algorithm \(\mathcal{A}\) is given by specifying for each \(n\) the worst-case runtime of \(\mathcal{A}\) over all \(n\text{-node}\) graphs. Often, we are mainly interested in the asymptotic behavior of the complexity function \(T(\cdot)\), e.g., we may not care too much if the complexity of an algorithm is \(\frac{1}{2}\log n\) or \(100 \log n\) as long as it is upper bounded by \(c \log n\) for some constant \(c\) (where the function \(\log n\) just serves as an example).

A graph class that we will often consider is the class of all graphs. In particular, if no other graph class is specified our default assumption will be that we are considering the class of all graphs.

2.1.3. Definition 2.3

The deterministic (time) complexity of a problem (on some graph class \(\mathcal{G}\)) is the complexity of an optimal deterministic algorithm for that problem (on \(\mathcal{G}\)).

Is this well-defined? Could it be that one algorithm is better for, say, small \(n\), whereas another algorithm is better for large \(n\)? Essentially, no! The reason is that the nodes are aware of the number of nodes of the input graph, so if it’s advantageous, we can essentially use different algorithms for different \(n\) while formally using only a single algorithm that simply performs different steps conditional on the value of \(n\).

Determining (or at least bounding) the (asymptotic) complexity of problems (on interesting graph classes or all graphs) is one of the main goals, or perhaps the main goal, in the study of the LOCAL model.

2.2. Randomized algorithms

In the randomized LOCAL model, things are a little bit more complicated due to the fact that we allow randomized algorithms to fail with a small probability. More precisely, the randomized algorithms that we will consider are Monte-Carlo algorithms, i.e., we require that there exists an upper bound on the runtime of the algorithm that is independent of the random bits, but allow that the algorithm yields an incorrect output with a certain probability.

2.2.1. Definition 2.4

A randomized algorithm \(\mathcal{A}\) is regarded as correct on some graph class \(\mathcal{G}\) if, for any input graph \(G \in \mathcal{G}\), the probability that \(\mathcal{A}\) returns an incorrect (global) solution on \(G\) is at most \(1/|V(G)|\).

In other words, for any \(n\) and any graph \(G\) from the considered graph class with \(n\) nodes (and any port numbering), the probability (taken over the randomness from the provided random bit strings) that \(\mathcal{A}\) does not yield a correct output on \(G\) is not allowed to exceed \(1/n\), for \(\mathcal{A}\) to be considered correct.

We now obtain the definition of the complexity of a randomized algorithm (on some graph class) and the definition of the randomized complexity of a problem by replacing “deterministic algorithm” with “correct randomized algorithm”.

2.2.2. Theorem 2.5.

For any problem \(\Pi\), the randomized complexity of \(\Pi\) is at most as large as the deterministic complexity of \(\Pi\).

Proof. Let \(A\) be an optimal deterministic algorithm for \(\Pi\). We construct a randomized algorithm \(A'\) as follows. Each node uses the first \(3\lceil \log n \rceil\) bits of its private random string as its identifier, so each ID is chosen independently and uniformly from a set of size

\[ M = 2^{3\lceil \log n \rceil} \ge n^3. \]

After choosing these random IDs, all nodes execute the deterministic algorithm \(A\).

If all chosen IDs are pairwise distinct, then the resulting execution is simply a valid deterministic instance with unique identifiers. In that case, \(A'\) behaves exactly like \(A\), and therefore finishes in the same number of rounds and produces a correct output.

If a node encounters a situation that could not arise in any execution with unique IDs, it may simply terminate immediately. Hence, even in the bad case, the running time of \(A'\) never exceeds that of \(A\).

It remains to show correctness with high probability. For any fixed pair of nodes \(u,v\), the probability that they choose the same ID is exactly \(1/M\). Since there are \(\binom{n}{2}\) pairs of nodes, the union bound gives

\[ \Pr[\text{some collision}] \le \binom{n}{2}\frac{1}{M} < \frac{n^2}{2}\cdot \frac{1}{n^3} = \frac{1}{2n} \le \frac{1}{n}. \]

Therefore,

\[ \Pr[\text{all IDs are pairwise distinct}] \ge 1-\frac{1}{n}. \]

With this probability, \(A'\) exactly simulates \(A\) on a legal unique-ID instance and is thus correct. So \(A'\) has the same asymptotic running time as \(A\) and succeeds with probability at least \(1-1/n\). This proves that the randomized complexity of \(\Pi\) is at most its deterministic complexity. \(\square\)

3. An alternative definition

Since message size is unrestricted, an optimal algorithm loses nothing by having each node send all information it has accumulated so far.

The main question in the LOCAL model is not how hard the computation is, but how far a node must “see” in the graph in order to decide its output. After one round, a node learns information from its neighbors; after two rounds, from distance-2 nodes; after \(t\) rounds, from its entire radius-\(t\) neighborhood.

The text argues that in an optimal algorithm, a message sent by a node \(v\) should contain all knowledge that \(v\) has gathered up to that point. The reason is that any conclusion \(v\) could compute from that knowledge can also be computed by a neighbor once the neighbor receives the same information. So sending the full accumulated information is at least as powerful as sending only some compressed summary or specific instruction.

This is why the LOCAL model can be viewed as a model of locality: the only real limitation is the number of communication rounds. If all nodes keep forwarding everything they know, then after \(t\) rounds each node has exactly the information contained in its radius-\(t\) neighborhood. Therefore, the round complexity of a LOCAL algorithm measures how large a local view is needed to determine the output.

Hence, w.r.t. the complexity of algorithms and problems, we can simply assume that, in a \(T\text{-round}\) algorithm, every node simply sends, in each of the \(T\) rounds, all information it has accumulated so far and then at the end of round \(T\) computes its output based on the latest knowledge. Now, what does a node \(v\) learn during these \(T\) rounds? Clearly, \(v\) learns everything about its \(T\text{-hop}\) neighborhood in the input graph, including the topology, port numbers, unique IDs or random bits, and problem-specific inputs if present. But also \(v\) cannot learn anything from beyond, as there is no way such information can reach \(v\) in \(T\) rounds of communication (and there is no information in the system other than the information inside and the information outside of \(v\)’s \(T\text{-hop}\) neighborhood). Therefore, the information that \(v\) has at the end of the \(T\) th communication round is simply the knowledge about its \(T\text{-hop}\) neighborhood. Since \(v\) decides on its output based on its knowledge, we can now conclude the following.

3.1. Theorem 2.6

There exists a \(T(n)\text{-round}\) algorithm for some problem \(\Pi\) (on some graph class \(\mathcal{G}\)) if and only if there exists a deterministic function \(\mathcal{B}\) from the space of all possible centered \(T(n)\text{-hop}\) neighborhoods of a node in an \(n\text{-node}\) graph to the set of allowed output labels in \(\Pi\) such that, for each \(G \in \mathcal{G}\), the solution obtained by having each node gather its \(T(|V(G)|)\text{-hop}\) neighborhood and then applying the function \(\mathcal{B}\) yields a correct output.

We will often identify the function \(\mathcal{B}\) with the algorithm associated with it (that collects the \(T(n)\text{-hop}\) neighborhood at each node and then applies \(\mathcal{B}\)). Also, due to Theorem 2.6 we can restrict attention to algorithms of this particular form whenever we study whether a problem can be solved with a certain complexity. It will be useful to have both of these equivalent viewpoints; sometimes it will be more convenient to consider algorithms in the form of a function that maps \(T(n)\text{-hop}\) neighborhoods to output labels and sometimes it will be more convenient to consider algorithms that actually send around messages (that are potentially small and easy to understand).

Here is a simple corollary of the fact that we can view algorithms as functions defined on the space of \(T(n)\text{-hop}\) neighborhoods.

3.2. Observation 2.7

Every problem (that admits a correct solution) can be solved in \(n\) rounds in the deterministic (and randomized) LOCAL model.

Proof. For each possible input graph (including the distribution of the unique IDs), fix one solution. Now, let each node \(v\) gather its (centered) \(n\text{-hop}\) neighborhood, which will encompass the whole graph, and then apply the function \(\mathcal{B}\) to this neighborhood that first maps the neighborhood to the fixed solution for it and then selects as function value the part of the global output that corresponds to \(v\). The global output of this algorithm will be precisely the solution for the input graph fixed above and therefore correct. Moreover, by Theorem 2.5 we know that then the observation also holds for randomized algorithms.

We denote the diameter of a graph \(G\) by \(D = D(G)\). The proof of Observation 2.2 shows that also \(D\) rounds (which might be much smaller than \(n\) rounds) suffice to solve any problem that admits a correct solution (on any input graph of the considered graph class).

As \(n\) rounds suffice for essentially every problem, we would ideally like to have much faster algorithms when considering specific problems. Complexities that we aim for (depending on the problem) include \(O(\mathrm{poly}(\log n))\) and \(O(\log^{*} n)\).

This was a lot of information, and it may take a bit of time to digest all of it and get a good intuition for algorithms in the LOCAL model. Let’s start by having a look at an example of a LOCAL model algorithm in action. The setting will be simple, but the algorithm still interesting (and beautiful).

4. Coloring Directed Paths

Let’s assume that we want to deterministically compute a proper node coloring and we are guaranteed that the input graph is a directed path, i.e., the considered graph class is simply the class of all directed paths. How many colors do we need if we want to compute the coloring in substantially sublinear time? Do 2 colors suffice or do we need more? How can we show that a certain number of colors does not suffice, i.e., how can we prove lower bounds?

Let’s first try with 2 colors. Maybe this already suffices? As it turns out, the answer is no.

4.1. Theorem 3.1: There is no deterministic algorithm that computes a 2-coloring on directed paths in n/5 rounds.

Idea of the proof. The proof constructs two directed paths that look identical from the local perspective of two carefully chosen nodes, so any \(n/5\)-round deterministic algorithm must produce the same outputs at those nodes in both graphs. However, the global parity of the distance between the two nodes is different in the two graphs. Since a proper 2-coloring of a path is completely determined by parity, the two nodes must have the same color in one graph and different colors in the other. This is impossible, yielding a contradiction.

Proof. Assume for contradiction that there exists a deterministic algorithm \(A\) that computes a proper 2-coloring of directed paths in \(n/5\) rounds.

Construct two directed paths \(G\) and \(G'\), each with \(n\) nodes. In \(G\), the sequence of IDs along the edge orientation is

\[ 1,2,3,\dots,n. \]

In \(G'\), the sequence is

\[ 1,2,\dots,\lceil n/2 \rceil,\ \lceil n/2 \rceil+2,\dots,n+1. \]

Now consider the two nodes with IDs

\[ \lceil n/5 \rceil + 2 \quad\text{and}\quad \lceil 4n/5 \rceil - 1. \]

For sufficiently large \(n\), each of these two nodes has exactly the same radius-\(n/5\) neighborhood in \(G\) and in \(G'\). Since \(A\) runs in \(n/5\) rounds, the output of a node depends only on its radius-\(n/5\) neighborhood. Therefore, each of the two selected nodes must produce the same output in \(G\) and in \(G'\).

However, the distance between these two nodes is even in one of the graphs and odd in the other. In any proper 2-coloring of a path, two nodes at even distance must receive the same color, while two nodes at odd distance must receive different colors. Hence, in one of the two graphs, the selected nodes must output the same color, and in the other they must output different colors.

This contradicts the fact that the local neighborhoods of the selected nodes are identical in \(G\) and \(G'\), which forces the algorithm to produce the same outputs in both graphs. Therefore, no deterministic algorithm can compute a proper 2-coloring of directed paths in \(n/5\) rounds. \(\square\)

As we obtain a contradiction for any sufficiently large n, the proof of Theorem 3.1 implies a lower bound of \(\Omega(n)\) rounds. Hence, we cannot obtain a sublinear complexity if we only allow 2 colors. Let’s try with 3 …

4.2. 3-Coloring

Here is a simple but elegant deterministic algorithm that computes a 3-coloring on directed paths quickly. The algorithm (let’s call it \(\mathcal{A}\)) proceeds in 3 phases. In Phase 1, algorithm \(\mathcal{A}\) finds a proper coloring of the directed path using a large color palette. In Phase 2, the coloring will be changed step by step to a proper coloring that uses only a very small color palette. In Phase 3, the new coloring will be changed to a 3-coloring.

Phase 1 How can we obtain a proper coloring of the directed path if we don’t care about the number of colors we use? Well, essentially we are already given one by the definition of the LOCAL model. Recall that in the deterministic LOCAL model, each node is equipped with a unique ID from the space \(\{1, \ldots, n^{c}\}\). We can simply interpret the IDs as colors and thereby obtain a proper coloring with color palette \(\{1, \ldots, n^{c}\}\).

Phase 2 This is when the magic happens. Phase 2 consists of several rounds, in each of which each node selects a new (temporary) color for itself. Moreover, we always preserve the property that the coloring is proper while reducing the size of the used color palette. More precisely, in each round each node \(w\) sends its current color \(c_w\) to its child \(v\), and then \(v\) chooses a new color \(c_v'\) based only on its current color \(c_v\) and the current color \(c_w\) of its parent, as follows:

First, \(v\) computes the smallest position \(i\) at which the two colors \(c_v\) and \(c_w\), given as bit strings, differ (such an index exists as we preserve the property that the computed coloring is proper at all times). Then \(v\) sets \(c_v' := (i, c_v[i])\) where \(c_v[i]\) denotes the bit at position \(i\). Again, we can naturally encode the new color as a bit string, for the next round of Phase 2.

Phase 3 As we will see in the analysis, at the end of Phase 2 the used color palette is of size 6, i.e., each node has a color from the space \(\{1, \ldots, 6\}\). Now, we reduce the palette to size 3 in 3 rounds as follows (where each node sends its color to its neighbors in each of the 3 rounds). In the first round, each node of color 6 chooses as its new color the smallest color that none of its neighbors has, while all other nodes keep their color. In the second round, each node of color 5 chooses as its new color the smallest color that none of its neighbors has, while all other nodes keep their color. In the third round, each node of color 4 chooses as its new color the smallest color that none of its neighbors has, while all other nodes keep their color.

Using algorithm \(\mathcal{A}\), we can now prove the following statement.

4.3. Theorem 3.2

There is a deterministic algorithm that computes a 3-coloring on directed paths in \(O(\log^{*} n)\) rounds.

Proof. We claim that \(\mathcal{A}\) is such an algorithm. In order to show that this is the case, we need to argue that during the execution of \(\mathcal{A}\) the computed coloring always remains proper and analyze the complexity of \(\mathcal{A}\) (and fix the number of rounds that we execute Phase 2 for).

For the purpose of showing that the coloring always remains a proper coloring, consider an arbitrary node \(v\) and its parent \(w\). In Phase 2, the two new colors \(c_v' = (i, c_v[i])\) and \(c_w' = (j, c_w[j])\) differ since, if \(i = j\), then \(c_v[i] \neq c_w[i] = c_w[j]\), by the definition of \(i\). (Note that we can assume by induction that the two previous colors \(c_v\) and \(c_w\) were not identical.) In Phase 3, if any of \(v\) and \(w\) changes its color, it always makes sure (by the definition of Phase 3) that it chooses a color that the other node does not have. Note that it cannot happen that both \(v\) and \(w\) change color at the same time since they have different colors (again, by induction). It follows that the coloring always remains proper.

Now, for how many rounds do we execute \(\mathcal{A}\) in Phase 2? If the color palette before a round in Phase 2 has size \(S\), then the size of the color palette after the round is \(2\lceil \log S \rceil\). As we start with a color palette of size \(n^{c}\), after \(O(\log^{*} n)\) rounds, the color palette is of size 6.

Hence, we will execute \(\mathcal{A}\) in Phase 2 for \(O(\log^{*} n)\) rounds and obtain the guarantee that the coloring at the end of Phase 2 is a proper 6-coloring, which in turn guarantees that the final coloring is indeed a 3-coloring. (How does a node know that Phase 2 is over for itself?)

Since Phase 1 can be executed in 0 rounds, Phase 2 in \(O(\log^{*} n)\) rounds, and Phase 3 in 3 rounds, we obtain an overall complexity of \(O(\log^{*} n)\), as desired.

Author: Lowtroo

Created on: 2026-04-09 Thu 15:00

Powered by Emacs 29.3 (Org mode 9.6.15)