Almost Global Problems in the LOCAL Model

The landscape of the distributed time complexity is nowadays well-understood for subpolynomial complexities. When we look at deterministic algorithms in the LOCAL model and locally checkable problems (LCLs) in bounded-degree graphs, the following picture emerges: - There are lots of problems with time complexities of $\Theta(\log^* n)$ or $\Theta(\log n)$. - It is not possible to have a problem with complexity between $\omega(\log^* n)$ and $o(\log n)$. - In general graphs, we can construct LCL problems with infinitely many complexities between $\omega(\log n)$ and $n^{o(1)}$. - In trees, problems with such complexities do not exist. However, the high end of the complexity spectrum was left open by prior work. In general graphs there are LCL problems with complexities of the form $\Theta(n^\alpha)$ for any rational $0<\alpha \le 1/2$, while for trees only complexities of the form $\Theta(n^{1/k})$ are known. No LCL problem with complexity between $\omega(\sqrt{n})$ and $o(n)$ is known, and neither are there results that would show that such problems do not exist. We show that: - In general graphs, we can construct LCL problems with infinitely many complexities between $\omega(\sqrt{n})$ and $o(n)$. - In trees, problems with such complexities do not exist. Put otherwise, we show that any LCL with a complexity $o(n)$ can be solved in time $O(\sqrt{n})$ in trees, while the same is not true in general graphs.

In general graphs, we can construct LCL problems with infinitely many complexities between ω(log n) and n o (1) .In trees, problems with such complexities do not exist.However, the high end of the complexity spectrum was left open by prior work.In general graphs there are LCL problems with complexities of the form Θ(n α ) for any rational 0 < α ≤ 1/2, while for trees only complexities of the form Θ(n 1/k ) are known.No LCL problem with complexity between ω( √ n) and o(n) is known, and neither are there results that would show that such problems do not exist.We show that: In general graphs, we can construct LCL problems with infinitely many complexities between ω( √ n) and o(n).In trees, problems with such complexities do not exist.Put otherwise, we show that any LCL with a complexity o(n) can be solved in time O( √ n) in trees, while the same is not true in general graphs.receives messages from its neighbours, performs some computation based on the received messages.In the LOCAL model, there is no restriction on the size of the messages or on the computational power of a node.The time complexity of an algorithm is measured as the number of communication rounds that are required such that every node is able to stop and produce its local output.Hence, after t rounds in the LOCAL model, each node can gather the information in the network up to distance t from it.In other words, in t rounds a node can gather all information within its t-radius neighbourhood, where the t-radius neighbourhood of a node v is the subgraph containing all nodes at distance at most t from v and all edges incident to nodes at distance at most t − 1 from v (including the inputs given to these nodes).Also, in t rounds, the information outside the t-radius neighbourhood of a node v cannot reach v.This means that a t-round algorithm running in the LOCAL model can be seen as a function that maps all possible t-radius neighbourhoods to the outputs.Notice that, in the LOCAL model, every problem can be solved in diameter number of rounds, where the diameter of a graph G is defined as the largest hop-distance among any pair of nodes in G.In fact, in diameter time each node can gather all information there is in the whole graph and solve the problem locally.

Locally checkable labellings
Locally checkable labelling problems (LCLs) were introduced in the seminal work of Naor and Stockmeyer [17].Informally, LCLs are graph problems defined on bounded-degree graphs (i.e., graphs where the maximum degree is constant with respect to the number of nodes), where nodes have as input a label from a constant-size set of input labels, and they must produce an output from a constant-size set of output labels.The validity of these output labels is determined by a set of local constraints.

Formal definition.
Let F be the family of bounded-degree graphs.An LCL is defined as a tuple Π = (Σ in , Σ out , C, r) as follows.
Σ in and Σ out are constant-size sets of labels; r is an arbitrary constant (called the checkability radius of the problem); C is a set of graphs where each graph H ∈ C is centred at some node v, the distance of v from all other nodes in H, i.e., the radius of v, is at most r, each node u is labelled with a pair (i(u), o(u)) ∈ Σ in × Σ out .An example.An example of an LCL problem is vertex 3-colouring, where Σ in = {⊥}, Σ out = {1, 2, 3}, r = 1, and C is defined as all graphs of radius 1 in F such that each node has a colour in Σ out that is different from the ones of its neighbours.
Solving a problem.In general, solving an LCL means the following.We are given a graph G = (V, E) ∈ F and an input assignment i : V → Σ in .The goal is to produce an output assignment o : V → Σ out .Let B(v) be the subgraph of G induced by nodes of distance at most r from v, augmented with the inputs and outputs assigned by i and o.The output assignment is valid if and only if, for each node v ∈ V , we have B(v) ∈ C. In that case, we call (G, i, o) a valid configuration.This can be adapted to a distributed setting in a straightforward manner: if we are solving an LCL in the LOCAL model with a distributed algorithm A, the input graph G = (V, E) ∈ F is the communication network, each node v initially knows only its own part of the input 1:5 i(v) ∈ Σ in , and when algorithm A stops, each node v has to know its own part of output o(v) ∈ Σ out .The local outputs have to form a valid configuration (G, i, o).
Distributed time complexity.The distributed time complexity of an LCL problem Π in a graph family F is the pointwise smallest t : N → N such that there is a distributed algorithm A that solves Π in t(n) communication rounds in any graph G ∈ F with n nodes, for any n ∈ N, and for any input labelling of G.
Distributed verifiers.Above, we have defined an LCL as a set C of correctly labelled subgraphs.Equivalently, we could define an LCL in terms of a verifier A .A verifier is a distributed algorithm that receives both i and o as inputs, runs for r communication rounds, and then each node v outputs either 'accept' or 'reject'.We require that the output of A does not depend on the ID assignment or on the size of the input graph, but only on the structure of G and input and output labels in the r-radius neighbourhood of v. Now we say that (G, i, o) is a valid configuration if all nodes output 'accept'.This is equivalent to the above definition, as in r communication rounds each node v can gather all information within distance r, and nothing else.Hence A can output 'accept' if B(v) ∈ C; equivalently, the output of any such algorithm A defines a set C of correctly labelled neighbourhoods.
If A solves an LCL problem Π in time t(n), and A is the verifier for Π, then by definition the composition of A and A is a distributed algorithm that runs in t(n)+r rounds and always outputs 'accept' everywhere.It is important to note that, while the output of algorithm A may depend on the ID assignment that nodes have, the output of verifier A must not depend on the ID assignment or on the size of the graph.

Related work
Cycles and paths.LCL problems are fully understood in the case of cycles and paths.In these graphs it is known that there are LCL problems having complexities O(1), e.g.trivial problems, Θ(log * n), e.g.3-vertex colouring, and Θ(n), e.g.2-vertex colouring [9,16].Chang, Kopelowitz, and Pettie [7] showed two automatic speedup results: any o(log * n)-time algorithm can be converted into an O(1)-time algorithm; any o(n)-time algorithm can be converted into an O(log * n)-time algorithm.They also showed that randomness does not help in comparison with deterministic algorithms in cycles and paths.
Oriented grids.Brandt et al. [5] studied LCL problems on oriented grids, showing that, as in the case of cycles and paths, the only possible complexities of LCLs are O(1), Θ(log * n), and Θ(n), on n × n grids, and it is also known that randomness does not help [7,11].However, while it is decidable whether a given LCL on cycles can be solved in t rounds in the LOCAL model [5,17], it is not the case for oriented grids [5].

Trees.
Although well studied, LCLs on trees are not fully understood yet.Chang and Pettie [8] show that any n o (1) -time algorithm can be converted into an O(log n)-time algorithm.In the same paper they show how to obtain LCL problems on trees having deterministic and randomized complexity of Θ(n 1/k ), for any integer k.However, it is not known if there are problems of complexities between o(n 1/k ) and ω(n 1/(k+1) ).Regarding decidability on trees, given an LCL it is possible to decide whether it has complexity O(log n) or n O (1)  [8].In other words, it is possible to decide on which side of the gap between ω(log n) and n o (1) an LCL lies, but it is still an open question if we can decide whether a given LCL has complexity O(log * n) or Ω(log n).

