A Note on Diameter Certification in Trees Josef Erik Sedláček # Faculty of Information Technology, CTU in Prague, Prague, Czech Republic
Abstract In the local certification model, certifying the diameter of general graphs requires large certificates, but trees admit more efficient solutions. In this note, we provide a 1-local certification scheme that certifies whether the diameter of a given tree is at most d using certificates of at most 3⌈log2 (d + 1)⌉ bits. 2012 ACM Subject Classification Theory of computation → Distributed algorithms; Theory of computation → Graph algorithms analysis Keywords and phrases local certification, locally checkable proofs, proof-labeling schemes, graph diameter, trees
arXiv:2607.09929v1 [cs.DC] 10 Jul 2026
Funding This work was supported by the Grant Agency of the Czech Technical University in Prague, grant No. SGS23/205/OHK3/3T/18.
1
Introduction
Local certification and network structure This note focuses on local certification, a framework in distributed computing used to verify global properties of a network. In this context, the network topology is naturally modeled as a graph G = (V, E), where vertices represent the computing nodes and edges represent the communication links. We are interested in checking global graph properties such as acyclicity, planarity and bounded diameter. Since vertices typically only have a local view of their immediate neighborhood, most global properties cannot be verified without external assistance. For example, a vertex cannot determine if the entire graph is bipartite just by communicating with its direct neighbors. To overcome this limitation, the local certification model [4] has been introduced. In this model, a centralized oracle (the prover) assigns a label, called a certificate, to each vertex. The vertices then communicate with their neighbors up to a constant radius and decide whether to accept or reject the configuration. Returning to the bipartiteness example, the prover could simply assign a color {1, 2} to each vertex as its certificate. A vertex accepts if all of its neighbors have a certificate of a different color from its own. A certification scheme is correct if there exists a certificate assignment that makes all vertices accept when the property holds, and for any assignment, at least one vertex rejects when the property does not hold. The primary measure of efficiency in this setting is the certificate size. Specifically, we consider the maximum size of a certificate over all vertices in the graph, measured in bits, and the objective is to minimize this maximum size. The threshold of Θ(log n) bits, where n is the number of vertices, has emerged as the standard baseline for compact local certification [7]. This size is significant because it enables the certification of structures like spanning trees. This general verification mechanism can be formalized through various models, most notably proof-labeling schemes [8] and locally checkable proofs [7]. While these settings typically assume that each vertex is equipped with a unique piece of information called an identifier of size O(log n) bits, in this note we operate in the more restrictive anonymous model, meaning that vertices do not possess any identifiers. Note that since our goal is to establish an upper bound, presenting a scheme for a model without identifiers yields a
2
A Note on Diameter Certification in Trees
stronger result, as the correctness and size bounds immediately carry over to settings where identifiers are available. For a comprehensive overview of these different certification models and their variants, we refer the reader to [4]. In this note, our main objective is to certify that the diameter of a given tree is at most a constant d. The classical approach to local certification often considered general graphs. It has been proven that certifying that the diameter of a general graph is at most d requires certificates of size Ω̃(n) bits per vertex [1]. Recent research has shifted towards designing optimized certification schemes for restricted graph classes. By leveraging the underlying topology, the required certificate sizes can be reduced. For example, while earlier works established tight bounds for local properties in bipartite graphs [7], recent developments have provided schemes for leader election in chordal and grid graphs whose size is logarithmic in the diameter [6], as well as constant-size leader certification in meshed graphs [2]. Contributing to this line of research, we focus on tree topologies, providing a simple, and compact scheme for diameter verification.
Meta-theorems and MSO logic A highly successful approach in understanding the capabilities of local certification on restricted graph classes has been the establishment of meta-theorems, inspired by Courcelle’s theorem in centralized computing. Bousquet, Feuilloley, and Pierron [5] proved that on tree topologies, any graph property expressible in Monadic Second-Order (MSO) logic can be certified with certificates of size O(1) (Theorem 2.2 in [5]). This meta-theorem has direct implications for the certification of the diameter of a graph. For any fixed integer d, the property that a graph has diameter at most d can be easily expressed in First-Order (FO) logic by quantifying over all pairs of vertices and asserting the existence of a path of length at most d between them. Therefore, as a direct corollary of the meta-theorem by Bousquet et al., certifying that a tree has diameter at most d can be done with O(1) bits with respect to the number of vertices n.
Motivation for our result While the aforementioned MSO meta-theorem completely resolves the asymptotic complexity of diameter certification on trees with respect to n, the underlying framework is highly generic and complex. Rather than offering a direct solution for this specific problem, the automata-theoretic approach hides the dependency on the parameter d inside constants that grow rapidly with the quantifier depth of the formula. In this note, we show that one does not need to invoke heavy machinery to certify the diameter on trees. We present a completely explicit, simple, and direct 1-local certification scheme.
Our Contribution We contribute to this line of research by providing a direct certification scheme for the diameter of trees, explicitly bounding the certificate size in terms of d. Specifically, we establish the following result: ▶ Theorem 1. For tree graphs, there exists a 1-local certification scheme (f, A) of size 3⌈log2 (d + 1)⌉ that accepts a tree T if and only if the diameter of T is at most d. Our approach relies on simulating two runs of a Breadth-First Search (BFS) directly encoded within the certificates. By assigning distance values from chosen endpoints of a
J. E. Sedláček
longest path in the tree, vertices can verify the diameter threshold locally. While local certification results typically focus only on asymptotic complexity, the simplicity of our construction allows us to optimize the scheme down to the exact bit. We demonstrate that a small multiplicative factor of 3 suffices, providing a precise alternative to the general MSO meta-theorem.
2
Model, definitions and notation
All graphs in this paper are undirected, connected, simple graphs, denoted by G = (V, E). Let n denote the number of vertices and d the diameter of the graph. Usually, the vertices are assigned unique identifiers encoded on O(log n) bits, but in this paper we assume the anonymous version, where no identifiers are assigned to vertices. Neighbors of a vertex v are denoted as NG (v), and if G is clear from the context, N (v) is used. Distance between two vertices u, v is denoted as dG (u, v), and the subscript is omitted if G is clear from the context. Let V [v, r] denote the set of vertices at distance at most r from v, which we call the r-local neighborhood of v. A graph property is formally a set of graphs that is closed under isomorphism. A certificate assignment P for G is a function P : V (G) → {0, 1}∗ that associates with each vertex a certificate. We say that P has size s if |P (v)| ≤ s(n) for every v. A verifier is a function that takes as an input a graph G, its certificate assignment P and v ∈ V (G) and outputs either 0 or 1. The subgraph G[V [v, r]] is denoted as G[v, r] and the restriction of P to V [v, r] is denoted as P [v, r], that is P [v, r] : V [v, r] → {0, 1}∗ . A verifier A is r-local if A(G, P, v) = A(G[v, r], P [v, r], v) for all G, P , and v. An r-local certification scheme certifying a property of graphs P is a pair (f, A), where A is an r-local verifier and f , called the prover, assigns to each G ∈ P a certificate assignment P such that the following properties hold. Completeness: If G ∈ P, then A(G[v, r], P [v, r], v) = 1 for all v, where P = f (G). Soundness: If G ∈ / P, then for every certificate assignment P ′ , there is v such that A(G[v, r], P ′ [v, r], v) = 0. We say that (f, A) has size s : N → N if |f (G)(v)| ≤ s(|V (G)|) for all G ∈ P and all v ∈ V (G).
3
Diameter certification on trees of size 3⌈log2 (d + 1)⌉
In this section, we prove the following theorem ▶ Theorem 1. For tree graphs, there exists a 1-local certification scheme (f, A) of size 3⌈log2 (d + 1)⌉ that accepts a tree T if and only if the diameter of T is at most d. Let us first describe the scheme, namely the prover strategy on yes-instances and the verification at the vertices. Let T be a tree with diameter at most d and P = f (T ) be the certificate assignment for T . For every v ∈ V , the certificate P (v) is a triple (d1 , m1 , d2 ): d1 = d(r1 , v), the distance to r1 from v, where r1 is an arbitrarily selected unique vertex. A number m1 = maxv∈V (d(v, r1 )), the maximum distance to vertex r1 across all v ∈ V . d2 = d(r2 , v), where r2 is a unique vertex with d(r2 , r1 ) = m1 chosen arbitrarily among all the vertices u ∈ V such that d(u, r1 ) = m1 .
3
4
A Note on Diameter Certification in Trees
Let d1 (v), m1 (v), d2 (v) denote the components of P (v) for a given vertex v. Verification at a vertex v acts as a local consistency check. The algorithm evaluates a series of conditions and if any of these conditions are met, indicating an invalid or inconsistent certificate assignment, the verifier A(v) immediately rejects. If the configuration passes all checks without triggering a rejection, the vertex accepts. Specifically, verification on a vertex v consists of the following steps: 1. For i ∈ {1, 2} if: a. di (v) = 0 and there exists u ∈ N (v) di (u) ̸= 1, or b. di (v) = k for some k and there is not exactly one u ∈ N (v) such that di (u) = k − 1, or c. di (v) = k for some k and there is u ∈ N (v) such that di (u) < k − 1 or di (u) > k + 1, or d. di (v) > d the verifier A(v) rejects. 2. If there exists u ∈ N (v) : m1 (v) ̸= m1 (u), the verifier A(v) rejects. 3. If d1 (v) > m1 (v), the verifier A(v) rejects. 4. If d2 (v) = 0 and d1 (v) ̸= m1 (v), the verifier A(v) rejects. 5. Otherwise, A(v) accepts. Proof of Theorem 1. First, we show that if a graph is accepted, it must have diameter at most d. Proof of ⇒: The correctness of the diameter follows from the classical two-phase BFS algorithm for computing the diameter of a tree [3]. Specifically, a BFS from an arbitrary vertex yields a farthest vertex r1 , and a subsequent BFS from r1 returns a vertex r2 maximizing the distance from r1 , which is equal to the diameter of the tree. We thus only need to show that for any vertex v, it holds that d1 (v) = d(v, r1 ) and d2 (v) = d(v, r2 ), and that the value m1 (v) is the same for all vertices and equal maxu d1 (u), where u is a vertex. Let us start with the value of m1 . Assume there are two vertices v, u such that m1 (u) ̸= m1 (v). Consider the path from u to v. Somewhere on the path, there must be a vertex x, where the value m1 (x) = m1 (u), but for the next vertex y on the path m1 (y) ̸= m1 (x). The verifier A(x) would reject according to the condition 2. If m1 (v) < maxu∈V (d(u, r1 )), then there is a vertex x such that d(x, r1 ) > m1 (v) and A(x) would reject according to the condition 3. If m1 (v) > maxu∈V (d(u, r1 )), then there is no vertex x such that d(x, r1 ) = m1 (x) and thus also no vertex such that d1 (x) = m1 (x). Because of that, there cannot be a vertex such that d2 (x) = 0, which means there is a vertex y with no neighbor z ∈ N (y) with d2 (z) = d2 (y) − 1. The verifier A(y) would reject according to the condition 1(b). For the converse implication, we show that any yes-instance is always accepted. Proof of ⇐: The component d1 is the distance from the origin vertex r1 . In trees, it holds that for any vertex with the exception of r1 there always is one neighbor closer to r1 and the others are further away. The same holds for d2 and r2 , which represent the second run of BFS on the tree. Thus, the rejection criteria of condition 1 are not met at any vertex. The component m1 is set to the maximum value of d1 . Each vertex receives the same values. The rejection criteria of conditions 2, 3, and 4 are thus also not met. As the diameter of the tree is d, all the components d1 , m1 , d2 can be represented with ⌈log2 (d + 1)⌉ bits and hence the certification scheme is of size 3⌈log2 (d + 1)⌉.
J. E. Sedláček
We have thus shown that the 1-local certification scheme (f, A) of size 3⌈log2 (d + 1)⌉ accepts a tree if and only if it has diameter at most d. ◀ Our direct construction optimizes the hidden constants of general logic-based metatheorems down to a precise multiplicative factor of 3. This leaves an open question regarding the exact bit complexity of diameter verification on trees: What is the smallest constant c such that c log2 d + O(1) bits are both necessary and sufficient? Determining whether our upper bound of 3 can be further reduced, or establishing a matching lower bound for anonymous networks, remains unresolved. References 1
2
3 4 5
6
7 8
Keren Censor-Hillel, Ami Paz, and Mor Perry. Approximate proof-labeling schemes. Theoretical Computer Science, 811:112–124, 2020. Special issue on Structural Information and Communication Complexit. Jérémie Chalopin, Victor Chepoi, and Maria Kokkou. Distance-based certification for leader election in meshed graphs and local recognition of their subclasses. CoRR, abs/2602.12894, 2026. Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms. MIT Press, 4th edition, 2022. Laurent Feuilloley. Introduction to local certification. Discret. Math. Theor. Comput. Sci., 23(3), 2021. Laurent Feuilloley, Nicolas Bousquet, and Théo Pierron. What can be certified compactly? compact local certification of MSO properties in tree-like graphs. In Alessia Milani and Philipp Woelfel, editors, PODC ’22: ACM Symposium on Principles of Distributed Computing, Salerno, Italy, July 25 - 29, 2022, pages 131–140. ACM, 2022. Laurent Feuilloley, Josef Erik Sedláček, and Martin Slávik. Proving there is a leader without naming it. In Chryssis Georgiou, editor, Structural Information and Communication Complexity, pages 331–350, Cham, 2026. Springer Nature Switzerland. Mika Göös and Jukka Suomela. Locally checkable proofs in distributed computing. Theory Comput., 12(1):1–33, 2016. Amos Korman, Shay Kutten, and David Peleg. Proof labeling schemes. Distributed Comput., 22(4):215–233, 2010.
5