Manuscript Offprint
arXiv:2611.12619Better Bounds For Graph Reconstruction
Abstract
The goal in graph reconstruction problems is to learn an initially unknown graph using only a few queries of a specific type. Possibly the most natural query type is retrieving the distance between any two vertices of a connected, undirected, and unweighted graph. For a bounded-degree graph on vertices, Kannan, Mathieu, and Zhou [TALG 2018] showed a randomized algorithm that uses only such queries. On the lower bound side, it is only known that any randomized algorithm needs queries. We make a significant step forward to bridging these bounds by designing a randomized algorithm that uses queries. This requires extending the original approach based on Voronoi diagrams into a recursive procedure that partitions a cell into smaller cells. While such a recursive approach has been used in the related graph verification problem, in the more general graph reconstruction problem we need to operate without knowing the graph, which requires a new (and more technical) approach.
1 Introduction
Consider a large unknown graph on vertices that can only be accessed by querying for the distance between any two vertices. We want to reconstruct the whole graph with only a few such queries. This naturally captures the setting where the queries are slow or expensive. We stress that we want to minimise the number of queries, and do not concern ourselves with the time necessary to actually reconstruct the graph based on the answers (nor the time to figure out which query should be asked next). However, ideally it should be polynomial in the size of the graph.
There are at least two interesting scenarios in which we might be interested in such a task. First, we have the network reconstruction problem [ACKM09, BEE⁺06, DAB⁺06, TLP09], in which we want to recover a hidden network topology using a tool such as traceroute. Second, we have the evolutionary tree recovery problem [RS07b, KZZ03, Hei89, WSSB77], in which we want to recover a hidden evolutionary tree by computing similarities between some species.
Reyzin and Srivastava [RS07a] provided an elementary information-theoretical argument establishing that reconstructing a general (connected, undirected, and unweighted) graph on vertices requires queries. The lower bound already holds for a constant-depth tree. However, the difficult instance contains a root of degree . This motivated Kannan, Mathieu, and Zhou [KMZ18] to consider the more restricted but still well-justified from the point of view of the above applications case of bounded-degree graphs. Under such an assumption, they showed that queries are always sufficient in expectation to recover the graph (that is, the algorithm always correctly recovers the graph, and the number of queries is a random variable with the expected
*Partially supported by the Polish National Science Centre grant number 2023/51/B/ST6/01505. ¹In this paper, denotes .
value upper bounded by ). However, they were only able to show that queries are necessary for such graphs. For random regular graphs (with small degree), Mathieu and Zhou [MZ23] showed that queries are enough (and, in fact, the same simple procedure recovers an arbitrary bounded-degree graph with queries). Krivelevich and Zhukovskii [KZ25] considered the same question in the more standard binomial random graph model and obtained both lower and upper bounds parameterized by the density. Kannan, Mathieu, and Zhou [KMZ18] considered the reconstruction problem for chordal and outerplanar graphs, showing that in both cases queries are enough (see also [RLYW21] for better bounds for chordal graphs). Bastide and Groenland [BG25] considered the reconstruction problem for trees, chordal graphs, and graphs with bounded treelength, obtaining tight results. Interestingly, they were able to establish that any randomized algorithm requires queries to reconstruct a bounded-degree tree on nodes, which remains the highest known lower bound for this problem, leaving a large gap between the lower bound of and the upper bound of . Eppstein, Goodrich, and Liu [EGL25] considered reconstructing graphs with small BFS width, and Kaudan and Nayyeri [KN26] considered reconstructing graphs with bounded cutwidth.
Kannan, Mathieu, and Zhou [KMZ18] showed that natural greedy algorithms are enough to recover the graph with queries that return not only the distance but the actual shortest path, and to verify a given graph with distance queries. This suggests that perhaps queries are enough to recover an arbitrary bounded-degree graph with distance queries, but decreasing the upper bound of remains an important open problem in this area.
In an attempt to understand the limitations of the known algorithms for reconstructing a graph with distance queries, Abrahamsen, Bodwin, Rotenberg, and Stöckel [ABRS16] introduced the weaker betweenness queries, which given three vertices return whether lies on a shortest path between and . Surprisingly, they were able to show a randomized algorithm that uses only queries. This suggests that improving the bound on the number of distance queries should exploit the actual distances.
Our results We design an algorithm that recovers an arbitrary bounded-degree graph on vertices with only distance queries in expectation. More formally, we show the following theorem.
Theorem 1.1. There is a randomized algorithm that, given access to a connected -vertex graph in which every vertex has degree at most through queries that return the distance between any two vertices, recovers the graph using queries in expectation.
In particular, for this is .
We stress that we will measure the complexity of all algorithms only in the number of queries. However, it is actually not difficult to verify that our algorithm can be implemented efficiently, that is, in polynomial time. Further, when presenting some of the procedures we will only show that the claims on their correctness and running time hold with constant probability. However, in every recursive call the procedures will be repeated until they achieve the desired guarantees on the sizes of the cells, so in fact the whole algorithm is Las Vegas.
Related work There is a vast body of work concerned with reconstructing an -vertex graph with queries of different types. Perhaps the simplest are independent set queries [GK98], where we can query whether, for a set of vertices , the subgraph induced by contains at least one edge. It is known that in this model queries per edge suffice [AC08]. The more powerful additive queries return the number of edges in the subgraph induced by , allowing one to achieve an asymptotically optimal bound for dense [GK00] and sparse [CK08] graphs, and also some restricted classes of graphs [ABK⁺04]. Queries that return the number of connected components [BMSX25] or an adversarially chosen maximal independent set [KOT25] have also been considered. Another example is cut queries that, for two disjoint sets of vertices and , return the number of edges with one endpoint in and the other in . However, such queries are usually considered in the context of connectivity (for example, computing the global min cut, or the cut) [RSW18, AEG⁺22, JNS26, KK26, KK25, LSZ21]. A separate line of work concerns edge queries, see [LY91] for a thorough introduction.
Distances For two vertices we write to denote the distance between and in the whole . For a vertex and a set of vertices we write to denote the distance between and in the whole , defined as the minimum of over all .
Neighborhoods We use the following notation for the neighborhood and 2-neighborhoods of a vertex , respectively: and .
Queries We assume that and are both known to the algorithm (as observed in some of the prior work, the latter assumption is not strictly necessary, as if the number of queries significantly exceeds our estimate then we can restart the algorithm while doubling the value of ). No other information about the graph is given, but we can query for the distance between any two vertices . Such a query is denoted by . We can also query for the distances between any vertex and all vertices in , which is denoted by . We stress that the cost of such a query is . Similarly, we can query for the distances between any vertex in and any vertex in , which is denoted by . The cost of such a query is .
Clusters For a set we define the cluster of a vertex with respect to a set of vertices as . We will often talk about the vertices with large clusters, defined as (where is a parameter).
Sampling For a parameter and a set of vertices we write to denote sampling each vertex from with probability . Sometimes we will need slightly different distributions, namely sampling a uniformly random set (or multi-set) of exactly vertices.
Probabilistic tools As usual, for a random variable we write to denote its expected value. We need the following standard multiplicative form of the Chernoff bound: for any random variable equal to the sum of independent 0-1 random variables, we have:
for any .
3 Technical Overview
The trivial quadratic algorithm uses the observation that two vertices are connected by an edge if and only if the distance between them is equal to 1. We refer to this approach as an exhaustive search. We perform it only on sufficiently small subsets.
Rather than focusing on the whole graph, we try to find the edges induced by a particular subset . Extending the work done by Kannan, Mathieu, and Zhou [KMZ18], we are going to design a recursive algorithm that aims to reduce searching for the edges induced by a subgraph to searching in a few smaller induced subgraphs. In contrast to [KMZ18] where the graph is partitioned only once, our approach allows for arbitrary induced subgraphs, which enables the use of recurrence. In fact, the procedures shown in this section were initially presented for . However, the analysis for a general remains the same so we present it in this more general setting. While these procedures are not sufficient to design a recursive algorithm, they are necessary to understand our approach. The proof of the generalized (to ) procedure is only a minor modification of the proof of THEOREM 3.1 from [TZ01], already discussed in the analysis of ALGORITHM 4 from [KMZ18].
Covering the graph induced by with smaller subgraphs relies on the concept of Voronoi cell decomposition. The polynomial time algorithm which ensures that smaller subgraphs have bounded size was designed by Thorup and Zwick [TZ01] and extended to the distance oracle model by Kannan, Mathieu, and Zhou [KMZ18].
3.1 Voronoi cells
Consider a subset and a subset called the set of centers. Observe that we do not require . In fact, it is crucial for the algorithm that some centers are outside . Similarly to the Voronoi diagram on the plane, we try to cover the vertices of by regions. Each region is represented by a vertex and consists of vertices for which is roughly the closest vertex in . This should be done in a way that covers all edges in the subgraph induced by to allow us to recurse on each cell. Formally, the following two characterizations of Voronoi cells will be used. The vertex belongs to the cell centered at if either of the two equivalent conditions is satisfied:
The second condition is more intuitive: it says that the cell of contains vertices for which is almost the closest vertex from . The equivalence follows from considering a vertex which is on the shortest path from to at distance 2 from . Although the latter characterization is more similar to the concept of a Voronoi diagram, we will mostly use the former. It gives us control over the size of each cell by controlling the sizes of . The definition implies that, in particular, a vertex may belong to more than one cell. Henceforth, when we refer to partitioning or dividing a subset we actually mean covering all edges in the subgraph induced by a subset with smaller overlapping Voronoi cells. Note that if we want to cover each edge of , the intersections of some cells have to be nonempty.
From the second condition, it can easily be seen that for every edge with there exists a cell that contains both and , without any assumptions on . Specifically, if and is closest to then belong to the cell of (which is why we have the +1 in the second condition). Therefore, to obtain a subquadratic algorithm, it suffices to find the set of centers that divides into Voronoi cells of “small” sizes and for each of them perform the exhaustive search. We can define “small” formally. Let . Since each vertex in belongs to at least one cell, the size of the largest cell must be at least . Hence, we can hope for cells of sizes . We will show in the next subsection that this can be achieved using a randomized algorithm.
If the set of centers is known, the pairwise distances between and are all that is needed to find the cells. This follows directly from the second condition in the definition of cells. In the distance oracle model, we can simply learn all the distances between and . Hence, the Voronoi cells for can be computed using distance queries. However, such an algorithm is not actually very useful for our purposes, and we will apply another approach that uses the first definition of Voronoi cells. With an additional assumption that is known, we can construct an algorithm which uses the notion of clusters, see Algorithm 1. It in particular illustrates the fact that if the clusters are small, the whole cell will be small.
Algorithm 1 Dividing a set using Voronoi cells centered at .
1: function VORONOI-CELLS() 2: needs to be known for every . 3: We don’t necessarily have . 4: 5: QUERY() 6: for do 7: QUERY() 8: for do 9: 10: 11: 12: return
3.2 Finding small Voronoi cells of a known graph from [TZ01]
Let us first focus on a setting where all the distances between and are known. This will have to be later adjusted to the distance oracle model in a way that allows us to use less than queries. A procedure (Algorithm 2) to find a partition of a subset with small cell sizes was given by Thorup and Zwick [TZ01]. It keeps track of the set while constructing the set of size . The subscript in is omitted if the set is clear from the context. The reason for considering lies in the definition of the Voronoi cell centered at as . Hence, if , the size of the cell at is at most
The constant 6 was chosen arbitrarily. It is only necessary that it is strictly bigger than 2.
which is the best possible bound, ignoring the factors. Therefore, we want to find a set for which .
It was shown already by Thorup and Zwick [TZ01] that when we sample each vertex from with probability and add them to , the new size of after recomputation will be, with probability at least , at least 2 times smaller than the previous one. In our algorithm (and in the presentation of the previous works) we use a slightly different distribution, that is, sampling exactly vertices from . This is a slight change, which also guarantees halving of with probability at least . We discuss this issue in Section A.
To ensure that becomes empty, it suffices to perform only logarithmically many iterations in expectation. Then, if after some iteration , we have and we found a partition into small Voronoi cells. In each iteration we add elements to , thus the expected total number of cells is . As desired, the maximal cell size is approximately the same as optimal.
Algorithm 2 Selecting centers as in [TZ01].
1: function CENTERS() 2: 3: while do 4: random -element subset of 5: or if 6: 7: for do 8: 9: 10: return
3.3 Finding centers by estimation (for unknown graphs) from [KMZ18]
Kannan, Mathieu, and Zhou [KMZ18] showed that the algorithm described in the previous subsection can be modified to use a subquadratic number of queries. The crucial change is related to the calculation of the size of the cluster of a given vertex and the set . Maintaining the set without knowing all the distances between and looks hard. Hence, instead of finding the exact size of a cluster, we only estimate its size by sampling sufficiently many vertices. Denote this estimate by . Based on that, we can keep track of the set , defined as the set of vertices with large estimation of a cluster size. By sampling a sufficiently large random subset of the vertices, we can claim that with high probability implies , and similarly that implies . That is, with high probability the estimation is reasonable. Hence, if we discard a vertex from , it is very likely that it has a small cluster size and that it is also outside the current set (which is never maintained by the algorithm). Therefore, an analysis similar to that of Algorithm 2 implies that halves with constant probability.
Note that we distinguish between and . The former is defined precisely (deterministically) as an abstract object, while the latter is its estimation, a random variable defined by running the algorithm. By the above observation about the correlation between the values of and , we can deduce that w.h.p. . Hence, although we do not directly use the set , we can still control its size. In particular, the algorithm finishes when , but w.h.p. this implies that also is empty. Correctness can be established by similar arguments, leading to the following:
Lemma 3.1 (Lemma 2.3, [KMZ18]). With probability at least , the following events related to the running of Algorithm 3 (ESTIMATED-CENTERS) happen simultaneously:
-
after every iteration the condition holds,
-
the algorithm terminates in 12 iterations using queries,
-
and partitions into cells of size by choosing a set of centers with .
Algorithm 3 Selecting centers by estimation
1: function ESTIMATED-CENTERS() 2: 3: is a large enough constant 4: while do 5: random -element subset of 6: or if 7: QUERY() 8: 9: for do 10: random multi-subset of of size 11: QUERY() 12: 13: 14: return
The intuition behind partitioning a subset to obtain a better algorithm is as follows. If we choose and then we can partition into cells of total size using queries. The largest of them will have a size . Each edge will be contained in at least one cell, so we can just perform the exhaustive search for each cell. The algorithm uses queries (the sum of each size times the size of the largest cell). We can balance the two components by picking to get the complexity of .
3.4 Challenges in extending prior work
The main result of this paper is showing how to use recursion to partition each cell into smaller ones. That is, there is a set of active subsets of vertices with the property that each edge is contained in at least one active subset. We want to take one active subset, partition it using Voronoi cells and deactivate it in favor of the new cells. Let us discuss the challenges that have to be faced by this approach. First, we argue why we cannot simply call the procedure from the previous subsection recursively. The basic reason is that the problem for a subset is not equivalent to the problem on a whole graph because the shortest paths are calculated in the whole graph. Thus, we cannot ignore the rest of the graph. This was formalized by Bastide [Bas25, Theorem 2.7], who constructed a family of bounded-degree graphs and their subsets such that any randomized algorithm reconstructing the subgraph induced by using distance queries only between vertices from has to use at least queries in expectation. Moreover, the set is natural: it could be a Voronoi cell found by Algorithm 3 (from [KMZ18]) called on the set of all vertices.
Another simple idea for using recursion would be to take the subset of centers partitioning to be a subset . However, this approach also turns out to be impossible, which can be justified in two ways:
-
We impose no structural assumptions on the cells. It could happen that for some set and parameter there is no way to choose a subset of size such that all cells centered at have sizes . This can be formally proven by constructing such that there is a vertex for which there exist many vertices in which are pairwise far away in the subgraph induced by but all of them are close to in the whole graph . For the constructed graph, most of these vertices (together with some other vertices close to them) lie in the same cell as , regardless of the choice of . This way, the cell containing becomes too large. We provide more details on such a construction in Section B.
-
Even if there is a way to prevent the above issue (by some manipulation with the centers in the previous level of recursion), the usage of Voronoi cells is limited. The main method to bound the size of a cell centered at relies on bounding the size of clusters of . However, these neighbors can be outside of , even if . Moreover, the algorithm for partitioning into cells takes vertices to from the whole subset of vertices for which it controls the cluster sizes. Thus, we have to control the sizes of clusters of vertices outside of .
Thus, vertices outside of have to be considered for being the centers of cells, and it is not clear how to restrict the set of candidates for such centers. Therefore, we assume only that . It is worth mentioning that there is a simpler version of the problem that uses recursion, namely the verification problem: we are given a (bounded degree) graph and a distance oracle to a graph . We have to check if . This was solved by Kannan, Mathieu and Zhou in [KMZ18] using queries in expectation. Their algorithm recursively found the partition of into Voronoi cells and compared whether partitions in the same way. This is similar to the reconstruction problem but is significantly easier: the algorithm for verification searches for a partition into cells “offline”, without using any queries. In the reconstruction problem, we have to find a partition relying only on information received from the queries.
As mentioned earlier, Abrahamsen, Bodwin, Rotenberg, and Stöckel [ABRS16] introduced the weaker betweenness oracle in order to study the limitations of the distance oracles. In particular, they observed that a limitation of the previous algorithm (as their algorithm using the betweenness queries follows the blueprint of Kannan, Mathieu and Zhou in [KMZ18]) is that, whenever it compares the distance between and two vertices and , it actually has access to the distance between and every other vertex. This seems problematic when trying to extend the algorithm to be recursive. In particular, in the betweenness oracle model, retrieving the distance appears to require retrieving the whole shortest path, and in the recursive approach the shortest paths are not necessarily contained in the current cell, and in fact might be much longer than the cell.
3.5 This paper
We develop new techniques for effectively partitioning a subset into Voronoi cells. Our main new contribution is a method that reduces the number of candidates for the cell centers. We proceed in two phases. The first uses a modification of the earlier approach: while the earlier approach estimates cluster sizes for all vertices, we only do so for a random subset of vertices. The subset needs to be not too small (as otherwise we might not collect enough vertices to subpartition the current cells) and not too large (to avoid issuing too many queries). The set of centers generated this way is not yet guaranteed to be good, but it turns out that the number of candidates for the remaining centers can be significantly reduced to the vertices near (in some sense) . This enables us to efficiently identify the remaining candidates and perform the rest of the search using a small number of queries. To make such an approach work, it turns out that it is necessary to impose an additional restriction on the Voronoi cells: we need to bound not only the size of each cell but also the number of cells containing each vertex. The latter was not necessary in prior work, and requires a new tool. We design such a tool that, informally speaking, fixes the set of centers by recursively “spreading” it randomly to the neighbors. While such a tool can be easily combined with the previous algorithm for finding Voronoi cells, combining it with our recursive approach turns out to be non-trivial.
Prior to discussing the details of how to partition a subset into cells, we present the high-level structure of the whole algorithm. The desired query complexity is , where is a threshold fixed throughout the algorithm. Thus, at each recursion depth we are allowed to use queries in total, so to partition we can use queries. It turns out that our algorithm can use that many queries to decrease the size of a cell from to (or, in the non-recursive approach, to ). Hence, our final cell sizes will be and the recursion depth is . The bound on the depth allows us to not worry about the factors, since they are at most . The final exhaustive search over all cells will take (ignoring the subpolynomial factors), so after comparing it to we can set to balance the overall number of queries.
We are ready to sketch the algorithm for partitioning a subset. We want to find a set of centers such that it partitions the set into Voronoi cells of sizes for some (small enough) . will be used to denote the set of vertices with large clusters (with respect to ). Formally, is defined as . Note that we do not require to be a subset of . The following property of holds: if , then , so .
We will be looking for with the following crucial property:
Definition 3.1. We will call valid if . This means that every vertex at a distance at most 2 from has cluster size .
If is valid, the cells are small, as follows from the construction of Voronoi cells (Algorithm 1). This is a weaker condition than the one used in [KMZ18] and [TZ01], where the clusters of all vertices had to be small (equivalently, was required to be empty). It turns out that this relaxation enables us to use a different subprocedure.
We will separate the search for centers into two phases, depending on the size of . The parameters of used subprocedures are chosen such that the number of queries matches . We start with the set , as in Algorithm 3. If is large, a random vertex belongs there with a large probability. Thus, we can easily sample random members of , add them to and halve with constant probability. Because we do not keep track of , if we want to know how many vertices are in or want to sample them, then we take a sample of vertices from and check their membership of . After a few iterations of the sampling, the set becomes small, and the above reasoning no longer applies: the number of queries needed to sample members of exceeds the allowed number . We will then end up with a set for which is small (because is small and w.h.p. ). Then we have to switch to other procedures. Taking advantage of the above validity condition, it suffices to search for members of around the set in a BFS-like manner. That is, using BFS we can find a smallest (closure) set such that any member of in the 2-neighborhood of is in , simply by sequentially visiting members of in the 2-neighborhood of the visited set. This way we visit at most vertices. At the end, the found subset is used as an input to the adapted version of the original algorithm (Algorithm 2 from [TZ01]), which turns out to be sufficient. This gives us a partition.
There is one missing component of the BFS: we have to search for neighbors effectively. The search for neighbors is naive: we iterate over cells containing the vertex and vertices in them, checking if the distance is 1. Hence, provided that the cells are small, it suffices to ensure that the number of cells containing each vertex is also small. That is: we know how to find a valid partition but we additionally want each vertex to be in cells. The general procedure (Algorithm 6) is shown in Section 4.3: we start with a valid set of centers and fix it, returning a set of roughly the same size. The set is constructed randomly. For each vertex of with probability we add all its neighbors to and repeat on them, otherwise we add none of its neighbors. This can be seen as growing a random tree rooted at each vertex of . From the point of view of an arbitrary vertex , w.h.p. the endpoints of different branches of the random trees obtained from will not be too concentrated at the same distance from . This is illustrated in the following figure, where the vertices in are orange, the vertices in are shown in red, and other vertices from the BFS tree rooted at are shown in black. The dotted lines represent the recursion tree of the procedure while the straight lines correspond to the edges of the BFS tree.