General graphs.
Another key direction of research is understanding LCLs on general (bounded-degree) graphs.Using the techniques presented by Naor and Stockmeyer [17], it is possible to show that any o(log log * n)-time algorithm can be sped up to O(1) rounds.It is known that there are LCL problems with complexities Θ(log * n) [2,3,10,18] and Θ(log n) [4,7,12].On the other hand, Chang et al. [7] showed that there are no LCL problems with deterministic complexities between ω(log * n) and o(log n).It is known that there are problems (for example, ∆-colouring) that require Ω(log n) rounds [4,6], for which there are algorithms solving them in O(polylog n) rounds [19].Until very recently, it was thought that there would be many other gaps in the landscape of complexities of LCL problems in general graphs.Unfortunately, it has been shown in [1] that this is not the case: it is possible to obtain LCLs with numerous different deterministic time complexities, including Θ(log α n) and Θ(log α log * n) for any α ≥ 1, 2 Θ(log α n) , 2 Θ(log α log * n) , and Θ((log * n) α ) for any α ≤ 1, and Θ(n α ) for any α < 1/2 (where α is a positive rational number).

Near-linear complexities in general graphs
In this section we show that there are LCLs with time complexities in the spectrum between ω( √ n) and o(n).To show this result, we prove that we can take any linear bounded automaton (LBA) M , that is, a Turing machine with a tape of a bounded size, and an integer i ≥ 2, and construct an LCL problem Π i M , such that the distributed time complexity of Π i M is related to the choice of i and to the sequential running time of M when starting from an empty tape.
In particular, given an LBA M , we will define a family of graphs, that we call valid instances, where nodes are required to output an encoding of the execution of M .An LCL must be defined on any (bounded-degree) graph, without any promise on the graph structure, thus, we will define the LCL Π i M by requiring nodes to either prove that the given instance is not a valid instance, or to output a correct encoding of the execution of M if the instance is a valid one.The manner in which the execution has to be encoded ensures that the complexity of the LCL Π i M will depend on the running time of the LBA M , and by constructing LBAs with suitable running times, we can show our result.The key idea here is that we will use valid instances to prove a lower bound on the time complexity of our LCLs, and we will prove that adding all the other instances does not make the problem harder.
A simplified example.For example, consider an LBA M that encodes a unary counter, starting with the all-0 bit string and terminating when the all-1 bit string is reached.Clearly, the running time of M is linear in the length of the tape.We can represent the full execution of M using 2 dimensions, one for the tape and the other for time, and we can encode this execution on a 2-dimensional grid.See Figure 1 for an illustration.Notice that the length of the time dimension of this grid depends only on the length of the tape dimension and on M , and for a unary counter the length of the time dimension will always be the same as the length of the tape dimension.The LCL Π 2 M will be defined such that valid instances are 2-dimensional grids with balanced dimensions √ n × √ n (n nodes in total), and the idea is that, given such a grid, nodes are required to output an encoding of the full execution of M , and this would require Θ(n 1/2 ) rounds (since, in order to determine their output bit, certain nodes will have to determine the bit string they are part of, which in turn requires seeing the far end of the grid where the all-0 bit string is encoded).
In order to obtain LCLs with time complexity Θ(n α ), where 1/2 < α < 1, we define valid instances in a slightly different manner.We consider grids with i > 2 dimensions, and we let nodes choose where to encode the execution of M .We will allow nodes to choose an arbitrary dimension to use as the tape dimension, but, for technical reasons, we restrict nodes to use dimension 1 as the time dimension.The idea here is that, if the size of dimensions 2, . . ., i is not the same, nodes can minimize their running time by coordinating and picking the dimension j (different from 1) of smallest length as the tape dimension, and encode the execution of M using dimension 1 for time and dimension j for the tape.Thereby we ensure that in a worst-case instance all dimensions except dimension 1 have the same length.Also, if a grid has strictly fewer or more than i dimensions, it will not be part of the family of valid instances.In other words, our LCLs can be solved faster if the input graph does not look like a multidimensional grid with the correct number i of dimensions.Then, by using LBAs with different running times, and by choosing different values for i, we will prove our claim.
Technicalities.The process of defining an LCL that requires a solution to encode an LBA execution as output needs a lot of care.Denote with M an LBA.At a high level, our LCL problems are designed such that the encoding of the execution of M needs to be done only on valid instances.In other words, the LCL Π i M will satisfy the following: If the graph looks like a multidimensional grid with i dimensions, then the output of some nodes that are part of some 2-dimensional surface of the grid must properly encode the execution of M .Otherwise, nodes are exempted from encoding the execution of M , but they must produce as output a proof of the fact that the instance is invalid.This second point is somehow delicate, as nodes may try to "cheat" by claiming that a valid instance is invalid.Also, recall that in an LCL it has to be possible to check the validity of a solution locally, that is, there must exist a constant time distributed algorithm such that, given a correct solution, it outputs accept on all nodes, while given an invalid solution, it outputs reject on at least one node.To deal with these issues, we define our LCLs as follows: Valid instances are multidimensional grids with inputs.This input is a locally checkable proof that the given instance is a valid one, that is, nodes can check in constant time if the input is valid, and if it is not valid, at least one node must detect an error (for more on locally checkable proofs we refer the reader to 13).On these valid instances, nodes can only output a correct encoding of M .
On invalid instances, nodes must be able to prove that the input does not correctly encode a proof of the validity of the instance.This new proof must also be locally checkable.Thus, we will define two kinds of locally checkable proofs (each using only a constant number of labels, since we will later need to encode them in the definition of the LCLs): the first is given as input to nodes, and it should satisfy that only on valid instances all nodes see a correct proof, while on invalid instances at least one node sees some error; the second is given as output from nodes, and it should satisfy that all nodes see a correct proof only if there exists a node that, in constant time, notices some error in the first proof.
Hence, we will define LCLs that are solvable on any graph by either encoding the execution of the LBA, or by proving that the current graph is not a valid instance, where this last part is done by showing that the proof given as input is invalid on at least one node.

Roadmap
We will now describe the high level structure of this section.We will start by formally introducing Linear Bounded Automata in Section 3.2.
We will then introduce multidimensional grids in Section 3.3: these will be the hardest instances for our LCLs.These grids will be labelled with some input, and we will provide a set of local constraints for this input such that, if these constraints are satisfied for all nodes, then the graph must be a multidimensional grid of some desired dimension i (or belong to a small class of grid-like graphs that we have to deal with separately).Also, for any multidimensional grid of dimension i, it should be possible to assign these inputs in a valid manner.In other words, we design a locally checkable proof mechanism for the family of graphs of our interest, and every node will be able to verify if constraints hold by just inspecting their 3-radius neighbourhood, and essentially constraints will be valid on all nodes if and only if the graph is a valid multidimensional grid (Sections 3.3.1 and 3.3.2).
Next we will define what are valid outputs on multidimensional grids with the desired number i of dimensions.The idea is that nodes must encode the execution of some LBA M on the surface spanned by 2 dimensions.Nodes will be able to choose which dimension to use as the tape dimension, but they will be forced to use dimension 1 as the time dimension.The reason why we do not allow nodes to choose both dimensions is that, in order to obtain complexities in the ω( √ n) spectrum, we will need the time dimension to be ω( √ n), but in any grid with at least 3 dimensions, the smallest two dimensions are always O( √ n).For example, consider an LBA M that encodes a unary 5-counter, that is, a list of 5 unary counters, such that when one counter overflows, the next one is incremented.The running time of M is Θ(B 5 ), where B is the length of the tape.The worst case instance for the problem Π 3 M will be a 3-dimensional grid, where dimensions 2 and 3 will have equal size n 1/7 and dimension 1 will have size n 5/7 .In such an instance, nodes will be required to encode the execution of M using either dimension 2 or 3 as tape dimension, and 1 as time dimension-note that the size of dimension 1 as a function of the size of dimension 2 (or 3) matches the running time of M as a function of B. Thus, the complexity of Π 3 M will be Θ(n 5/7 ), as nodes will need to see up to distance Θ(n 5/7 ) in dimension 2 (or 3).If we do not force nodes to choose dimension 1 as time, then nodes can always find two dimensions of size O(n 1/2 ), and we would not be able to obtain problems with complexity ω(n 1/2 ).
We will start by handling grids that are unbalanced in a certain way, that is, where dimension 1 is too small compared to all the others (Section 3.3.3).In this case, deviating from the above, we allow nodes to produce some different output that can be obtained without spending much time (this is needed to ensure that our LCLs do not get too hard on very unbalanced grids).Then, we define what the outputs must be on valid grids that are not unbalanced (Section 3.4).Each node must produce an output such that the ensemble of the outputs of nodes encodes the execution of a certain LBA.In particular, we define a set of output labels and a set of constraints, such that the constraints are valid on all nodes if and only if the output of the nodes correctly encodes the execution of the LBA.
We define our LCLs in Section 3.5.We provide a set of output labels, and constraints for these labels, that nodes can use to prove that the given graph is not a valid multidimensional grid, where the idea is that nodes can produce pointers that form a directed path that must end on a node for which the grid constraints are not satisfied.Our LCL will then be defined such that nodes can either: produce an encoding of the execution of the given LBA, or prove that dimension 1 is too short, or prove that there is an error in the grid structure.All this must be done carefully, ensuring that nodes cannot claim that there is an error in valid instances, and always allowing nodes to produce a proof of an error if the instance is invalid.Also, we cannot require all nodes to consistently choose one of the three options, since that may require too much time.So we must define constraints such that, for example, it is allowed for some nodes to produce a valid encoding of the execution of the LBA, and at the same time it is allowed for some other nodes to prove that there is an error in the input proof (that maybe the first group of nodes did not see).
Finally, in Section 3.6 we will show upper and lower bounds for our LCLs, and in Section 3.7 we show how these results imply the existence of a family of LCLs that have complexities in the range between ω( √ n) and o(n).

