WorksComputer Science
Deterministic Distributed Graph Connectivity Sketching: Beating the Naive Sketch
Abstract
In the distributed graph sketching model, each vertex in the graph is considered as a separate processor. Each vertex is given access to its neighbourhood, and is then responsible for composing a message to a central referee, with the goal being minimising the length of these messages. Classic problems in this model include computing spanning forests, connected components and connectivity of the full graph. In the case where the vertices have to act deterministically, it has long been suspected that the correct upper-bound for computing spanning forests, connected components or connectivity would be the naive method of reporting every edge, which can be done with per-vertex message length of bits. In this paper we show that this is not true for connected components and connectivity, by presenting a protocol that only requires bits per vertex for . We also show that in this setting connected components and connectivity are closely related in the required message length of the vertices. Letting be the minimum required message length in bits per vertex to compute the connected components in a graph with vertices and letting be the minimum message length to compute if the graph is connected, we show that with a multiplicative blow-up in the error probability of .
Introduction
Graph sketching asks how much information about a graph must be retained in order to recover a prescribed global property. We study the distributed graph-sketching model, closely related to the linear graph-sketching framework of Ahn, Guha, and McGregor [1, 2]. The input is a simple undirected graph . Each vertex is viewed as a separate player that knows only its own neighbourhood . Without communicating with the other vertices, every player sends a single message to a central referee, and the referee must compute the desired property of from the labelled collection of messages. The cost of a protocol is the maximum message length, measured in bits, over all vertices and all possible local inputs. Equivalently, this is a simultaneous-message protocol specialised to graph inputs; it is also closely connected to one-round algorithms in the broadcast congested clique [9, 7].
Our focus is connectivity. More precisely, we ask the referee to recover the partition of into the connected components of . This task is stronger than merely deciding whether is connected, but weaker than outputting a spanning forest. It is a natural test case for local sketching: connectivity is determined by the interaction of edges throughout the graph, while no individual vertex likely has enough information to certify the global answer.
The amount of randomness available to the players has a decisive effect on the known bounds. With shared public randomness, the AGM framework gives sketches of bits per vertex from which the referee can recover a spanning forest with high probability [1]. With only private randomness, Holm, King, Thorup, Zamir, and Zwick obtain an -bit protocol [4]. We instead study exact deterministic protocols, in which all encoding maps and the referee are fixed in advance.
A simple deterministic protocol uses bits per vertex. Fix a near-regular orientation of the complete graph on , known to every player and to the referee, and assign each potential edge to its tail. Vertex reports one bit for every potential edge assigned to it, indicating whether that edge is present in . Since the orientation has maximum out-degree , the referee reconstructs the entire graph within this message bound. In [4] the authors observed that this is the best known deterministic bound for producing a spanning forest and asked whether it is optimal.
Our main result shows that the barrier is not inherent for connectivity or connected-component recovery. For , we give an exact deterministic sketch using at most bits per vertex. The construction decomposes the complete graph into carefully balanced copies of . Each such bipartite piece admits a component sketch that is shorter than its raw incidence vector, and the local sketches over all pieces can be concatenated without exceeding the stated budget. The referee first recovers the connected components inside every piece and then takes the transitive closure of these local component relations to obtain the components of the full graph.
This result does not settle the deterministic spanning-forest question, since recovering a component partition need not identify any actual forest edges. It does, however, separate that question from the weaker connectivity tasks and improves the deterministic upper bound for both connectivity and connected-component recovery by a constant factor. We also show that deciding connectivity and recovering all connected components are equivalent up to replacing an -vertex instance by a -vertex instance and worsening the error probability. Thus, at the level of communication complexity, the decision and component-recovery versions are much closer than their output requirements might initially suggest.
Our Results and Technical Overview
We begin by isolating a simple principle that lets us reconstruct global connectivity from connectivity information on a family of smaller subgraphs. Let denote the complete graph on a vertex set , and let specify which potential edges are present. For , write
Lemma 1. Given a complete graph and a covering of the edges , then given the connected components of for each there exists an algorithm computing the connected components of .
Proof. Follows from transitivity of connectivity.
From this, the general goal is to find some decomposition into graphs that are easier to handle than the complete graph of vertices. Our choice of graph is the complete bipartite graph of 3 vertices on the left side and vertices on the right.
Lemma 2. Let be a complete bipartite graph where labels each of the edges either 0 or 1, with and . Then there exist collections of maps for each and for each , and an algorithm such that, given for each vertex , computes the connected components of , where denotes the appropriate map for among and .
Using this protocol, vertices on the left will have to transmit bits, while vertices on the right will only have to transmit 2 bits. Thus, the vertices on the right will save a bit each compared to reporting all 3 incident edges. This is what leads to the improvement in our protocol. The second ingredient is a balanced decomposition of a complete graph into such bipartite subgraphs.
Lemma 3. Let be positive integers, and let be the complete graph on vertices. Then admits a partition into copies of , say with parts , such that every vertex occurs in exactly left parts and exactly right parts.
Taking and means that we are able to apply Lemma 2, thus giving that each vertex occurs 3 times on the left, which contributes bits, while occurring times on the right, contributing bits. The graph we apply this theorem to will have vertices, which is roughly 1/3 of.
Theorem 4. Given a graph with , there exists a collection of maps for with such that given one can uniquely determine the connected components of .
Proof. Let and . First, apply Lemma 3 on with and . This gives a partition of the edges into with and , such that each vertex occurs 3 times as a vertex in some and times as a vertex in some . Now for each vertex , we identify it with some vertex from . Then, let and apply Lemma 2 on each of the edge partitions. Finally, let for some vertex be the combined output of each from the partitions of . Since participates three times in ’s and times in ’s, we observe by Lemma 2 that the total length of the concatenation of messages is
for . One thing to note in this calculation is that to get the 3 on the left side inside the ceiling function, we encode the degrees together. There are then different possible degree triples, which requires bits to encode, resulting in the presented expression. For all vertices of that were not identified with any vertices of , we know all of them are singletons, and so their messages can be easily simulated by the algorithm. Finally, applying Lemma 1 gives the connected components of .
The theorem is primarily of interest because it shows that for computing either connected components or connectivity of a graph, it is possible to have a protocol that performs better than the naive one, which was previously suspected could be optimal. The authors of [4] ask if the naive protocol for producing spanning forest is optimal, and at least for producing connected components, this shows it is not.
As an interesting note, while previous protocols generally have solved spanning forest which gives connected components and connectivity [1, 2, 4], we only solve the problem of connected components. In fact, it is in general not possible to extract a spanning forest from the messages that are transmitted in our protocol.
Finally, we also show that the question of determining the connected components in a graph indeed is equivalent up to a factor 2 in the size of the graph, with a polynomial blow-up in the error rate:
Theorem 5. Let be a randomized neighbourhood-sketching scheme for connectivity. Suppose that, on every graph of vertices, each vertex sends a sketch of at most bits and the referee decides connectivity with error probability at most .
Then there is a randomized neighbourhood-sketching scheme that, on every -vertex graph, outputs its connected components using sketches of length at most and with error probability at most
In particular, connectivity sketches with error probability of at most yield connected-component sketches with error probability of at most .
Another way to frame this result is that if we let denote the minimum message length required per vertex to compute the connected components of graphs with vertices and let be the minimum message length required to compute whether the graph is connected, then with a multiplicative blow-up in the error probability of .
The proof of this statement is shown by having the vertices of the graph compose messages as if the graph has double size, and each vertex is connected to some mirror vertex, that doesn’t exist in the original graph. The referee can then connect the mirror vertices as they want and simulate the resulting messages, and then query the connectivity algorithm on these messages.
Related Work
Public Randomness. As mentioned previously, graph sketching has been studied in various settings related to randomness. In the setting where all vertices have access to shared randomness, the framework by Ahn, Guha, and McGregor [1, 2] allow each vertex to send messages of length at most bits per vertex for the purpose of computing a spanning forest. Their sketch however only works in the case that the vertices need to have access to a shared source of randomness. This is due to the fact that they employ coordinated sampling of edges, which need to match between vertices.
Later Nelson and Yu [6] showed that this was tight for computing spanning forests, requiring bits on average per vertex. This was subsequently strengthened by Yu [9] to show that this lower bound even holds for the problem of determining if the graph is connected. Both of these results rely only on public randomness, and as such it remains open if restricting to private randomness or deterministic protocols could strengthen the lower bounds.
Private Randomness. The reliance on public randomness was subsequently removed in exchange for significantly larger message sizes by Holm, King, Thorup, Zamir, and Zwick [4]. They showed that by having each vertex sample neighbours independently of each other, and report these, only edges remain between the connected components induced by the reported edges. The remaining edges could then be determined using error-correcting coding related techniques.
Deterministic protocols and lower bounds. The straightforward deterministic protocol fixes a balanced orientation of and has each vertex report the presence or absence of the potential edges assigned to it, using at most bits per vertex. The authors of [4] noted that no better deterministic protocol was known for producing a spanning forest and asked whether this bound is optimal. Our result beats this bound for the weaker task of recovering the connected-component partition, but it does not identify a spanning forest.
For ordinary connectivity, Yu’s public-coin lower bound remains the strongest general lower bound and, as noted above, also holds for deterministic protocols [9]. A polynomial lower bound for deterministic connectivity is still open [3]. Robinson and Tan recently obtained the first super-polylogarithmic deterministic lower bound for a connectivity decision problem: deciding -edge connectivity requires worst-case messages of bits for every super-constant [8]. This result does not yield a polynomial lower bound for the ordinary case.
Finally, a similar reduction between connected components and connectivity has previously been shown by Lizama and Rapaport [5]. Using a construction with a number of similarities with our reduction, they showed that if is the minimum message length required to compute the number of connected components, then . Their bound, however only holds for protocols that are either deterministic or have exponentially small error probability.
Bipartite graph
In the following lemma, for the set of edges let denote the edges labelled with 1 by . If instead we are considering the set of neighbours of some vertex , we let be the set .
Lemma 2. Let be a complete bipartite graph where labels each of the edges either 0 or 1, with and . Then there exist collections of maps for each and for each , and an algorithm such that, given for each vertex , computes the connected components of , where denotes the appropriate map for among and .
Proof. Let , with indices taken modulo 3. For , let
This requires possible values. For , put . If , output 0. Otherwise, if there is an such that
output such an . Finally, if , output 3. Thus, each right vertex sends one of four possible messages.
We first describe the reconstruction under the simplifying assumption that no right vertex has degree 3, i.e. for all . Let
be the message of , and let
for be the number of vertices reporting message . Vertices with message 3 are isolated.
Under the assumption , the messages have the following meaning:
| message | possible neighbourhoods |
| 0 | |
| 1 | |
| 2 | |
| 3 |
Table 1.
Hence has a common neighbour with iff some message-1 vertex is also adjacent to , which occurs iff
Similarly, has a common neighbour with iff
and has a common neighbour with iff
Thus the messages determine the graph on whose edges record which pairs of vertices in have a common neighbour in . The connected components of this auxiliary graph are exactly the connected components of restricted to . Finally, each with message is adjacent to , so belongs to the component of . Vertices with message 3 are isolated. Hence, the components are determined.
It remains only to drop assumption of there being no degree 3 right vertices. We will use the exact same decoding process, and argue that it is still correct. If some right vertex has degree 3, then it is adjacent to all of , so all three vertices of lie in the same connected component. Such vertices are encoded by message 0, which is harmless: the above reconstruction may only underestimate pairwise connections inside , but the presence of a degree-3 vertex forces all of into one component. If we consider the previous analysis however, we see that any degree 3 vertex implies that and , and so all vertices from are determined to belong to the same connected components.
Consequently, the collection of messages uniquely determines the connected components of .
Covering a complete graph
In this section, we are going to show how to partition the edges of our graph into the bipartite subgraphs required by Lemma 2. We will show a simple explicit way to do this with the following lemma.
Lemma 3. Let be positive integers, and let be the complete graph on vertices. Then admits a partition into copies of , say with parts , such that every vertex occurs in exactly left parts and exactly right parts.
Proof. Let and identify with . Define
Then , , and . Moreover, the differences , with and , are precisely with each value occuring once. For each , let
and let be the edge set of the complete bipartite graph between and . We claim that the sets , , partition the edges of .
Given an edge , orient it so that
with . By the preceding paragraph there is a unique pair with . Then with we have
The same uniqueness of also shows that this representation is unique, and hence the are pairwise disjoint and cover all edges.
To show the correct number of occurrences in each left and right part, a fixed vertex lies in exactly for the values with , and lies in exactly for the values with . Thus the required incidence condition holds.
:::
Equivalence between connected components and connectivity
Finally, we will show that computing connectivity is essentially as hard as computing connected components. This is mostly relevant from the perspective of lower bounds, since it means that it is enough for most use-cases to only consider lower bounds for connected components, and then lower bounds for connectivity will immediately follow.
Theorem 5. Let be a randomized neighbourhood-sketching scheme for connectivity. Suppose that, on every graph of vertices, each vertex sends a sketch of at most bits and the referee decides connectivity with error probability at most .
Then there is a randomized neighbourhood-sketching scheme that, on every -vertex graph, outputs its connected components using sketches of length at most and with error probability at most
In particular, connectivity sketches with error probability of at most yield connected-component sketches with error probability of at most .
Proof. For a labelled vertex set , write for the random sketch produced by vertex when its neighbourhood is . Let , let be a disjoint copy of , and set . Each vertex sends
This sketch has length at most . For any , let
and define
The neighbourhood in of every original vertex is exactly the one used in Equation (1), independently of . Moreover, the referee knows the neighbourhood of every copied vertex:
It can therefore generate the sketches of all vertices in and run the connectivity decoder for on .
Contracting the edges gives
Thus the received sketches give the referee a randomized connectivity oracle for every graph , with error at most per query.
Fix any spanning tree on the labelled set . Starting with , process its edges one at a time, deleting whenever the oracle says that remains connected. If all answers are correct, the resulting is inclusion-minimal subject to being connected. After contracting each connected component of , the edges of therefore form a tree. In particular,
It remains to identify the cut associated with each . Removing from produces exactly two connected components, say and , with and . For every , query whether
is connected. The answer is yes exactly when , so these queries recover the cut . Assign each vertex the signature
Two vertices have the same signature if and only if they belong to the same connected component of : vertices in one component cannot be separated by deleting an edge of , while any two distinct contracted components are separated by some edge of the tree formed by . Hence, the signatures determine the connected-component partition.
The reverse-deletion step uses oracle queries, and recovering the cuts uses at most more. Thus an error-free execution makes at most
queries. Although the queries are adaptive, before the first incorrect answer they coincide with the fixed error-free execution. A union bound over the possible first erroneous query therefore gives failure probability at most
Finally, if , then
Acknowledgements
Both authors were supported by VILLUM Foundation Grant 54451, Basic Algorithms Research Copenhagen (BARC).
D.R.L was supported by the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (Grant agreement No. 101019564).
For open access purposes, the authors have applied a CC BY public copyright license to any author-accepted manuscript version arising from this submission. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Neither the European Union nor the granting authority can be held responsible for them.
References
- [1][AGM12a] Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. Analyzing graph structure via linear measurements. In Proceedings of the 2012 Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 459–467, 2012.
- [2][AGM12b] Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. Graph sketches: sparsification, spanners, and subgraphs. In Proceedings of the 31st ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS ’12, page 5–14, New York, NY, USA, 2012. Association for Computing Machinery.
- [3][Ass22] Sepehr Assadi. Lower bounds for distributed sketching. 11th Workshop on Advances in Distributed Graph Algorithms (ADGA), 2022. Slides available online.
- [4][HKT+19] Jacob Holm, Valerie King, Mikkel Thorup, Or Zamir, and Uri Zwick. Random k-out subgraph leaves only o(n/k) inter-component edges. In 2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS), pages 896–909, 2019.arxiv.org/abs/1909.11147
- [5][LR22] Antonio Lizama and Ivan Rapaport. Connectivity and Connected Components in the Number-in-Hand Computation Model, pages 71–74. Springer International Publishing, Cham, 2022.DOI
- [6][NY19] Jelani Nelson and Huacheng Yu. Optimal lower bounds for distributed and streaming spanning forest computation. In Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’19, page 1844–1860, USA, 2019. Society for Industrial and Applied Mathematics.arxiv.org/abs/1807.05135
- [7][Rob23] Peter Robinson. Distributed Sketching Lower Bounds for k-Edge Connected Spanning Subgraphs, BFS Trees, and LCL Problems. In Rotem Oshman, editor, 37th International Symposium on Distributed Computing (DISC 2023), volume 281 of Leibniz International Proceedings in Informatics (LIPIcs), pages 32:1–32:21, Dagstuhl, Germany, 2023. Schloss Dagstuhl – Leibniz-Zentrum für Informatik.DOI
- [8][RT26] Peter Robinson and Ming Ming Tan. Deterministic lower bounds for k-edge connectivity in the distributed sketching model. Proc. ACM Manag. Data, 4(2), May 2026.arxiv.org/abs/2507.11257
- [9][Yu21] Huacheng Yu. Tight distributed sketching lower bound for connectivity. In Proceedings of the 2021 ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 1856–1873, 2021.arxiv.org/abs/2007.12323