For the recursion of depth one, the spreading is performed when , and then the new set will still be valid (because ).
To sum up, the version of the algorithm with recursion depth one does the following. First, at depth zero, we use the previous approach by Kannan, Mathieu and Zhou [KMZ18]. Then we fix the cells such that each vertex is in cells by the method described in the previous paragraph. Since the algorithm ensures , this larger set of centers will be still valid. Then, we search for the edges inside each cell separately. To find a valid set for cell , we first perform the procedure designed for large , which returns a set such that is small. After that we use BFS to find the vertices which still have large clusters and search for the rest of among them. This finally results in a valid set of centers partitioning . Note that this time we do not ensure that each vertex is in a bounded number of depth 1 cells, to avoid a technicality caused by the fact that this time the algorithm perturbing a set of centers can fail.
The reason for different treatment of the input sets for Algorithm 6 (spreading the centers) is that to guarantee that this procedure works, it must receive a set of centers for which none of the vertices has a large cluster. Otherwise, it could reach that vertex, which would cause the respective cell to be large. The condition is indeed guaranteed after Algorithm 3 (from [KMZ18]) but not after applying our approach for finding centers, since it relies on the relaxed condition of validity for a set of centers (Definition 3.1). This creates an additional difficulty in composing the pieces together and switching from a recursion of depth 1 to the fully recursive approach. Informally, this is handled as follows. If the spreading fails (that is, finds a vertex with large cluster), then the found vertex is used as another source of the BFS. After returning to the BFS, we can repeat all the steps, until the perturbing is successful.
4 Auxiliary Procedures for Finding Centers
In preparation for the formal proof of Theorem 1.1, in this section we will establish three procedures. The goal of the first two is to find a valid set : one of them is used during the phase when is large and the second when it is small. The third procedure is used to ensure that every vertex belongs to only a few cells. In Section 5 we will combine these procedures to obtain a non-recursive algorithm that achieves queries. Finally, in Section 6 we will obtain a recursive version of the algorithm that achieves queries.
We recall that is a fixed threshold that remains the same throughout the whole algorithm, and will be adjusted later to optimise the overall complexity. Our goal in this section is to design a procedure that uses, for a set , only queries (because the total size of sets at the given recursion depth is ).
Among the three randomized subroutines discussed in this section, only two are zero-error. The remaining one, namely ESTIMATED-SUBSET-CENTERS (Algorithm 5, large ) is correct with constant nonzero probability but cannot be verified easily. However, if ESTIMATED-SUBSET-CENTERS fails then we will detect this later during the BFS search.
4.1 Small
Take a set of centers and the set . We want to find a valid (see Definition 3.1) superset of . A very similar problem (with ) was already considered and solved by Algorithm 2. We claim that under appropriate assumptions, we can use the same approach. A simple case is when is small (and known). We can then simply make all possible queries between and . Given these distances, the situation is similar to the one after some number of iterations of Algorithm 2 (CENTERS). Hence, we can find, with constant probability, an appropriate superset for which the set is empty simply by using the same loop as in procedure CENTERS. We will show that the same approach works in a more general setting, where we do not know the set . Let us state the lemma which follows from the analysis of Thorup and Zwick in [TZ01]. In their proof the set can be substituted with any subset of vertices with large clusters:
Lemma 4.1 (Implicitly proven in [TZ01]). Let . Given a set , let be a set consisting of some vertices with large clusters. Let be the set with added vertices from chosen uniformly at random. Then, with probability at least , .
This lemma is enough to design a new procedure. Procedure EXACT-SUBSET-CENTERS (Algorithm 4) executes exactly the same loop as procedure CENTERS. Its input is a set of centers (for which there is a set of vertices with large clusters ) and the set . All distances between and should be known. An important aspect of our generalization is that we do not require . In fact, the proof of Algorithm 2 generalizes to the setting of Algorithm 4, provided that the following two properties hold:
-
enables us to use Lemma 4.1 to show that with constant probability, the size of the set halves.
-
implies that the result is valid, that is . Indeed, let () be the final set of centers and ( from monotonicity) be the set . Since is empty (this is the loop termination condition), and , we can deduce that implies , as desired.
Based on the analysis of Algorithm 2 we deduce the following lemma:
Lemma 4.2. Assume that conditions and are satisfied and distances between and are known. Then EXACT-SUBSET-CENTERS (Algorithm 4) returns a valid set of centers for , such that with probability at least , contains at most new members. The algorithm can be adapted into zero-error.
The last claim comes from the fact that the success of the algorithm can be verified without asking new queries: since distances are known, the sizes of cells are also known. In case of failure, the algorithm can be repeated until successful.
Algorithm 4 Selecting centers for a subset with given .
1: function EXACT-SUBSET-CENTERS(S, A, W', t) 2: Assumes QUERY( , S) was already called. 3: while do 4: random t-element subset of 5: or if 6: 7: for do 8: 9: 10: return A
Taking will be crucial for the algorithm. It turns out that we can find an appropriate using a small number of queries but we cannot do so with the set . This can be justified as follows: the global condition defining as the subset consisting of all vertices satisfying a certain property can be relaxed to a local one. To check if satisfies the conditions of EXACT-SUBSET-CENTERS we only need to check the neighbors of . Intuitively, the complexity depends on the size of , not on n.
4.2 Large W
We want to design an algorithm which finds a set of centers for which the set is small (so that the algorithm from the previous subsection could be used). We will modify procedure ESTIMATED-CENTERS (Algorithm 3) in the following way: we will not keep track of the set . Instead, procedure ESTIMATED-SUBSET-CENTERS (Algorithm 5) in each iteration samples a large subset of vertices (around ), and checks which of them belong to . Then, we sample exactly elements of and add them to the set of centers. Notice that each -element subset of is equiprobable, despite the two-step sampling, so it is equivalent to sampling uniformly from . If the size of is small (that is, ), then the size of is also likely to be small (that is, ). We then terminate, returning .
There is a technicality involving checking if a vertex belongs to , as we do not keep that set. The issue can be solved by sampling beforehand and keeping the set , which is still small compared to . This requires fixing the number of iterations. We cannot just put and keep track of because in the latter iterations the size of would be biased.
To analyse the algorithm we need the following lemma. Its proof is an adaptation of the proof of Thorup and Zwick [TZ01] combined with the proof of Kannan, Mathieu, and Zhou [KMZ18].
This is the place in the algorithm where we cannot (as done in [TZ01,KMZ18]) sample each vertex with probability because we do not know . Thus, we chose a distribution with similar properties, as discussed in Section A.
Algorithm 5 Selecting centers for a subset by estimation. With constant probability, clusters will be of size after queries.
1: function ESTIMATED-SUBSET-CENTERS() 2: 3: is a large enough constant 4: , 5: 6: for do 7: if then 8: return 9: -element subset of 10: QUERY() 11: 12: for do 13: of size 14: QUERY() 15: 16: 17: return
Notice that the lemma gives us the guarantee about the well-defined set and the algorithm operates on a different auxiliary set . However, the change is minor because, with high probability, . The algorithm cannot be easily converted to zero-error because the real size of or at the termination is unknown.
Lemma 4.3. Let . With probability at least , procedure ESTIMATED-SUBSET-CENTERS (Algorithm 5) terminates after queries and outputs a set such that and .
Proof. Recall that we omit the subscript in and that . Observe that the bound on the size of follows trivially: there are logarithmically many iterations and in each of them elements are added to .
Consider a coupling between the runs of procedures ESTIMATED-SUBSET-CENTERS and ESTIMATED-CENTERS (Algorithm 3) when their random actions coincide. That is:
-
in each iteration they sample exactly the same vertices from . If ESTIMATED-SUBSET-CENTERS terminated earlier, in the coupling we assume that -element samples from in the final iterations are uniformly random.
-
the decisions whether to discard a vertex from (or , respectively) coincide (the invariant is preserved).
Recall the assumption . Note that if then . Hence, by Chernoff bound we have . We thus deduce that the probability that the loop did not return until the size of became small (at most ) is at least .
We prove that with high probability, the number of queries is small. By a similar application of Chernoff bound, we can show that with probability each of the sets has size smaller than (where follows from and ). We can then bound the number of queries by . The calls to QUERY() use at most .
The coupling allows us to use Lemma 3.1 for the coupled instance of ESTIMATED-CENTERS. By union bound, with probability at least we deduce that:
-
the two claims in bold hold,
-
and the properties in Lemma 3.1 hold. In particular, after each iteration and after iterations.
This is essentially all we need to prove the lemma. We bounded the number of queries. Moreover, emptiness of implies that ESTIMATED-SUBSET-CENTERS returns a set when is small. The size of for this is bounded by (by the first claim in bold).
4.3 Finding neighbors
Throughout the algorithm, we will often need to find neighbors of a vertex. The general approach will be as follows. At each level of the recursion (or each stage of the non-recursive algorithm), the graph will be covered by some cells such that each edge belongs to at least one cell. In order to find the neighbors of a vertex, we have to iterate over the current cells containing it, and for each of them query all the vertices it contains. Denote by an upper bound on the number of queries needed to find the neighbors of a vertex. Our upper bound for is the size of the largest cell times the maximum number of cells to which a vertex can belong.
Algorithm 6 Perturbing so that each vertex is in cells.
1: function FIX-CENTERS() 2: 3: function PERTURB() 4: 5: random number from 6: if then 7: for do 8: PERTURB() 9: for do 10: PERTURB() 11: return
We want to bound the number of used queries. Up to now, we have only taken care of bounding the sizes of cells, but we have not bounded the number of cells containing a given vertex. The following procedure FIX-CENTERS (Algorithm 6) aims to achieve this through randomization. It receives a set of centers and spreads it slightly to a larger set . Informally, will grow irregularly, and it is unlikely that many of its branches will stop exactly at the same distance from a vertex. With constant probability, each vertex lies in at most cells and the size of grows at most by a factor of 3. Although is associated with the partitioned subset , we will not use anywhere in the proof, and only refer to it when verifying the correctness.
The important thing is that in the following lemmas we do not require to be valid (see Definition 3.1). This means that it is possible that the cells are no longer small. The set of centers returned by the procedure is a superset of the input set. Hence, if is empty, it stays empty after calling the procedure and indeed is covered by small cells. In particular, it is the case where is the result of ESTIMATED-CENTERS (Algorithm 3). Therefore, we don't have to change anything in the non-recursive version of the algorithm. However, if is not empty, the validity of (the relation ) does not imply the validity of because we do not control what is the set . This issue causes a technicality in the recursive algorithm discussed in Section 6.
Lemma 4.4. The expected size of is at most .
Proof. Take a vertex and consider the recursion tree started by calling PERTURB(). Denote by the random variable that counts the number of calls at depth of the tree. By definition, . Each call initiates in expectation calls at the next depth. Hence, . By induction, and . The size of is not larger than the total number of calls to PERTURB, which is in expectation at most twice the number of root calls, equal to .
Let , where is a sufficiently large constant.
Lemma 4.5. A vertex is contained, with probability at least , in at most cells.
Proof. The case is trivial. From now on, assume that .
Consider any . Consider all calls of PERTURB at the vertices at distance from . Let be the sequence of those vertices, in the order in which PERTURB was called on them, maybe with multiple occurrences of some vertices. We group them into consecutive blocks of size . We are interested only in full blocks of the form , where . The probability that none of the calls in a full block recurse at least once is at most .
With probability at least , for all values of and for each of the first (or fewer if there are not that many) blocks, there is at least one vertex in the block that calls PERTURB at least once. In particular, this happened for . But, since there were no calls for , none of the calls at distance recurred. Hence, the calls at depth do not form a full block and there are fewer than of them. Similarly, at distance there may be at most full blocks (since each block is related to a call on a lower layer) and at most calls. Thus, with probability , there are at most calls at distance and at , in total. Recall that is in the cell centered at if and only if . Since the number of such is at most the number of calls to PERTURB at these layers, the lemma follows.
Lemma 4.6. Let be the number of queries required to find neighbors of a vertex. With probability at least , procedure FIX-CENTERS uses queries and returns a set such that and each vertex lies in at most cells with respect to .
Proof. By Lemma 4.4 and the Markov inequality, with probability at least , . By Lemma 4.5, with high probability each vertex lies in at most cells with respect to the set . Hence, with probability at least , both of these conditions hold. The bound for the number of queries follows from the bound on the size of .
To verify the correctness, for each vertex, we can check the number of cells to which it belongs. This can be done with queries. Hence, we get the following:
Lemma 4.7. Procedure FIX-CENTERS can be adapted into an algorithm that uses in expectation queries and returns a set such that and each vertex lies in at most cells with respect to .
5 Non-Recursive Algorithm
Algorithm 7 Non-recursive algorithm, queries.
1: function RECONSTRUCT(V, s) 2: 3: 4: 5: 6: for do 7: 8: 9: for do 10: 11: return
Let us present a simplified version of our main procedure. Recall first that the main procedure in [KMZ18] first divides all vertices into cells, then performs an exhaustive search in each of them. In this section, we go one step further: we also divide the initial cells into smaller ones. In Algorithm 7 we first call ESTIMATED-CENTERS (Algorithm 3) to find Voronoi cells of sizes . Then we perturb using procedure FIX-CENTERS (Algorithm 6) to ensure that each vertex lies in at most cells. After that, for a given vertex, we can find its neighbors in queries. We can now restrict the search for the edges to each individual cell. We will divide each initial cell into smaller cells, each of size , using Algorithm 8 described in the next subsection. For each of the smaller cells, we can find the edges by querying all pairwise distances.
5.1 Non-recursive algorithm for subset
We are now ready to show how to connect the pieces from Section 4 to partition the subset into Voronoi cells. We can use at most queries to fit into the total limit for the main procedure. Consider the following Algorithm 8. The input set is a cell returned by ESTIMATED-CENTERS (Algorithm 3) so . The algorithm returns the set of centers partitioning into cells of sizes . To ensure that the smaller cells are small enough, the algorithm picks . Indeed, we have .
First, we start with and . We can run ESTIMATED-SUBSET-CENTERS (Algorithm 5), which returns the set of centers for which . Then we would like to plug into EXACT-SUBSET-CENTERS (Algorithm 4) but to do so, we have to find a set that satisfies the requirement . We can find by local search: first we start with and then sequentially for each vertex in we check if any of its 2-neighbors belongs to . If so, we have to add it to and repeat. To check whether we can simply call QUERY(v, S) and recover . From the construction, the resulting will satisfy the required condition and can be a parameter of EXACT-SUBSET-CENTERS. We can also interpret
Algorithm 8 Finding centers when to divide into cells of size .
1: function SUBSET-CENTERS() 2: 3: 4: 5: for do 6: for do 7: QUERY(v, S) 8: ▷ All pairs from are queried 9: 10: if and then 11: 12: return EXACT-SUBSET-CENTERS()
the local search as a BFS finding the components of in a graph formed by the vertices in and the edges between vertices at distance at most 2 (in ). Moreover, EXACT-SUBSET-CENTERS requires that all distances between and are known, but they were already retrieved while finding neighbors. All subroutines except ESTIMATED-SUBSET-CENTERS are zero-error. Hence, the algorithm is correct with constant nonzero probability.
Now we examine the number of queries to ensure that it is at most . For procedure ESTIMATED-SUBSET-CENTERS (Algorithm 5) it is indeed . The local search finds the neighbors of vertices, therefore its complexity is . As , it suffices to show that , which is guaranteed by ESTIMATED-SUBSET-CENTERS, as . Procedure EXACT-SUBSET-CENTERS (Algorithm 4) does not use any queries.
The above calculations were performed under the assumption that all the procedures were correct, which happens with nonzero constant probability. Therefore, we deduce the following lemma.
Lemma 5.1. With probability at least , SUBSET-CENTERS returns a valid set of centers using at most queries. Moreover, as validity is easily tested, it can be adapted into zero-error.
5.2 Complexity and correctness of RECONSTRUCT (Algorithm 7)
Recall that ESTIMATED-CENTERS is correct with probability , and the other subroutines are zero-error. Hence, RECONSTRUCT is correct with constant nonzero probability and can be adapted into a zero-error algorithm with expected complexity the same as a correct call of the original algorithm.
Each of the smaller cells has size . Therefore, performing the exhaustive search for each of them takes . The first two phases have complexity (first by [KMZ18], second by Lemma 4.7). The total complexity is , which for gives .
6 Recursive Algorithm
The non-recursive algorithm has two phases: the first partitions all vertices into cells and the second partitions the cells into smaller cells. We want to generalize this approach to a larger number of phases.
Starting from a subset equal to (and depth of recursion equal to 0), we proceed in phases. In each phase, we are given sets with the property that each edge is contained in at least one set. The purpose of the phase is to divide each of the current sets into smaller ones using Voronoi cells. That is, are the sets given in the next phase. We want the division to be balanced: smaller cells should not be too large, and each vertex should not be contained in too many new cells. That is, when we partition a set into Voronoi cells, each element of should be contained in at most cells created from . After some number of phases, when the size of the largest set from is small enough, we switch to the exhaustive search.
The partition is implemented with Algorithm 9 (REC-SUBSET-CENTERS), described in the next subsection. It turns out that after a proper choice of parameters, we can decrease the cell sizes as long as they are at least . Assume for a moment that there are no extra polylogarithmic factors in the bounds. Then, by appropriately adjusting the overall number of queries becomes . However, as we in fact do have such factors, we have to be more careful with the analysis. We will show that, even including the additional polylogarithmic factors, the overall number of queries is .
A pseudocode for the whole algorithm is given in Section 6.3. We will prove that the number of queries used in the recursive phase at depth is in expectation and that for an appropriately chosen depth and parameter , the overall complexity is .
6.1 Algorithm for partitioning the subset
We want to design an algorithm (Algorithm 9) which can be used as part of the recurrence described above, based on Algorithm 8 (SUBSET-CENTERS).
The main issue in directly generalizing the non-recursive algorithm is that it does not give us a guarantee that each vertex is in a small number of cells. Hence, as it would not search for neighbors fast, applying the previous algorithm directly would not work. What we used previously was procedure FIX-CENTERS (Algorithm 6), which does not work correctly if we use Algorithm 8. The reason for this is that the algorithm does not give us the guarantee that is empty but that 2-neighbors of are not in , that is, . However, remember that is a random subset spread around : it could still happen that where is the result of FIX-CENTERS on .
This can be fixed in the following way. First, we call subroutines as in the non-recursive algorithm and then perform FIX-CENTERS. To fix some notation, let be returned by ESTIMATED-SUBSET-CENTERS (Algorithm 5), and let be the set with respect to . Then, let be found by local search, be returned by EXACT-SUBSET-CENTERS (Algorithm 4) called on and , and be returned by FIX-CENTERS called on . If is empty, is a valid set of centers and we can return . Otherwise, since and , the intersection is nonempty. We add all the members of to . Then, we can return to the local search and repeat all the steps, although with the larger instead (but still with ). The local search can be started with newly added vertices only (because and have not changed). In every attempt in which we have nonempty , we find at least one new member of . Hence, we need at most iterations until is a valid set of centers.
6.2 Analysis of Algorithm 9
Assume that we can find the neighbors of a vertex using queries.
Algorithm 9 Selecting centers in the recursive algorithm. For , we divide into Voronoi cells of size . With constant probability, the number of queries is .
1: function REC-SUBSET-CENTERS() 2: ESTIMATED-SUBSET-CENTERS() 3: 4: while true do 5: for do 6: for do 7: QUERY() 8: 9: if and then 10: 11: ▷ All pairs in have been queried. 12: EXACT-SUBSET-CENTERS() 13: FIX-CENTERS() 14: if then 15: return 16: else 17: ▷ This happens at most times. 18:
ESTIMATED-SUBSET-CENTERS (Algorithm 5) uses queries and is run only once. With probability , it returns a set of centers for which and . The local search finds neighbors for the vertices in total through all the iterations. Therefore, its complexity is . The algorithm uses the zero-error version of FIX-CENTERS. The calls to this procedure consist of finding neighbors for vertices in expectation and last for at most iterations, so their expected complexity is . By the Markov inequality, with probability the total number of queries made by the calls to procedure FIX-CENTERS is at most . The cost of checking emptiness of has the same bounds as FIX-CENTERS (because its complexity depends on ). Finally, EXACT-SUBSET-CENTERS does not use any queries. Therefore, if both ESTIMATED-SUBSET-CENTERS is correct and FIX-CENTERS uses the above number of queries (which happens with probability at least ), then procedure REC-SUBSET-CENTERS is correct, as summarized in the following lemma:
Lemma 6.1. Let . With probability at least , REC-SUBSET-CENTERS returns a valid set of centers that divides the set using at most queries and so that each vertex lies in cells. Moreover, as its correctness is easily tested, it can be adapted to zero-error.
6.3 Analysis of the recurrence
The main procedure in our approach is Algorithm 10 (RECONSTRUCT-REC). It executes the recursive division of cells in parallel, as discussed at the beginning of Section 6. The correctness of the
Algorithm 10 Recursive algorithm with fixed depth.
1: function RECONSTRUCT-REC(V, depth, s) 2: 3: 4: 5: \quad constant from Lemma 6.1 6: for 7: 8: 9: for do 10: \quad the number of cells to divide 11: if then 12: 13: 14: else 15: 16: \quad sets are of size 17: 18: for do 19: 20: return
algorithm is clear, since all used procedures are zero-error. The rest of the analysis in this section establishes complexity of RECONSTRUCT-REC for suitably chosen and depth. We also unroll the factor in the complexity.
Denote , where is a constant hidden under in Lemma 6.1 (related to procedure FIX-CENTERS). For any vertex, after each phase, the number of cells that contain it grows by a factor at most . Hence, at the depth of the recursion, each vertex is contained in at most cells and the total size of the sets in is at most . Since is the size of the largest set in , the search for neighbors uses at most queries. We need the following two lemmas:
Lemma 6.2. The expected number of queries at any depth of the recursion is .
Proof. For it follows from Lemma 3.1. Now, let . Take any set . By Lemma 6.1 procedure REC-SUBSET-CENTERS called on uses in expectation at most queries. We can estimate
Thus, procedure REC-SUBSET-CENTERS uses queries when called on . Moreover, procedure VORONOI-CELLS uses at most queries. Since the sum of sizes of sets in is bounded by , this phase takes queries in total.
Lemma 6.3. For any , , where is defined analogously.
Proof. Take . By the definition of and guarantees of Voronoi cells, the size of the largest subset in obeys:
Thus
As , we have
or, equivalently
We can choose depth = . From Lemma 6.3 we get and .
We are ready to calculate the number of used queries. The exhaustive search uses the same queries as the procedure of finding neighbors called for every vertex (it queries a vertex with every other vertex in sets from containing it), thus uses
queries. By Lemma 6.2, the number of queries used in total during the earlier phases is . Balancing these two terms gives and the total complexity of the algorithm is .
References
[ABK⁺04] Noga Alon, Richard Beigel, Simon Kasif, Steven Rudich, and Benny Sudakov. Learning a hidden matching. SIAM J. Comput., 33(2):487–501, 2004.
[ABRS16] Mikkel Abrahamsen, Greg Bodwin, Eva Rotenberg, and Morten Stöckel. Graph reconstruction with a betweenness oracle. In STACS, LIPIcs, pages 5:1–5:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2016.
[AC08] Dana Angluin and Jiang Chen. Learning a hidden graph using queries per edge. J. Comput. Syst. Sci., 74(4):546–556, 2008.
[ACKM09] Dimitris Achlioptas, Aaron Clauset, David Kempe, and Cristopher Moore. On the bias of traceroute sampling: Or, power-law degree distributions in regular graphs. J. ACM, 56(4):21:1–21:28, 2009.
[AEG⁺22] Simon Apers, Yuval Efron, Pawel Gawrychowski, Troy Lee, Sagnik Mukhopadhyay, and Danupon Nanongkai. Cut query algorithms with star contraction. In FOCS, pages 507–518. IEEE, 2022.
[Bas25] Paul Bastide. Local structure in combinatorics : reconstruction, saturation, spreadness and universality. Theses, Université de Bordeaux, June 2025.
[BEE ] Zuzana Beerliova, Felix Eberhard, Thomas Erlebach, Alexander Hall, Michael Hoffmann, Matús Mihalák, and L. Shankar Ram. Network discovery and verification. IEEE J. Sel. Areas Commun., 24(12):2168–2181, 2006.
[BG25] Paul Bastide and Carla Groenland. Tight distance query reconstruction for trees and graphs without long induced cycles. Random Struct. Algorithms, 66(4), 2025.
[BMSX25] Hadley Black, Arya Mazumdar, Barna Saha, and Yinzhan Xu. Optimal graph reconstruction by counting connected components in induced subgraphs. In COLT, Proceedings of Machine Learning Research, pages 315–343. PMLR, 2025.
[CK08] Sung-Soon Choi and Jeong Han Kim. Optimal query complexity bounds for finding graphs. In STOC, pages 749–758. ACM, 2008.
[DAB ] Luca Dall'Asta, J. Ignacio Alvarez-Hamelin, Alain Barrat, Alexei Vázquez, and Alessandro Vespignani. Exploring networks with traceroute-like probes: Theory and simulations. Theor. Comput. Sci., 355(1):6–24, 2006.
[EGL25] David Eppstein, Michael T. Goodrich, and Songyu Liu. Bandwidth vs BFS width in matrix reordering, graph reconstruction, and graph drawing. In ESA, volume 351 of LIPIcs, pages 69:1–69:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.
[GK98] Vladimir Grebinski and Gregory Kucherov. Reconstructing a Hamiltonian cycle by querying the graph: Application to DNA physical mapping. Discret. Appl. Math., 88(1-3):147–165, 1998.
[GK00] Vladimir Grebinski and Gregory Kucherov. Optimal reconstruction of graphs under the additive model. Algorithmica, 28(1):104–124, 2000.
[Hei89] Jotun Hein. An optimal algorithm to reconstruct trees from additive distance data. Bulletin of mathematical biology, 51 5:597–603, 1989.
[JNS26] Yonggang Jiang, Danupon Nanongkai, and Pachara Sawettamalya. Minimum s t cuts with fewer cut queries. In SODA, pages 258–296. SIAM, 2026.
[KK25] Yotam Kenneth-Mordoch and Robert Krauthgamer. Cut-query algorithms with few rounds. In ESA, LIPIcs, pages 100:1–100:14. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.
[KK26] Yotam Kenneth-Mordoch and Robert Krauthgamer. All-pairs minimum cut using cut queries. In SODA, pages 4077–4095. SIAM, 2026.
[KMZ18] Sampath Kannan, Claire Mathieu, and Hang Zhou. Graph reconstruction and verification. ACM Trans. Algorithms, 14(4):40:1–40:30, 2018.
[KN26] Chirag Kaudan and Amir Nayyeri. Cutwidth versus bfs-width with applications to graph reconstruction from distance queries. In SWAT, volume 370 of LIPIcs, pages 24:1–24:13. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2026.
[KOT25] Christian Konrad, Conor O'Sullivan, and Victor Traistaru. Graph reconstruction via MIS queries. In ITCS, LIPIcs, pages 66:1–66:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.
[KZ25] Michael Krivelevich and Maksim Zhukovskii. Reconstructing random graphs from distance queries. In ESA, volume 351 of LIPIcs, pages 30:1–30:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2025.
[KZZ03] Valerie King, Li Zhang, and Yunhong Zhou. On the complexity of distance-based evolutionary tree reconstruction. In SODA, pages 444–453. ACM/SIAM, 2003.
[LSZ21] Troy Lee, Miklos Santha, and Shengyu Zhang. Quantum algorithms for graph problems with cut queries. In SODA, pages 939–958. SIAM, 2021.
[LY91] László Lovász and Neal E. Young. Lecture notes on evasiveness of graph properties. Technical Report CS-TR-317-91, Princeton University, 1991. First eight lectures from the course "Many Models of Complexity" (Fall 1990).
[MZ23] Claire Mathieu and Hang Zhou. A simple algorithm for graph reconstruction. Random Struct. Algorithms, 63(2):512–532, 2023.
[RLYW21] Guozhen Rong, Wenjun Li, Yongjie Yang, and Jianxin Wang. Reconstruction and verification of chordal graphs with a distance oracle. Theor. Comput. Sci., 859:48–56, 2021.
[RS07a] Lev Reyzin and Nikhil Srivastava. Learning and verifying graphs using queries with a focus on edge counting. In ALT, Lecture Notes in Computer Science, pages 285–297. Springer, 2007.
[RS07b] Lev Reyzin and Nikhil Srivastava. On the longest path algorithm for reconstructing trees from distance matrices. Information Processing Letters, 101(3):93–95, 2007.
[RSW18] Aviad Rubinstein, Tselil Schramm, and S. Matthew Weinberg. Computing exact minimum cuts without knowing the graph. In ITCS, LIPIcs, pages 39:1–39:16. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2018.
[TLP09] Fabien Tarissan, Matthieu Latapy, and Christophe Prieur. Efficient measurement of complex networks using link queries. In IEEE INFOCOM Workshops 2009, pages 1–6, 2009.
[TZ01] Mikkel Thorup and Uri Zwick. Compact routing schemes. In SPAA, pages 1–10. ACM, 2001.
[WSSB77] Michael S Waterman, Temple F Smith, M Singh, and William A Beyer. Additive evolutionary trees. Journal of Theoretical Biology, 64(2):199–213, 1977.
A Sampling distributions
In all algorithms presented in this paper, when we want to decrease the size of or , we sample of their vertices. This differs from the approaches by Thorup and Zwick [TZ01] and Kannan, Mathieu, and Zhou [KMZ18], even in our presentation of their results. In fact, they sample each vertex from with probability (or , respectively) which is a distribution with very similar properties. We want to discuss why after the change of the distribution, the algorithms are still correct.
The proofs of the correctness of both procedures CENTERS and ESTIMATED-CENTERS (Algorithms 2 and 3) ([KMZ18, Lemma 2.3]) hinge on showing that or is halved with constant probability. This in fact is proved in [TZ01, Theorem 3.1]. The same theorem is used in [KMZ18] in their algorithm. The only place where the distribution appears in their argument is the final line of the proof of [TZ01, Lemma 3.2]. The property used there is that the expected value of the minimum of the chosen subset of (where ), where we choose each element independently with probability , is at most . However, this is also the case when we choose exactly numbers. The expected value can be calculated using the formula , which holds for any nonnegative integer random variable . There are -element subsets of , of them have minimum at least , hence the expected value of the minimum can be calculated by the formula:
Hence, the slightly different distribution used in this paper has a lower expected value, which justifies its usage. We comment that the only part of the algorithm which requires adjusting the distribution is Algorithm 5.
B Counterexample against
In this subsection, we provide more details on how to obtain an instance in which it is not enough to choose . Formally, we construct a graph , a subset and a choice of the parameter such that any cells partitioning with centers inside contain at least one large cell. In fact, we additionally show that can be a cell arising from a partition of into Voronoi cells. In our construction a vertex lies on the boundary of and there are many vertices from close to through paths outside . Then, regardless of the choice of , the cell containing is large, provided that its center is close to , which can be forced by the structure of the graph. An illustration of such a situation is shown in the figure below.

In the figure, the graph is partitioned into two Voronoi cells marked in blue. Vertices and are the centers of these cells. The triangles represent complete binary trees, while the large segments between the two triangles denote long paths. Let the number of paths be and their length be , where . The lines between , between and between also denote paths. By adjusting their lengths to and , respectively, we obtain that the two blue cells look as in the figure. That is, and the bottom vertices of all other paths are in the cell of , whereas the rest of the paths and the top binary tree are in the cell of . The gray region is isolated from the rest of the graph, except for . contains many vertices and has logarithmic diameter. Denote by the cell centered at . The size of can be chosen such that and . The sign hides addends.
We claim that any partition of using at most Voronoi cells centered inside contains a large cell, namely the one centered at , the chosen center that is closest to . First, we claim that must lie either inside or on the path between and . Indeed, the region is large so it has to be partitioned. Thus, it contains at least one center and this center has to be close to because the diameter of is logarithmic (this also implies that ). Since the number of paths is and there are at most centers, not every path between triangles can contain a center.
If a path does not contain a center, then its top vertices are closer to than to any other center. Formally, consider a path between binary trees which does not contain any center, let be the topmost vertex of contained in and the -th vertex from the top. Take a center on some other path or in the lower triangle. There are two types of paths to the center :
-
the path from through the top triangle to the vertex is longer than from to . Indeed, the former one has length at least (because the top vertices of both and the path containing are outside ). On the other hand, the latter one has length ,
-
the path from through the bottom triangle to the vertex is longer than from to . Indeed, the former one has length at least , while the latter one has length ,
and since is closer than to both and , it is closer to all vertices between them. Thus, if does not contain any center, then its top vertices are closer to than to any other center. At least of them lie in the cell of . In total, this gives at least vertices lying in the cell centered at , which is too much. There is a cell containing a constant fraction of vertices for any with . In fact, the result holds even for partitioning into cells.