Remarks.
To avoid confusion, we point out that we will (implicitly) present two very different distributed algorithms in this section: First, we define a specific LCL problem Π i M .Recall that any LCL problem can be interpreted as a constant-time distributed algorithm A that verifies that (G, i, o) is a valid configuration.We do not give A explicitly here, but we will present a list of constraints that can be checked in constant time by each node.This is done in Section 3.5.1.Second, we prove that the distributed complexity of Π i M is Θ(t(n)), for some t between ω( √ n) and o(n).To show this, we will need a pair of matching upper and lower bounds, and to prove the upper bound, we explicitly construct a distributed algorithm A that solves Π i M in O(t(n)) rounds, i.e., A takes (G, i) as input and produces some o as output such that (G, i, o) is a valid configuration that makes A happy.This is done in Section 3.6.1.Note that the specific details of Π i M as such are not particularly interesting; the interesting part is that Π i M is an LCL problem (in the strict formal sense) and its distributed time complexity is between ω( √ n) and o(n).As we will see in Section 4 such problems do not exist in trees.

Linear bounded automata
A Linear Bounded Automaton (LBA) M consists of a Turing machine that is executed on a tape with bounded size, able to recognize the boundaries of the tape [15, p. 225].We consider a simplified version of LBAs, where the machine is initialized with an empty tape (no input is present).We describe this simplified version of LBAs as a 5-tuple M = (Q, q 0 , f, Γ, δ), where: Q is a finite set of states; Γ is a finite set of tape alphabet symbols, containing a special symbol b (blank), and two special symbols, L and R, called left and right markers; is the transition function.The tape is initialized in the following way: the first cell contains the symbol L; the last cell contains the symbol R; all the other cells contain the symbol b.The head is initially positioned on the cell containing the symbol L.Then, depending on the current state and the symbol present on the current position of the tape head, the machine enters a new state, writes a symbol on the current position, and moves to some direction.
In particular, we describe the transition function δ by a finite set of 5-tuples (s 0 , t 0 , s 1 , t 1 , d), where: 1.The first 2 elements specify the input: s 0 indicates the current state; t 0 indicates the tape content on the current head position.

The remaining 3 elements specify the output:
s 1 is the new state; t 1 is the new tape content on the current head position; d specifies the new position of the head: '→' means that the head moves to the next cell in direction towards R; '←' indicates that the head moves to the next cell in direction towards L; '−' means the head does not move.The transition function must satisfy that it cannot move the head beyond the boundaries L and R, and the special symbols L and R cannot be overwritten.If δ is not defined on the current state and tape content, the machine terminates.
By fixing a machine M and by changing the size of the tape B on which it is executed, we obtain different running times for the machine, as a function of B. We denote by T M (B) the running time of an LBA M on a tape of size B. For example, it is easy to design a machine M that implements a binary counter, that starts from a tape containing all 0s and terminates when the tape contains all 1s, and this machine has a running time Also, it is possible to define a unary k-counter, that is, a list of k unary counters (where each one counts from 0 to B − 1 and then overflows and starts counting from 0 again) in which when a counter overflows, the next is incremented.It is possible to obtain running times of the form T M (B) = Θ(B k ) by carefully implementing these counters (for example by using a single tape of length B to encode all the k counters at the cost of using more machine states and tape symbols).
The reason why we consider LBAs is that they fit nicely with the LCL framework, that requires local checkability using a constant number of labels.The definition of an LBA M does not depend on the tape size, that is, the description of M is constant compared to B. Also, by encoding the execution of M using two dimensions, one for the tape and the other for time, we obtain a structure that is locally checkable: the correctness of each constant size neighbourhood of this two dimensional surface implies global correctness of the encoding.

Grid structure
In order to obtain LCLs for the general graphs setting, we need our LCLs to be defined on any (bounded-degree) graph, and not only on some family of graphs of our interest.That is, we cannot assume any promise on the family of graphs where the LCL requires to be solved.The challenge here is that we can easily encode LBAs only on grids, but not on general graphs.
Thus, we will define our LCLs in a way that there is a family of graphs, called valid instances, where nodes are actually required to output the encoding of the execution of a specific LBA, while on other instances nodes are exempted from doing so, but in this case they are required to prove that the graph is not a valid instance.The intuition here is that valid instances will be hard instances for our LCLs, meaning that when we will prove a lower bound for the time complexity of our LCLs we will use graphs that are part of the family of valid instances.Then, when we will prove upper bounds, we will show that our LCLs are always solvable, even in graphs that are invalid instances, and the time required to solve the problem in these instances is not more than the time required to solve the problem in the lower bound graphs that we provided.
We will now make a first step in defining the family of valid instances, by formally defining what a grid graph is.
Let i ≥ 2 and d 1 , . . ., d i be positive integers.The set of nodes of an i-dimensional grid graph G consists of all i-tuples u = (u 1 , . . ., u i ) with 0 ≤ u j ≤ d j for all 1 ≤ j ≤ i.We call u 1 , . . ., u i the coordinates of node u and d 1 , . . ., d i the sizes of the dimensions 1, . . ., i. Let u and v be two arbitrary nodes of G.There is an edge between u and v if and only if ||u − v|| 1 = 1, i.e., all coordinates of u and v are equal, except one that differs by 1. Figure 2 depicts a grid graph with 3 dimensions.
Notice that nodes do not know their position in the grid, or, for incident edges, which dimension they belong to.In fact, nodes do not even know if the graph where they currently are is actually a grid!At the beginning nodes only know the size n of the graph, and everything else must be discovered by exploring the neighbourhood.

Grid labels
As previously discussed, LCLs must be well defined on any (bounded-degree) graph, and we want to define our LCLs such that, if a graph is not a valid instance, then it must be easy for nodes to prove such a claim, where easy here means that the time required to produce such a proof is not larger than the time required to encode the execution of the machine in the worst possible valid instance of the same size.For this purpose, we need to help nodes to produce such a proof.The idea is that a valid instance not only must be a valid grid graph, but it must also include a proof of being a valid grid graph.Thus, we will define a constant size set of labels, that will be given as input to nodes, and a set of constraints, such that, if a graph is a valid grid graph, then it is possible to assign a labelling that satisfies the constraints, while if the graph is not a valid grid graph, then it should be not possible to assign a labelling such that constraints are satisfied on all nodes (at least one node must note some inconsistency).Informally, in the LCLs that we will define, such a labelling will be provided as input to the nodes, and nodes will be able to prove that a graph is invalid by just pointing to a node where the input labelling does not satisfy these constraints.
For the sake of readability, instead of defining a set of labels and a set of local constraints that characterize valid grid graphs, we start by defining what is a valid label assignment to grid graphs, in a non-local manner.Then, we will show how to turn this to a set of locally checkable constraints.Unfortunately, we will not be able to prove that if labels satisfy these local constraints on all nodes, then the graph is actually a grid.Instead, the set of graphs that satisfy these constraints for all nodes will include a small family of additional graphs, that are graphs that locally look like a grid everywhere, but globally they are not valid grid graphs.For example, toroidal grids will be in this family.As we will show, the weaker statement that we prove will be enough for our purposes.
We now present a valid labelling for valid grid graphs.Each edge e = {u, v} is assigned two labels L u (e) and L v (e), one for each endpoint.Label L u (e) is chosen as follows: is chosen analogously.We define L grid to be the set of all possible input labels, i.e., If we want to focus on a specific label of some edge e and it is clear from the context which of the two edge labels is considered, we may refer to it simply as the label of e.
We call the unique node that does not have any incident edge labelled (Prev, j) origin.Equivalently, we could define the origin directly as the node (0, 0, . . ., 0), but we want to emphasize that each node of a grid graph can infer whether it is the origin, simply by checking its incident labels.
In Section 3.5.1, the defined grid labels will appear as edge input labels in the definition of the new LCL problems we design.In the formal definition of an LCL problem (see Section 2.2), input labels are assigned to nodes; however this is not a problem: that we label edges in our grid graphs is just a matter of convenience; we could equally well assign the labels to nodes instead of edges (and, for that matter, combine all labels of a node into a single label).The same holds for the output labels that are part of the definitions of the LCL problems in Section 3.5.1.Furthermore, we could also equally well encode the labels in the graph structure.Hence, all new time complexities presented in Section 3.7 can also be achieved by LCL problems without input labels (a family of problems frequently considered in the LOCAL model literature).From now on, with grid graph we denote a grid graph with a valid labelling.

Local checkability
As previously discussed, we want to make sure that if the graph is not a valid grid graph, then at least one node can detect this issue in constant time.Hence, we are interested in a local characterisation of grid graphs.Given such a characterisation, each node can check locally whether the input graph has a valid grid structure in its neighbourhood.As it turns out, such a characterization is not possible, since there are non-grid graphs that look like grid graphs locally everywhere, but we can come sufficiently close for our purposes.In fact, we will specify a set of local constraints that characterise a class of graphs that contains all grid graphs of dimension i (and a few other graphs).All the constraints depend on the 3-radius neighbourhood of the nodes, so for each input graph not contained in the characterised graph class, at least one node can detect in 3 rounds (in the LOCAL model) that the graph is not a grid graph.
For any node v and any sequence L 1 , L 2 , . . ., L p of edge labels, let z v (L 1 , L 2 , . . ., L p ) denote the node reached by starting in v and following the edges with labels L 1 , L 2 , . . ., L p .If at any point during traversing these edges there are 0 or at least 2 edges with the currently processed label, z v (L 1 , L 2 , . . ., L p ) is not defined (this may happen, since nodes need to be able to check if the constraints hold also on graphs that are invalid grid graphs).Let i ≥ 2. The full constraints are given below: 1. Basic properties of the labelling.For each node v the following hold: Each edge e incident to v has exactly one (v-sided) label L v (e), and for some 1 ≤ j ≤ i we have For any two edges e, e incident to v, we have For any 1 ≤ j ≤ i, there is at least one edge e incident to v with L v (e) ∈ (Prev, j), (Next, j) .

2.
Validity of the grid structure.For each node v the following hold: For any incident edge e = {v, u}, we have that Let 1 ≤ j, k ≤ i such that j = k.Also, let e = {v, u} and e = {v, u } be edges with the following v-sided labels: Then node u has an incident edge e with label L u (e ) = L v (e ), and u has an incident edge e with label L u (e ) = L v (e).Moreover, the two other endpoints of e and e are the same node, i.e., z u (L u (e )) = z u (L u (e )).It is clear that i-dimensional grid graphs satisfy the given constraints, but as observed above, the converse statement is not true.(As a side note for the curious reader, we mention that the converse statement can be transformed into a correct (and slightly weaker) statement by adding the small (non-local) condition that the considered graph contains a node not having any incident edge labelled with some (Prev, j), for all dimensions j.However, due to its non-local nature, we cannot make use of such a condition.)

Unbalanced grid graphs
In Section 3.3.2,we saw the basic idea behind ensuring that non-grid graphs are not among the hardest instances for the LCL problems we construct.In this section, we will study the ingredient of our LCL construction that guarantees that grid graphs where the dimensions have "wrong" sizes are not worst-case instances.More precisely, we want that the hardest instances for our LCL problems are grid graphs with the property that there is at least one 1:14 Almost Global Problems in the LOCAL Model dimension 2 ≤ j ≤ i whose size is not larger than the size of dimension 1.In the following, we will show how to make sure that unbalanced grid graphs, i.e., grid graphs that do not have this property, allow nodes to find a valid output without having to see too far.In a sense, in the LCLs that we construct, one possible valid output is to produce a proof that the grid is unbalanced in a wrong way, and since the validity of an output assignment for an LCL must be locally checkable, we want such a proof to be locally checkable as well.
Thus, in the LCLs that we will define, nodes of an arbitrary graph will be provided with some input labelling that encodes a (possibly wrong) proof that claims that the current graph is a valid grid graph.Then, if the graph does not look like a grid, nodes can produce a locally checkable proof that claims that this input proof is wrong.Instead, if the graph does look like a grid, but this grid appears to be unbalanced in some undesired way, nodes can produce a locally checkable proof about this fact.
More formally, consider a grid graph with i dimensions of sizes d 1 , . . ., d i .If d 1 < d j for all 2 ≤ j ≤ i, the following output labelling is regarded as correct in any constructed LCL problem: For all 0 All other nodes are labelled Exempt U .This labelling is clearly locally checkable, i.e., it can be described as a collection of local constraints: Each node v labelled Unbalanced checks that 1. its two "diagonal neighbours" u = z v ((Prev, 1), (Prev, 2), . . ., (Prev, i)) and w = z v ((Next, 1), (Next, 2), . . ., (Next, i)), both exist (i.e., are defined) and are both labelled Unbalanced, or 2. w exists and is labelled Unbalanced and v has no incident edge labelled (Prev, j), or 3. u exists and is labelled Unbalanced and v has an incident edge labelled (Next, j) for all 2 ≤ j ≤ i, but no incident edge labelled (Next, 1).Condition 3 ensures that the described diagonal chain of Unbalanced labels terminates at a node whose first coordinate is d 1 (i.e., the maximal possible value for the coordinate corresponding to dimension 1), but whose second, third, . . ., coordinate is strictly smaller than d 2 , d 3 , . . ., respectively, thereby guaranteeing that grid graphs that are not unbalanced do not allow the output labelling specified above.Finally, the origin checks that it is labelled Unbalanced, in order to prevent the possibility that each node simply outputs Exempt U .We refer to Figure 3 for an example of an unbalanced 2-dimensional grid and its labelling.We define L unbalanced to be the set containing {Unbalanced, Exempt U }.

Machine encoding
After examining the cases of the input graph being a non-grid graph or an unbalanced grid graph, in this section, we turn our attention towards the last remaining case: that is the input graph is actually a grid graph for which there is a dimension with size smaller than or equal to the size of dimension 1.In this case, we require the nodes to work together to create a global output that is determined by some LBA M .Essentially, the execution of M has to be written (as node outputs) on a specific part of the grid graph.In order to formalise this relation between the desired output and the LBA M , we introduce the notion of an M -encoding graph in the following section.

Labels
Let M be an LBA, and consider the execution of M on a tape of size B. Let S = (s , h , t ) be the whole state of M after step , where s is the machine internal state, h is the position of the head, and t is the whole tape content.The content of the cell in position y ∈ {0, . . ., B−1} after step is denoted by t [y].We denote by (x, y) Intuitively, the 2-dimensional surface expanding in dimensions 1 and k (having all the other coordinates equal to 0), encodes the execution of M .More precisely, the nodes (x, 0) k , (x, 1) k , . . ., (x, B−1) k together represent the state of the tape at time x, i.e., dimension 1 constitutes the time axis whereas the tape itself is unrolled along dimension k.In particular, the nodes (0, 1) k , (0, 2) k , . . ., (0, B − 2) k representing the (inner part of the) tape at the beginning of the computation are all labelled with the blank symbol b (or, if we want to be very precise, Tape(b)), the nodes (0, 0) k , (0, 1) k , . . .representing the left end of the tape (at different points in time) are labelled with the left marker L, and the nodes (B − 1, 0) k , (B − 1, 1) k , . . .representing the right end of the tape are labelled with the right marker R. We define L encoding to be the set of all possible output labels used to define an M -encoding graph.

Local checkability
In order to force nodes to output labels that turn the input grid graph into an M -encoding graph, we must be able to describe Conditions (C1)-(C3) in the form required by an LCL problem, i.e., as locally checkable constraints.In the following, we provide such a description, showing that the nodes can check whether the graph correctly encodes the execution of a given LBA M .

Constraint (LC1):
Each node v is labelled with either Exempt M or Dimension(k) for exactly one 2 ≤ k ≤ i.In the former case, node v has no other labels, in the latter case, v additionally has some Tape and some State label, and potentially the label Head, but no other labels.

Constraint (LC3):
If a node v labelled Dimension(k) for some 2 ≤ k ≤ i has an incident edge e labelled with L v (e) = (Prev, j), then j = 1 or j = k.Moreover, for each node v labelled Dimension(k), nodes z v ((Prev, 1)), z v ((Prev, k)) and z v ((Next, k)) (provided they are defined) are also labelled Dimension(k).

Constraint (LC4):
For each node v labelled Dimension(k) for some 2 ≤ k ≤ i, the following hold: If v has an incident edge labelled (Prev, 1), v has labels State(q) and Tape(t), and z v ((Prev, 1)) has labels State(q ) and Tape(t ), then )) is labelled with Head, then q and t are derived from q and t according to the specifications of the LBA M , and the new position of the head is either on v itself, or on z v ((Prev, k)), or on z v ((Next, k)), depending on M ; (h) otherwise, t = t and the nodes z v ((Prev, k)) and z v ((Next, k)) (if defined) are labelled State(q); (i) if q = f , then node z v ((Next, 1)) (if defined) is labelled Dimension(k).

Correctness. It is clear that an M -encoding graph satisfies Constraints (LC1)-(LC4).
Conversely, we want to show that any graph satisfying Constraints (LC1)-( LC4) is an M -encoding graph.We start by setting B := d k + 1, which already implies Condition (C1).
Constraints (LC1)-(LC3) ensure that there is a 2-dimensional surface S on which the execution of M is encoded: (LC3) ensures that for any node labelled Dimension(k), all coordinates except potentially those corresponding to dimension 1 and k are 0, i.e., each node labelled Dimension(k) is of the form (x, y) k for some x, y.Moreover, according to (LC3), whenever some (x, y) k is labelled Dimension(k), then also all (x , y ) k that satisfy x ≤ x are labelled Dimension(k) and, in particular, the origin is also labelled Dimension(k).Since, by (LC1), no node (in particular, the origin) is labelled Dimension(k) for more than one k, it follows that there is at most one k for which there exist nodes with label Dimension(k), and these nodes are exactly the nodes (x, y) k for which x does not exceed some threshold value (which as we will see will be exactly min{T M (B), d 1 }).(LC2) ensures that this value is at least 1; in particular, there are nodes that are not labelled Exempt M .(LC1) ensures that all nodes not labelled Dimension(k) are labelled Exempt M .
Constraints (LC4e)-(LC4i) ensure a correct execution of each step of M , and that nodes on S output Exempt M only after the termination state of M is reached: Constraints (LC4e) and (LC4i) ensure that the threshold value for y up to which all (x, y) k are labelled with Dimension(k) is at least T M (B), unless T M (B) > d 1 , in which case the threshold value is d 1 .(LC4f) ensures that the threshold value does not exceed T M (B), thereby implying Conditions (C2d) and (C3).Here we use the observation derived from (LC1) that all nodes not labelled Dimension(k) are labelled Exempt M .(LC4g) and (LC4h) imply that if the nodes (x, 0) k , (x, 1) k , . . ., (x, B − 1) k encode the state of the computation after step x, and the corresponding machine internal state is not the final state, then also the nodes (x + 1, 0) k , (x + 1, 1) k , . . ., (x + 1, B − 1) k encode the state of the computation after step x + 1.As we already observed above that (LC4a)-(LC4d) ensure that (0, 0) k , (0, 1) k , . . ., (0, B − 1) k encode the initial state of the computation, we obtain by induction (and our obtained knowledge about the threshold value) that (C2a)-(C2c) hold for all 0 ≤ x ≤ min{T M (B), d 1 }.

LCL construction
Fix an integer i ≥ 2, and let M be an LBA with running time T M .As we do not fix a specific size of the tape, T M can be seen as a function that maps the tape size B to the running time T M (B) of the LBA executed on a tape of size B. We now construct an LCL problem Π i M with complexity related to T M .Note that Π i M depends on the choice of i.The general idea of the construction is that nodes can either: produce a valid encoding of the execution of M , or prove that dimension 1 is too short, or prove that there is an error in the (grid) graph structure.We need to ensure that on balanced grid graphs it is not easy to claim that there is an error, while allowing an efficient solution on invalid graphs, i.e., graphs that contain a local error (some invalid label), or a global error (a grid structure that wraps, or dimension 1 too short compared to the others).

LCL problem Π i M
Formally, we specify the LCL problem Π i M as follows.The input label set for Π i M is the set L grid of labels used in the grid labelling (see Section 3.3.1).The possible output labels are the following: 1.The labels from L encoding (see Section 3.4).

2.
The labels from L unbalanced (see Section 3.3.3).

3.
The set of error labels L error .This set is defined to contain the error label Error, and error pointers, i.e., all possible pairs (s, r), where s is either (Next, j) or (Prev, j) for some 1 ≤ j ≤ i, and r ∈ {0, 1} is a bit whose purpose it is to distinguish between two different types of error pointers, type 0 pointers and type 1 pointers.Intuitively, nodes that notice that there is/must be an error in the grid structure, but are not allowed to output Error because the grid structure is valid in their local neighbourhood, can point in the direction of an error.However, the nodes have to make sure that the error pointers form a chain that actually ends in an error.In order to make the proofs in this section more accessible, we distinguish between the two types of error pointers mentioned above; roughly speaking, type 0 pointers will be used by nodes that (during the course of the algorithm) cannot see an error in the grid structure, but notice that the grid structure wraps around in some way, while type 1 pointers are for nodes that can actually see an error.Here, with "wrapping around", we mean that there is a node v and a sequence of edge labels L 1 , L 2 , . . ., L p such that 1. there exists a dimension j such that the number of labels (Prev, j) in this sequence is different from the number of labels (Next, j), and 2. z v (L 1 , L 2 , . . ., L p ) = v, i.e., we can walk from some node to itself without going in each dimension the same number of times in one direction as in the other.If the grid structure wraps around, then there must be an error somewhere (and nodes that see that the grid structure wraps around know where to point their error pointer to), or following an error pointer chain results in a cycle; however, since the constraints we put on error pointer chains are local constraints (as we want to define an LCL problem), the global behaviour of the chain is irrelevant.We will not explicitly prove the global statements made in this informal overview; for our purposes it is sufficient to focus on the local views of nodes.
Note that if a chain of type 0 error pointers does not cycle, then at some point it will turn into a chain of type 1 error pointers, which in turn will end in an error.Chains of type 1 error pointers cannot cycle.We refer to Figure 4 for an example of an error pointer chain.
An output labelling for problem Π i M is correct if the following conditions are satisfied.1.Each node v produces at least one output label.If v produces at least two output labels, then all of v's output labels are contained in L encoding \ {Exempt M }.

Each node at which the input labelling does not satisfy the local grid graph constraints
given in Section 3.3.2outputs Error.All other nodes do not output Error.3. If a node v outputs Exempt U or Exempt M , then v has at least one incident edge e with input label L v (e) = (Prev, j), where j ∈ {1, . . ., i}. 4. If the output labels of a node v are contained in L encoding \ {Exempt M }, then either there is a node in v's 2-radius neighbourhood that outputs a label from L error , or the output labels of all nodes in v's 2-radius neighbourhood are contained in L encoding .Moreover, in the latter case v's 2-radius neighbourhood has a valid grid structure and the local constraints of an M -encoding graph, given in Section 3.4.2,are satisfied at v. 5.If the output of a node v is Unbalanced, then either there is a node in v's i-radius neighbourhood that outputs a label from L error , or the output labels of all nodes in v's i-radius neighbourhood are contained in L unbalanced .Moreover, in the latter case v's i-radius neighbourhood has a valid grid structure and the local constraints for a proof of unbalance, given in Section 3.3.3,are satisfied at v. 6.Let v be a node that outputs an error pointer (s, r).Then z v (s) is defined, i.e., there is exactly one edge incident to v with input label s.Let u be the neighbour reached by following this edge from v, i.e., u = z v (s).Then u outputs either Error or an error pointer (s , r ), where in the latter case the following hold: r ≥ r, i.e., the type of the pointer cannot decrease when following a chain of error pointers; if r = 0 = r, then s = s, i.e., the pointers in a chain of error pointers of type 0 are consistently oriented; if r = 1 = r and s ∈ (Prev, j), (Next, j) , s ∈ (Prev, j ), (Next, j ) , then j ≥ j, i.e., when following a chain of error pointers of type 1, the dimension of the pointer cannot decrease; if r = 1 = r and s, s ∈ (Prev, j), (Next, j) for some 1 ≤ j ≤ i, then s = s, i.e., any two subsequent pointers in the same dimension have the same direction.These conditions are clearly locally checkable, so Π i M is a valid LCL problem.

Time complexity
Let M be an LBA, i ≥ 2 an integer, and B the smallest positive integer satisfying n ≤ B i−1 • T M (B).We will only consider LBAs M with the property that B ≤ T M (B) and for any two tape sizes In the following, we prove that Π i M has time complexity Θ(n/B i−1 ) = Θ(T M (B)).

Upper bound
In order to show that Π i M can be solved in O(T M (B)) rounds, we provide an algorithm A for Π i M .Subsequently, we prove its correctness and that its running time is indeed O(T M (B)).Algorithm A proceeds as follows.
First, each node v gathers its constant-radius neighbourhood, and checks whether there is a local error in the grid structure at v, i.e., if constraints given in Section 3.3.2are not satisfied.In that case, v outputs Error.Then, each node v that did not output Error gathers its R-radius neighbourhood, where R = c • T M (B) for a large enough constant c ≥ i, and acts according to the following rules.
If there is a node labelled Error in v's R-radius neighbourhood, then v outputs an error pointer (s, 1) of type 1, where s ∈ {(Prev, j), (Next, j)} has the following property: among all shortest paths from v to some node that outputs Error, there is one where the first edge e on the path has input label L v (e) = s, but, for any j < j, there is none where the first edge e has input label L v (e) ∈ {(Prev, j ), (Next, j )}.Now consider the case that there is no node labelled Error in v's R-radius neighbourhood, but there is a path P from v to itself with the following property: Let L be the sequence of labels read on the edges when traversing P , where for each edge e = {u, w} traversed from u to w we only read the label L u (e).Then there is some 1 ≤ j ≤ i such that the number of occurrences of label (Prev, j) in L is not the same as the number of occurrences of label (Next, j) in L .(In other words, the grid structure wraps around in some way.)Let k be the smallest j for which such a path P exists.Then v outputs an error pointer (s, 0) of type 0, where s = (Next, k).
If the previous two cases do not apply (i.e., the input graph has a valid grid structure and does not wrap around, as far as v can see), then v checks for each dimension 1 ≤ j ≤ i whether in v's R-radius neighbourhood there is both a node that does not have an incident edge labelled (Prev, j) and a node that does not have an incident edge labelled (Next, j).(As we allow arbitrary input graphs, there could be several such node pairs.)For each dimension j for which such two nodes exist, v computes the size d j of the dimension by determining the distance between those two nodes w.r.t.dimension j, i.e., the absolute difference of the j-th coordinates of the two nodes.(Note that v does not know the absolute coordinates, but can assign coordinates to the nodes it sees in a locally consistent manner, and that the absolute difference of the coordinates of those nodes does not depend on v's choice as long as it is consistent.)Here, and in the following, v assumes that the input graph also continues to be a grid graph outside of v's R-radius neighbourhood.Then, v checks whether among these j there is a dimension 2 ≤ j ≤ i with d j ≤ T M (B) that, in case v actually computed the size of dimension 1, also satisfies d j ≤ d 1 .Now there are two cases: 1.If such a j exists, then v chooses the smallest such j (breaking ties in a consistent manner), denoted by k, and computes its coordinate in dimension k.Node v also computes its coordinate in dimension 1 or verifies that it is larger than T M (B).Since v can determine whether it has coordinate 0 in all the other dimensions, it has all the information required to compute its output labels in the M -encoding graph where the execution of M takes place on the surface that expands in dimensions 1 and k.Consequently, v outputs these labels (that is, labels from L encoding , defined in Section 3.4).Note further that, according to the definition of an M -encoding graph, v outputs Exempt M if it verifies that its coordinate in dimension 1 is larger than T M (B), even if it has coordinate 0 in all dimensions except dimension 1 and (possibly) k.Note that if the input graph does not continue to be a grid graph outside of v's R-radius neighbourhood, then neighbours of v might output error pointers, but this is still consistent with the local constraints of Π i M .2. If no such j exists, then, by the definition of B, node v sees (nodes at) both borders of dimension 1.In this case, v can compute the label it would output in a proof of unbalance (that is, a label from L unbalanced , defined in Section 3.3.3),since for this, v only has to determine whether its coordinates are the same in all dimensions (which is possible as all nodes with this property are in distance at most i • T M (B) from the origin).Consequently, v outputs this label.Again, if the input graph does not continue to be a grid graph outside of v's R-radius neighbourhood, then, similarly to the previous case, the local constraints of Π i M are still satisfied.
Proof.We will show that algorithm A solves problem Π i M in O(T M (B)) rounds.It is easy to see that the complexity of A is O(T M (B)).We need to prove that it produces a valid output labelling for Π i M .For this, first consider the case that the input graph is a grid graph.Let 2 ≤ k ≤ i be the dimension with minimum size (apart, possibly, from the size of dimension 1).If , by the definition of B and the assumption that T M (B) ≥ B. In this case, according to algorithm A, the nodes output labels that turn the input graph into an M -encoding graph, thereby satisfying the local constraints of Π i M .If, on the other hand, d k > d 1 , then according to algorithm A, the nodes output labels that constitute a valid proof for unbalanced grids, again ensuring that the local constraints of Π i M are satisfied.must be labelled Exempt M .Thus, a node needs to know if it is at distance T M (B) from the boundary of coordinate 1, which requires Ω(T M (B)) time.

Instantiating the LCL construction
Our construction is quite general and allows to use a wide variety of LBAs to obtain many different LCL complexities.As a proof of concept, in Theorems 3 and 4, we show some complexities that can be obtained using some specific LBAs.Recall that if we choose our LBA M to be a unary k-counter, for constant k, then M has a running time of T M (B) = Θ(B k ), and if we choose M to be a binary counter, then M has a running time of T M (B) = Θ(2 B ).
Proof.Let j > k be positive integers satisfying α = k/j.Given an LBA M with running time Θ(B k ) and choosing i = j − k + 1, we obtain an LCL problem Π i M with complexity Θ(n/B j−k ).We have that n Theorem 4.There exist LCL problems of complexities Θ(n/ log j n), for any positive integer j.
Proof.Given an LBA M with running time Θ(2 B ) and choosing i = j + 1, we obtain an LCL problem Π i M with complexity Θ(n/B j ).We have that n

Complexity gap on trees
In the previous section, we have seen that there are infinite families of LCLs with distinct time complexities between ω( √ n) and o(n).In this section we prove that on trees there are no such LCLs.That is, we show that if an LCL is solvable in o(n) rounds on trees, it can be also solved in O( √ n) rounds.The high level idea is the following.Consider an LCL Π that can be solved in o(n) rounds on a tree T of n nodes, that is, there exists a distributed algorithm A, that, running on each node of T , outputs a valid labelling for Π in sublinear time.We show how to speed this algorithm up, and obtain a new algorithm A that runs in O( √ n) rounds and solves Π as well.
To do this, we show that nodes of T can distributedly construct, in O( √ n) rounds, a virtual graph S of size N n.This graph S will be defined such that we can run A on it, and use the solution that we get to obtain a solution for Π on T .Moreover, for each node of T , it will be possible to simulate the execution of A on S by just inspecting its neighbourhood of radius O( √ n) on T , thus obtaining an algorithm for Π running in O( √ n) rounds.
We will define S in multiple steps.Intuitively, S is defined by first pruning branches of T of small radius, and then pumping (in the theory of formal languages sense) long paths to make them even longer.In more detail, in Section 4.1 we will define the concept of a skeleton tree, where, starting from a tree T we define a tree T where all subtrees of T having a height that is less than some threshold are removed.Then, in Section 4.2, we will prune T even more, by removing all nodes of T having degree strictly greater than 2, obtaining forest T .This new forest will be a collection of paths.We will then split these paths in shorter paths and pump each of them.Intuitively, the pump procedure will replace the middle part of these paths by a repeated pattern that depends on the original content of the paths and on the parts previously removed when going from T to T .Tree S will be obtained starting from the result of the pumping procedure, by bringing back the parts removed when going from T to T .Also, throughout the definition of S we will keep track of a (partial) mapping between nodes of T and nodes of S.
Then, in Section 4.3 we will prove useful properties of S. One crucial property, shown in Lemma 9, will be that, if two nodes in T are far enough (that is, at ω( √ n) distance), then their corresponding nodes of S will be at much larger distance.In Section 4.4 we will use this property to show that we can execute A on S by inspecting only a neighbourhood of radius O( √ n) of T .Notice that we will have conflicting requirements.On one hand, by pumping enough, the size of the graph increases to N n, and A on S will be allowed to run for t = o(N ) rounds, that is, much more than the time allowed on T .This seems to give us the opposite effect of what we want, that is, we actually increased the running time instead of reducing it.On the other hand, we will prove that seeing at distance t on S requires to see only at distance O( √ n) on T , hence we will effectively be able to run A within the required time bound.We will use the output given by A on S to obtain a partial solution for T , that is, only some nodes of T will fix their output using the same output of their corresponding node in S.There will be some nodes that remain unlabelled: those nodes that correspond to the pumped regions of S. Finally, in Section 4.5, we will show that it is possible to complete the unlabelled regions of T efficiently in a valid manner, heavily using techniques already presented in [8].

Skeleton tree
We first describe how, starting from a tree T = (V, E), nodes can distributedly construct a virtual tree T , called the skeleton of T .Intuitively, T is obtained by removing all subtrees of T having a height that is less than some threshold τ .
More formally, let τ = c √ n, for some constant c that will be fixed later.Each node v starts by gathering its τ -radius neighbourhood, Ball v .Also, let d v be the degree of node v in T .For all v ∈ V , we partition nodes of Ball v (excluding v) in d v components (one for each neighbour of v).Let us denote these components with C i (v), where 1 ≤ i ≤ d v .Each component C i (v) contains all nodes of Ball v present in the subtree rooted at the i-th neighbour of v, excluding v.
Then, each node marks as Del all the components that have low depth and broadcasts this information.Informally, nodes build the skeleton tree by removing all the components that are marked as Del by at least one node.More precisely, each node v, for each C i (v), if dist(v, w) < τ for all w in V (C i (v)), marks all edges in E(C i (v)) ∪ {{v, u}} as Del, where u is the i-th neighbour of v.Then, v broadcasts Ball v and the edges marked as Del to all nodes at distance at most τ + 2c.Finally, when a node v receives messages containing edges that have been marked with Del by some node, then also v internally marks as Del those edges.Now we have all the ingredients to formally describe how we construct the skeleton tree.The skeleton tree T = (V , E ) is defined in the following way.Intuitively, we keep only edges that have not been marked Del, and nodes with at least one remaining edge (i.e., nodes that have at least one incident edge not marked with Del).In particular, E = e ∈ E(T ) e is not marked with Del , V = u ∈ V there is a w ∈ V s.t.{u, w} ∈ E .φ Figure 5 An example of a tree T and its skeleton T ; nodes removed from T in order to obtain T are shown in grey.In this example, τ is 3. ψ Figure 6 An example of the tree T obtained from T ; nodes with degree greater than 2 (in blue) are removed from T .Also, we want to keep track of the mapping from a node of T to its original node in T ; let φ : V (T ) → V (T ) be such a mapping.Finally, we want to keep track of deleted subtrees, so let T v be the subtree of T rooted at v ∈ V containing all nodes of C j (v), for all j such that C j (v) has been marked as Del.See Figure 5 for an example.

Virtual tree
We now show how to distributedly construct a new virtual tree, starting from T , that satisfies some useful properties.The high level idea is the following.The new tree is obtained by pumping all paths contained in T having length above some threshold.More precisely, by considering only degree-2 nodes of T we obtain a set of paths.We split these paths in shorter paths of length l (c ≤ l ≤ 2c) by computing a (c + 1, c) ruling set.Then, we pump these paths in order to obtain the final tree.Recall a (α, β) ruling set R of a graph G guarantees that nodes in R have distance at least α, while nodes outside R have at least one node in R at distance at most β.It can be distributedly computed in O(log * n) rounds using standard colouring algorithms [16].
More formally, we start by splitting the tree in many paths of short length.Let T be the forest obtained by removing from T each node v having d T v > 2 (that is, the degree of v in T ).T is a collection P of disjoint paths.Let ψ : V (T ) → V (T ) be the mapping from nodes of T to their corresponding node of T .See Figure 6 for an example.
We now want to split long paths of P in shorter paths.In order to achieve this, nodes of the same path can efficiently find a (c + 1, c) ruling set in the path containing them.Nodes not in the ruling set form short paths of length l, such that c ≤ l ≤ 2c, except for some paths of P that were already too short, or subpaths at the two ends of a longer path (this can happen when a ruling set node happens to be very near to the endpoint of a path of P).Let Q be the subset of the resulting paths having length l satisfying c ≤ l ≤ 2c.See Figure 7 for an example.
In order to obtain the final tree, we will replace paths in Q with longer version of them.
Informally, we will use the function Replace to substitute each path Q ∈ Q with a longer version of it, that satisfies some useful properties.In Section 4.5 we will have enough ingredients to be able to define a function, Pump, that is used to obtain these longer paths.This function will be defined in an analogous way of the function Pump presented in [8,Section 3.8].For now, we just define some properties that this function must satisfy.Definition 6 (Properties of Pump).Given a path Q ∈ Q of length l (c ≤ l ≤ 2c), consider the subgraph Q T of T , containing, for each v ∈ V (Q), the tree T χ(v) (recall that T v is the tree rooted at v containing nodes removed when pruning T , defined at the end of Section 4.1), where χ(v) = φ(ψ(v))), that is, the path Q augmented with all the nodes deleted from the original tree that are connected to nodes of the path.Let v 1 , v 2 be the endpoints of Q.
The function Pump(Q T , B) produces a new tree P T having two nodes, v 1 and v 2 , satisfying that the path between v 1 and v 2 has length l , such that cB ≤ l ≤ c(B + 1).The new tree is obtained by replacing a subpath of Q, along with the deleted nodes connected to it, with many copies of the replaced part, concatenated one after the other.Pump satisfies , have the same view as v 1 , v 2 ∈ G at distance 2r (where r is the LCL checkability radius).Note that, in the formal definition of Pump, we will set c as a function of r.
Let Q T be the set containing all Q T .See Figure 8 for an example of Q T .
The final tree S is obtained from T by replacing each path Q ∈ Q in the following way.Replace each subgraph Q T with P T = Pump(Q T , B).Note that a node v cannot see the whole set Q, but just all the paths Q ∈ Q that end at distance at most τ + 2c from v. Thus each node locally computes just a part of S, that is enough for our purpose.We call the subgraph of Q T induced by the nodes of Q the main path of Q T , and we define the main path of P T in an analogous way.See Figure 9 for an example.
Finally, we want to keep track of the real nodes of S, that will be nodes that have not been removed when creating the skeleton tree T and are also not part of the pumped regions.Nodes of S are divided in two parts, S o and S p .The set S o contains all nodes of T that are not contained in any Q T , and all nodes that are at distance at most 2r from nodes not contained in any Q T , while S p = V (S) \ S o .Let η be a mapping from real nodes of the virtual graph (S o ) to their corresponding node of T (this is well defined, by the properties of Pump), and let Informally, T o is the subset of nodes of T that are far enough from pumped regions of S, and have not been removed while creating T .Note that we use the function η to distinguish between nodes of S and nodes of T , but η is actually the identity function between a subset of shared nodes.This concludes the definition of S, as a function of the original tree T , and two parameters, B and c.Let Virt be the function that maps T to S, that is, S = Virt(T, B, c).See Figure 10 for an example.

Properties of the virtual tree
We will now prove three properties about the virtual graph S. The first one provides an upper bound on the number of nodes of S, as a function of the number of nodes of T .This will be useful when executing A on S. In that case, we will lie to A about the size of the graph, by telling to the algorithm that there are N = c(B + 1)n nodes.This lemma will guarantee us that the algorithm cannot see more than N nodes and notice an inconsistency.time.For this purpose, we adapt some definitions presented in [8], where it is shown that, by starting from a partially labelled graph, if we replace a subgraph with a different subgraph of the same type, then the labelling of the original graph can be completed if and only if the labelling of the new graph can be completed.In our case the subgraphs that we replace are not labelled, and the following definitions handle exactly this case.In the following, unless stated otherwise, we use the term labelling to refer to an output labelling.
We start by defining an equivalence relation * ∼ between two pairs (H, F ) and (H , F ) composed of a graph and its poles.Intuitively, this equivalence relation says that equivalent H and H should be isomorphic near the poles, and that if we fix some output near the poles of one graph, if we copy that output on the other graph (on the isomorphic part), and if that output is completable on the remaining nodes of the first graph, then it should be completable also on the other graph.A partial labelling (a partial function from nodes to labels) is called extendible if it is possible to assign a label to unlabelled nodes such that it is locally consistent for every node, that is, the labelling satisfies the constraints of the given LCL problem at every node.This is a simplified version of the equivalence relation * Q and Q are isomorphic under φ, preserving the input labels of the LCL problem (if any), and preserving the order of the poles.Let L * be any assignment of output labels to vertices in D 1 ∪ D 2 , and let L * be the corresponding labelling of D 1 ∪ D 2 under φ.Then L * is extendible to V (H) if and only if L * is extendible to V (H ).In [8], it is proved that this equivalence relation is preserved after replacing equivalent subgraphs, and that, if the number of poles is constant, there is a constant number of equivalence classes.
Also, in [8, Section 3.6] the following lemma is proved.Informally, it shows that if we have a valid labelling for a graph, and we replace a subgraph with another equivalent to it, it is enough to change the labelling of the new subgraph in order to obtain a valid labelling for the whole new graph.Also, the labelling near the borders is preserved.A labelling is locally consistent for node v if the LCL verifier running on node v accepts that labelling.L is locally consistent for all nodes in D 2 ∪ D 3 .

1:31
We now adapt the definition of the function Pump presented in [8] for our purposes.Intuitively, as previously explained, starting from our tree T we replace all subgraphs Q T ∈ Q T with a pumped version of Q T .Each Q T is composed of a main path in which, for each node, there is a subtree of height O( √ n).Note that Q T is connected to the rest of T on the two endpoints of the main path, thus it has two poles, that implies, as previously discussed, that the number of equivalence classes under * ∼ is constant.This class is also computable by a node, since it considers only the subtrees Q T that are contained in its ball.Also, we can see Q T as a sequence of T v , and the type of a Q T can be computed, as in [8], by reading one "character" (class of T v ) at a time.Finally, we can see the sequence as a string that, if it is long enough, we can pump in order to obtain a longer string of the same type.More formally, consider a tree Q T ∈ Q T .We can see Q T as a path of length k, where each node i is the root of a tree T i (1 ≤ i ≤ k).Let (T i ) i∈ [k] denote this path.Let Class(T j ) be the equivalence class of the tree T j considering j as the unique pole, and let Type(H) be the equivalence class of the path H considering its endpoints as poles.
The following lemma says that nodes can compute the type of the deleted trees rooted on nodes contained in their balls.Lemma 13.Each node u can determine the type of T v for all v ∈ Ball u .
Proof.When nodes compute the skeleton tree T , they broadcast all their balls to the nodes inside their balls.Since a tree T v has height O( √ n), it is fully contained in the ball of v, thus all the nodes in the ball of v see the whole tree T v , and can determine its type (it depends only on the structure of T v and the inputs of the nodes in this tree).
The following is a crucial lemma proved in [8,Section 3.8].As shown in [8], Lemma 14 allows us to bring classic automata theory into play.By Lemma 13, nodes can know the type of each T i contained in a path that they want to pump.Consider a path H = (T i ) i∈ [k] , and the sequence C = (c 1 , . . ., c k ), where c i is Class(T i ).A finite automaton can determine the type of H by reading one character of C at a time.The number of states in this automaton is constant, let pump be such a constant.The following lemma holds [8,Lemma 7]).We finally define the function Pump, that, given a tree Q T having a main path of short length, produces a new tree P T having a main path that is arbitrary longer, such that their types are equivalent.Definition 16 (Pump).Let Q T ∈ Q T , and fix c = pump + 4r.We have that the main path of Q T has length at least pump + 4r.Let us split the main path of Q T in three subpaths p l , p c , p r , two of length 2r near the poles (p l and p r ), and one of length at least pump containing the remaining nodes (p c ). Pump(Q T , B) produces a tree P T such that Type(Q T ) = Type(P T ) and the main path of P T has length l satisfying cB ≤ l ≤ c(B + 1).This is obtained by pumping the subpath p c .By Lemma 15 such a function exists.Since the paths p l and p r are preserved during the pump, the isomorphism near the poles is preserved.

1:32 Almost Global Problems in the LOCAL Model
We now prove that the partial labelling produced by the algorithm previously described can be completed consistently.Consider the tripartition described in Definition 11.Let R be the union of all the replaced subgraphs, and let D 1 , D 2 , D 3 be a tripartition of it as defined in Definition 11.By definition of T o , Λ corresponds to nodes in D 0 ∪ D 1 ∪ D 2 .
First, notice that a node in R sees all the nodes in the regions D 1 and D 2 of the replaced subgraph where it is located, thus it has enough information needed to find a valid output via brute force.
Second, by Lemma 12, in order to show that the partial labelling can be completed consistently, it is enough to show that each replaced Q T is in the same equivalence class as Pump(Q T , B), which is true by the definition of Pump.

Figure 1
Figure1 An example of a correct encoding of an LBA execution in a grid; the horizontal dimension represents time, while the vertical dimension represents the position on the tape.The LBA executes a unary counter, and the marked nodes represent the position of the head.

Figure 2
Figure 2 An example of a 3-dimensional grid graph.

Figure 3
Figure3 An example of an unbalanced grid with 2 dimensions; the nodes in green are labelled with Unbalanced, while the white nodes are labelled with Exempt U .
and v j = 0 for all j ∈ {1, k}.An (output-labelled) grid graph of dimension i is an M -encoding graph if there exist a tape size B and a dimension 2 ≤ k ≤ i satisfying the following conditions.(C1)d k is equal to B − 1. (C2) For all 0 ≤ x ≤ min{T M (B),d 1 } and all 0 ≤ y ≤ B − 1, it holds that: (a) Node (x, y) k is labelled with Tape(t x [y]).(b) Node (x, y) k is labelled with State(s x ).(c) Node (x, h x ) k is labelled with Head.(d) Node (x, y) k is labelled with Dimension(k).(C3) All other nodes are labelled with Exempt M .

1 .
If v does not have an incident edge labelled (Prev, 1), then (a) if v does not have an incident edge labelled (Prev, k), then it must have labels Head and Tape(L); (b) if v does not have an incident edge labelled (Next, k), then it must have label Tape(R); (c) if v has an incident edge labelled (Prev, k) and an incident edge labelled (Next, k), then it has label Tape(b); (d) v has label State(q 0

Figure 4
Figure4 An example of an error pointer chain (shown in red).Nodes that are marked with a red cross are those who actually see an error in the grid structure.The output of only some of the depicted nodes is shown.

Figure 7
Figure 7 Blue nodes break the long paths P of T shown on the left into short paths Q shown in black on the right; short paths (in the example, paths with length less then 4) are ignored.

Figure 8
Figure8 An example of Q T , obtained by merging the path nodes (in black) with previously removed trees connected to them (in red).

Figure 9
Figure 9 Tree S (on the right) is obtained by pumping the black paths.

ηFigure 10
Figure10 Nodes in yellow on the left are the ones in So, while the yellow ones on the right are nodes in To.Note that, for the sake of simplicity, we consider 2r = 1.

Lemma 12 .
Let G = Replace(G, (H, F ), (H , F )). Suppose (H, F ) * ∼ (H , F ). Let D 0 = V (G) \ V (H).Let L be a complete labelling of G that is locally consistent for all vertices in D 2 ∪ D 3 .Then there exists a complete labelling L satisfying the following:L = L for all v ∈ D 0 ∪ D 1 ∪ D 2 and their corresponding vertices in D 0 ∪ D 1 ∪ D 2 .Also, if L is locally consistent for a node v, then L is locally consistent for φ(v).

Lemma 14 .
Let H = (T i ) i∈[k] and H = (T i ) i∈[k+1] be identical to H in its first k trees.Then Type(H ) is a function of Type(H) and Class(T k+1 ).
We will first describe a function, Replace, that can be used to replace a subgraph with a different one.Informally, given a graph G and a subgraph H connected to the other nodes of G via a set of nodes F called poles, and given another graph H , it replaces H with H .This function is a simplified version of the function Replace presented in [8, Section 3.3].Definition 5 (Replace).Let H be a subgraph of G, and let H be an arbitrary graph.The poles of H are those vertices in V (H) adjacent to some vertex in V (G) \ V (H).Let F = (v 1 , . . ., v p ) be a list of the poles of H, and let F = (v 1 , . . ., v p ) be a list of nodes contained in H (called poles of H ). The graph G = Replace(G, (H, F ), (H , F )) is defined in the following way.Beginning with G, replace H with H , and replace any edge {u, v i }, where u