Tight Approximation Algorithms for Bichromatic Graph Diameter and Related Problems
Mina Dalirrooyfard, Virginia Vassilevska Williams, Nikhil Vyas, Nicole, Wein

TL;DR
This paper develops tight approximation algorithms for bichromatic graph diameter and related problems, providing new bounds and algorithms that are nearly optimal under the Strong Exponential Time Hypothesis.
Contribution
It introduces the first nontrivial approximation algorithms for various bichromatic graph parameters and establishes tight bounds under SETH.
Findings
Presented a 5/3-approximation algorithm for Bichromatic Diameter in weighted graphs.
Established tight bounds under SETH for approximation factors and running times.
Provided comprehensive analysis of approximability for multiple related graph parameters.
Abstract
Some of the most fundamental and well-studied graph parameters are the Diameter (the largest shortest paths distance) and Radius (the smallest distance for which a "center" node can reach all other nodes). The natural and important -variant considers two subsets and of the vertex set and lets the -diameter be the maximum distance between a node in and a node in , and the -radius be the minimum distance for a node of to reach all nodes of . The bichromatic variant is the special case in which and partition the vertex set. In this paper we present a comprehensive study of the approximability of and Bichromatic Diameter, Radius, and Eccentricities, and variants, in graphs with and without directions and weights. We give the first nontrivial approximation algorithms for most of these problems, including time/accuracy trade-off upper and lower…
| Upper Bounds | Lower Bounds | ||||
| Problem | Runtime | Approx. | Comments | Runtime | Approx. |
| Diameter | almost | unweighted, tight | |||
| almost | unweighted, nearly tight | ||||
| weighted, tight | ” | ” | |||
| almost | unweighted, tight* | ||||
| Radius | almost | unweighted | |||
| almost | unweighted, nearly tight* | ||||
| weighted, tight* | ” | ” | |||
| almost | unweighted, tight* | ||||
| Eccentricities | weighted, tight | ||||
| almost | unweighted, nearly tight | ||||
| weighted, tight | ” | ” | |||
| almost | unweighted, tight* | ||||
| Upper Bounds | Lower Bounds | ||||
| Problem | Runtime | Approx. | Comments | Runtime | Approx. |
| Diameter | weighted, tight* | ||||
| almost | unweighted, tight* | ||||
| Radius | N/A | N/A | weighted, tight | any finite | |
| Eccentricities | N/A | N/A | weighted, tight | any finite | |
| Upper Bounds | Lower Bounds | ||||
| Problem | Runtime | Approx. | Comments | Runtime | Approx. |
| Diameter[4] | weighted, tight | ||||
| almost | unweighted, nearly tight | ||||
| weighted, tight | ” | ” | |||
| Radius | weighted | ||||
| almost | unweighted, nearly tight* | ||||
| weighted, tight* | ” | ” | |||
| Eccentricities | weighted, tight | [4] | |||
| almost | unweighted, nearly tight | [4] | |||
| weighted, tight | ” | ” | |||
| Upper Bounds | Lower Bounds | ||||
| Problem | Runtime | Approx. | Comments | Runtime | Approx. |
| Diameter | weighted, directed, tight | ||||
| Radius | weighted, undirected, tight | ||||
| weighted, directed, tight up to an additive | ” | ” | |||
| Eccentricities | weighted, directed, tight up to an additive | ||||
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Tight Approximation Algorithms for Bichromatic Graph Diameter and Related Problems
Mina Dalirrooyfard [email protected], Supported by an Akamai Presidential Fellowship and NSF Grant.
MIT
Virginia Vassilevska Williams [email protected], Supported by an NSF CAREER Award, NSF Grants CCF-1417238, CCF-1528078 and CCF-1514339, a BSF Grant BSF:2012338 and a Sloan Research Fellowship.
MIT
Nikhil Vyas [email protected], Supported by an Akamai Presidential Fellowship and NSF Grant CCF-1552651.
MIT
Nicole Wein [email protected], Supported by an NSF Graduate Fellowship and NSF Grant CCF-1514339
MIT
Abstract
Some of the most fundamental and well-studied graph parameters are the Diameter (the largest shortest paths distance) and Radius (the smallest distance for which a “center” node can reach all other nodes). The natural and important -variant considers two subsets and of the vertex set and lets the -diameter be the maximum distance between a node in and a node in , and the -radius be the minimum distance for a node of to reach all nodes of . The bichromatic variant is the special case in which and partition the vertex set.
In this paper we present a comprehensive study of the approximability of and Bichromatic Diameter, Radius, and Eccentricities, and variants, in graphs with and without directions and weights. We give the first nontrivial approximation algorithms for most of these problems, including time/accuracy trade-off upper and lower bounds. We show that nearly all of our obtained bounds are tight under the Strong Exponential Time Hypothesis (SETH), or the related Hitting Set Hypothesis.
For instance, for Bichromatic Diameter in undirected weighted graphs with edges, we present an time 555 notation hides polylogarithmic factors. -approximation algorithm, and show that under SETH, neither the running time, nor the approximation factor can be significantly improved while keeping the other unchanged.
1 Introduction
A fundamental and very well studied problem in algorithms is the Diameter of a graph, where the output is the largest (shortest path) distance over all pairs of vertices. Over the years many different algorithms have been developed for the problem, both in theory (e.g. [3, 20, 23, 8, 4]) and in practice (e.g. [10, 24, 19]).
A very natural variant is the so called -Diameter problem [4]: given a graph and two subsets and of its vertex set, determine the largest distance between a vertex of and a vertex of . In the Subset version of -Diameter, we have . Bichromatic Diameter is the version of -Diameter for which and partition the vertex set. Besides Diameter, the Radius (the smallest distance for which a “center” node can reach all other nodes) and Eccentricities (the largest distance out of every vertex) problems are also very well studied, and analogous , Subset, and Bichromatic versions are easy to define.
All of these parameters are simple to compute by computing all pairwise distances in the graph, i.e. by solving All-Pairs Shortest Paths (APSP). In sparse -node graphs, where the number of edges is , APSP still needs time, as this is the size of the output, whereas it is apriori unclear whether this much time is needed for computing the Diameter, Radius and Eccentricities or their and bichromatic variants, as the output is small.
A related extremely well-studied problem in computational geometry is Bichromatic Diameter on point sets (commonly known as Bichromatic Farthest Pair), where one seeks to determine the farthest pair of points in a given set of points in space (see e.g. [28, 12, 27, 2, 16]). Another related problem is the Subset version of spanners (e.g. [18, 11]), as well as the version of spanners (e.g. [9, 17]). Furthermore, the , Subset, and Bichromatic versions of many problems have been of great interest; for instance Steiner Tree, Subset TSP, and a number of problems in computational geometry such as Bichromatic Matching (e.g. [15]) and Bichromatic Line Segment Intersection (e.g. [7]).
There are several known approximation algorithms for the standard version of Diameter, most of which have been developed in the last 6 years. Trivially, running Dijkstra’s algorithm from an arbitrary vertex gives a simple time -approximation algorithm for directed and weighted graphs. Non-trivial algorithms achieve an improved approximation factor with an increased runtime: Building on Aingworth et al. [3], Roditty and Vassilevska W. [23] showed for instance that an “almost” approximation for Diameter can be computed in time in -edge -vertex directed weighted graphs—the approximation factor is if the Diameter is divisible by , and there is a slight additive error otherwise. Chechik et al. [8] gave a true approximation at the expense of increasing the runtime to , and Cairo, Grossi and Rizzi [5] generalized the approach giving an time, “almost” approximation algorithm for all which works only in undirected graphs.
In STOC’18, Backurs et al. [4] gave the first non-trivial approximation algorithms for -Diameter: an time -approximation and an time -approximation. They also showed that these algorithms cannot be improved significantly, unless the Strong Exponential Time Hypothesis (SETH) fails. Backurs et al. did not provide algorithms for -Eccentricities or -Radius, and they did not study the natural Subset and Bichromatic versions. They also only focused on undirected graphs.
We study the following natural and fundamental questions:
How well can -Eccentricities and -Radius be approximated? Are any interesting approximation algorithms possible for directed graphs for any of the -variants? Does the approximability of the problems change when one turns to the Subset versions in which , or the Bichromatic versions in which and are required to partition the vertex set?
1.1 Our Results
We present a comprehensive study of the approximability of the , Subset and Bichromatic variants of the Diameter, Radius and Eccentricities problems in graphs, both with and without directions and weights. We obtain the first non-trivial approximation algorithms for most of these problems, including time/accuracy trade-off upper and lower bounds. We show that nearly all of our approximation algorithms are tight under SETH (or under the related Hitting Set Hypothesis for Radius). Additionally, we study a parameterized version of these problems.
Our results are summarized in Tables 7-4.
All our algorithms in -edge, -node graphs, run in time or in time when a small additive error is allowed. For sparse graphs the runtime beats the fastest APSP algorithms [6, 22, 21] as they run in time. The time of the algorithms that allow small additive error beat the APSP algorithms for every graph sparsity.
Bichromatic Diameter and Radius.
Our first contribution is an algorithm with the same running time as the -approximation -Diameter algorithm of [4], achieving a better, approximation for Bichromatic Diameter. In other words, when and partition the vertex set of the graph, -Diameter can be approximated much better! Moreover, we show that under SETH, neither the runtime nor the approximation factor of our algorithm can be improved. The result is summarized in Theorem 1.1 below, and proven in Theorems 3.2 and 7.1.
Theorem 1.1**.**
There is a randomized time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate such that with high probability, where is the -Diameter of .
Moreover, if there is an time -approximation algorithm for some , or if there is an time -approximation algorithm for the problem, then SETH is false.
We also obtain an time algorithm that achieves an “almost” -approximation: the guarantee for unweighted graphs is . We also obtain a near-linear time algorithm for weighted graphs that returns an estimate with where is the minimum weight of a edge. Using our general theorem 7.1, we get that this result is also essentially tight, as a -approximation for running in near-linear time would refute SETH.
To obtain our improvements for Bichromatic Diameter over the known -Diameter algorithms, we crucially exploit the basic fact that as partition any path that starts from a vertex and ends in a vertex must cross a edge such that . While this fact is clear, it not at all obvious how one might try to exploit it.
We explain our technique in more detail for the bichromatic diameter problem, and similar ideas are used for our algorithms for the other problems. Let and be end-points of an -Diameter path. Similarly to prior Diameter algorithms, our goal is to run Dijkstra’s algorithm from some which is close to , and hence far from , or from some which is close to and hence far from (by the triangle inequality). Our -approximation algorithms are a delicate combination of two themes: (1) randomly sample nodes in and nodes in – similarly to prior works, the sampling works well if there are many nodes of that are close to , or if there are many nodes of that are close to . If (1) is not good enough, in theme (2) we show that we can find a node close to for which we can “catch” an edge on the shortest path, such that is close to . Theme (2) is our new contribution. Because of theme (2), our algorithms are more complicated than the -Diameter algorithms, but run in asymptotically the same time, and achieve a better approximation guarantee. In order to better separate the ideas in our algorithms, we explain them in several steps, where Theme (1) can be seen in the first steps and Theme (2) appears towards the last steps.
Following a similar approach to our Bichromatic Diameter algorithms, we develop similar algorithms for Bichromatic Radius. First, we give a simple near-linear time almost -approximation algorithm, and then we adapt the -approximation for Bichromatic Diameter to also give a -approximation for Bichromatic Radius. Moreover, we show that any better approximation factor requires essentially quadratic time, under the Hitting Set (HS) Hypothesis of [1] (see also [13]).
Theorem 1.2**.**
There is a randomized time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate such that with high probability, where is the -Radius of . Moreover, if there is a approximation algorithm running in time for any , then the HS Hypothesis is false.
Similarly to the Bichromatic Diameter algorithm, if one is satisfied with a slight additive error, one can improve the runtime to .
-Eccentricities and -Radius.
Prior work only considered -Diameter but did not consider the more general -Eccentricities problem in which one wants to approximate for every , .
Here we show that one can achieve exactly the same approximation factors for -Eccentricities as for -Diameter. Since any conditional lower bound for -Diameter also applies for the -Eccentricities problem, the algorithms we obtain are conditionally optimal, similarly to the -Diameter algorithms in [4]. Interestingly, we show that the same conditional lower bounds apply for Bichromatic Eccentricities (Proposition 6), and therefore our -Eccentricities algorithms are optimal even for the Bichromatic case.
Theorem 1.3**.**
There is a randomized time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output for every , an estimate such that with high probability. Moreover, if there is a approximation algorithm running in time for any or a -approximation algorithm running in time for , even for the Bichromatic case when , then SETH is false.
Again, as before, one can improve the runtime to with a slight additive error, and there is a simple near-linear time -approximation algorithm which is tight under SETH, similar to the one in [4] for -Diameter. A simple argument shows that these algorithms imply algorithms with the same running time and approximation factor for -Radius.
Bichromatic and Problems in Directed Graphs.
Using simple reductions we first show that there can be no time (for ) algorithms that achieve any finite approximation for -Diameter or -Eccentricities (under SETH), or -Radius (under HS). Interestingly, the same holds for Bichromatic Eccentricities (under SETH, Proposition 7) and Bichromatic Radius (under HS, Proposition 8), but not Bichromatic Diameter! Surprisingly, unlike those two problems, Bichromatic Diameter does admit a finite, in fact -approximation algorithm running in subquadratic time, and this algorithm is conditionally optimal:
Theorem 1.4**.**
There is a randomized time algorithm, that given a directed graph with nonnegative integer edge weights and , can output an estimate such that with high probability, where is the -Diameter of .
Moreover, if there is an time -approximation algorithm for the problem for some , then SETH is false.
The previously known techniques for approximating Diameter in directed graphs fail here. The main issue is that the prior techniques were general enough that they also gave algorithms for Eccentricities and Radius as a byproduct. In the Bichromatic case, however, there is a genuine difference between Diameter and Radius, as we noted above, and new techniques are needed. Here again it turns out that combining theme (2) with a delicate argument is sufficient to get conditionally tight algorithms under SETH.
Subset Versions.
Recall that Subset Diameter, Radius, and Eccentricities are the versions of the corresponding problems with the constraint that . Interestingly, Subset Diameter, Radius, and Eccentricities all exhibit the same sharp threshold behavior. For all three problems, there are near-linear time algorithms that achieve a 2 (or almost 2) approximation, as well as conditional lower bounds that show that there is no approximation in time.
Parameterized Algorithms.
We consider the Bichromatic Diameter, Radius, and Eccentricities problems parameterized by the size of the boundary between the and sets. If is the set of vertices in that have a neighbor in , and is the set of vertices in that have a neighbor in , then the boundary is whichever of or is smaller in size. Our lower bound constructions already have small boundary so they rule out algorithms even for graphs with small boundary. However, interestingly we obtain near-linear time algorithms for graphs with small boundary that achieve better multiplicative approximation factors than the optimal non-parameterized algorithms. This is not a contradiction because our parameterized algorithms have a constant additive error, while the apparently contradictory lower bounds do not tolerate additive error.
2 Preliminaries
Given a graph (directed or undirected, weighted or unweighted), let denote the distance from to . For a subset and , define . Similarly .
Unless otherwise stated, denotes the number of edges and the number of vertices of the underlying graph. Without loss of generality, we can assume that all undirected graphs are connected, and all directed graphs are weakly connected, so that .
The Eccentricity of a vertex is . The Diameter of is , and the Radius of is .
Given , we define analogous parameters as follows. The -Eccentricity of is . The -Diameter is , and the -Radius is .
The above parameters are called Bichromatic Eccentricities, Diameter, and Radius if and form a partition of , i.e. .
The above parameters are called Subset Eccentricities, Diameter, and Radius if and are notated with subscript instead of .
2.1 Preliminaries for algorithms
Lemma 2.1**.**
Let be a (possibly directed and weighted graph) and let . Let be an integer. Let be a random subset of vertices for some constant . For every , let be the set of vertices for which . Then with probability at least , for every , , and moreover, if one takes the closest vertices of to , they will contain .
Proof.
For each , imagine sorting the nodes according to . Define to be the first nodes in this sorted order - those are the nodes of closest to (in the direction).
We pick randomly by selecting each vertex of with probability . The probability that a particular is not in is , and the probability that no is in is . By a union bound, with probability at least , for every , we have that .
Now, for each particular , say that is a node in . Since all nodes with must be in , and since , we must have that . Hence, with probability at least , for every , and .
Lemma 2.2**.**
Let be a (possibly directed and weighted) graph. Let and let be a random subset of vertices for some large enough constant and some integer .
Then, for any and for any with , if one takes the closest vertices of to , they will contain all nodes of at distance from , with high probability.
Proof.
Let be the closest vertices of to . By Lemma 2.1, with high probability contains all nodes of at distance from , and hence contains all nodes of at distance from , with high probability.
We sometimes sample edges instead of vertices, so analogous lemmas to Lemmas 2.1 and 2.2 hold when the sample is from a set of edges. Here is the analogue of Lemma 2.2. The other lemma is similar.
Lemma 2.3**.**
Let be a (possibly directed and weighted graph) and let . Let be a random subset of edges for some large enough constant and some integer . Let be the endpoints of edges in that are in .
Then, for any , and for any with , if one takes the closest edges of to wrt the distance from their endpoints, they will contain all edges of whose endpoints are at distance from , with high probability.
2.2 Preliminaries for lower bounds
The Strong Exponential Time Hypothesis (SETH) asserts that on a Word-RAM with bit words, there is no time (possibly randomized) algorithm for some constant that can determine whether a given CNF-Formula with variables and clauses is satisfiable. (This version of SETH is equivalent to the original formulation by Impagliazzo, Paturi and Zane [14].) By a result of Williams [26], the following Orthogonal Vectors (OV) Problem requires time (on a word-RAM with bit words), unless SETH fails: given two sets with and , determine whether there are with .
Given an arbitrary instance of OV with (while respecting , e.g. ), consider the following graph representation, which we call the OV-graph: the vertex set consists of a node for every , for every and for every coordinate , and there is an edge if and only if . OV is then equivalent to the question of whether there exist such that . In fact, it is equivalent to distinguishing whether for every , (no OV-solution), or there is some such that (OV-solution). In other words, if we set , the -Diameter of the OV-graph is if and only if there is no OV-solution and at least otherwise. Because the OV graph has , under SETH, any -approximation algorithm for -Diameter requires .
A related problem to OV is the Hitting Set (HS) problem [1, 13, 25]: given two sets with and , determine whether there is such that for all , . A common hypothesis is that (on the word-RAM) HS requires time.
If we form the OV-graph on the HS instance input, then the HS problem becomes equivalent to determining whether there is some such that for all , . In other words, if we set , the -Radius of the OV-graph is if and only if there is a HS-solution and at least otherwise. Thus, under the HS hypothesis, any -approximation algorithm for -Radius requires .
Additionally for our constructions we assume that if there is a HS solution then for all , . This is because for every coordinate index there must be with as otherwise we can just delete the bit from all vectors.
Let be an integer. Then, a generalization of the OV problem is -OV: given sets , are there so that ? It is known that, under SETH, when , there is no time algorithm for -OV (in the word RAM model) [26].
Similar to the OV-graph, Backurs et al. [4] define a graph for -OV which we will refer to as the -OV-graph. We do not explicitly define the -OV-graph here; instead we list its properties in the following theorem.
Theorem 2.1** ([4]).**
Let . Given a -OV instance consisting of sets , each of size , we can in time construct an unweighted, undirected graph with vertices and edges that satisfies the following properties.
The graph consists of layers of vertices . The number of nodes in the sets is and . 2. 2.
* consists of all tuples where for each , . Similarly, consists of all tuples where for each , .* 3. 3.
If the -OV instance has no solution, then for all and . 4. 4.
If the -OV instance has a solution where for each , then if and , then . 5. 5.
For all from 1 to , for all there exists a vertex in adjacent to and a vertex in adjacent to .
2.3 Organization
In Section 3 we present our algorithms for Bichromatic Diameter, Eccentricities, and Radius. In Section 4 we present our algorithms for -Eccentricities and Radius. In Section 5 we present our algorithms for Subset Diameter, Eccentricities, and Radius. In Section 6 we present our parameterized algorithms for Bichromatic Diameter, Radius, and Eccentricities. In Section 7 we present all of our conditional lower bounds.
3 Algorithms for Undirected Bichromatic Diameter, Eccentricities and Radius
3.1 Undirected Bichromatic Diameter
We begin with a simple near-linear time algorithm.
Proposition 1**.**
There is an time algorithm, that given an undirected graph and , can output an estimate such that where is the minimum weight of an edge in .
Proof.
Let be a minimum weight edge of with and . Run Dijkstra’s algorithm from and from . Let . Let be endpoints of an -Diameter path, i.e. . Then, suppose that . In particular, , and hence by the triangle inequality. Also by the triangle inequality,
[TABLE]
Hence, where is the minimum weight of an edge in .
Now we turn to our -approximation algorithms. Our first theorem is for unweighted graphs. Later on, we modify the algorithm in this theorem to obtain an algorithm for weighted graphs as well, and at the same time remove the small additive error that appears in the theorem below.
Theorem 3.1**.**
There is an time algorithm, that given an unweighted undirected graph and , can output an estimate such that if is divisible by , and otherwise .
Proof.
Let and let us assume that is divisible by . If is not divisible by , the estimate we return will have a small additive error. For clarity of presentation, we omit the analysis of the case where is not divisible by 5. However, we include such analyses in our proofs for Bichromatic Radius (Theorem 3.4) and -Eccentricities (Theorem 4.1) and the analysis for Diameter is analogous.
Suppose the (bichromatic) -Diameter endpoints are and and that the -Diameter is . The algorithm does not know , but we will use it in the analysis.
(Algorithm Step 1): The algorithm first samples of size uniformly at random. For every , run BFS, and let .
(Analysis Step 1): If for some we have that , then .
(Algorithm Step 2): Now, sample a set from of size uniformly at random for large enough constant . For every , run BFS and find the closest node of to . Run BFS from every . Let .
(Analysis Step 2): If is at distance from some node of , then (since is closer to than ), and so .
If neither , nor are good approximations, it must be that and . Consider the nodes of that are at distance from , then the node that is furthest from among all nodes of . If neither , nor was a good approximation, and since , we must have that (and also ). In the next step we will look for such a .
(Algorithm Step 3): For each define to be the biggest integer which satisfies and . Let and .
(Analysis Step 3): By Lemma 2.2 we have that whp, the number of nodes of at distance from and the number of nodes of at distance from are both . Also if neither , nor are good approximations, it must be that and and hence .
(Algorithm Step 4): Run BFS from . Take all nodes of at distance from , call these , and run BFS from them. Whp, , so that this BFS run takes time. Let .
For every , let be the closest node of to (breaking ties arbitrarily). Run BFS from each . Let .
(Analysis Step 4): If or , we are done, so let us assume that . Since , and since , it must be that . Let be the shortest to path. Consider the node on for which . If , then since , and hence we ran BFS from . But since , and we have that and hence . Thus, if , it must be that .
(Algorithm Step 5): Take all nodes of at distance from , call these and run BFS from them. Since , whp , so this step runs in time. Let .
(Analysis Step 5): If , we would be done, so assume that . Let be the node on the shortest to path with . Suppose that . Since , and we ran BFS from it. However, also , and hence . Since , it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with . Since is before , , and hence . Thus we ran BFS from . Since has an edge to , . Also, since and , . Thus,
[TABLE]
Hence if we set , we get that .
We now modify the algorithm for unweighted graphs, both making the algorithm work for weighted graphs and removing the additive error, at the expense of increasing the runtime to .
Theorem 3.2**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate such that .
Proof.
Suppose as before the (bichromatic) -Diameter endpoints are and and that the -Diameter is .
(Algorithm Modified Step 1): The algorithm here samples of size uniformly at random, for large enough . Let be the endpoints of edges in that are in . For every , run Dijkstra’s algorithm, and let .
(Analysis Step 1): If for some we have that , then . Let us then assume that .
(Algorithm Modified Step 2): Let be the endpoints of edges in that are in . For every , run Dijkstra’s algorithm and find the closest node of to . Run Dijkstra’s algorithm from every . Let .
(Analysis Step 2): If is at distance from some node of , then (since is closer to than ), and so . Let us then assume that .
As before, if we consider the nodes of that are at distance from , then the node that is furthest from among all nodes of , would have both and , as is in and satisfies . We will find a node with these properties in the next step.
(Algorithm Unmodified Step 3): Perform exactly the same Step 3 as before, finding the largest integer such that there is some node with and .
(Analysis Step 3): Let be the node we found such that . By Lemma 2.3 we have that whp, the number of edges where and and the number of edges where and is at most . Also, if , then , so that we also have that the number of edges where and and the number of edges where and is at most , whp.
(Algorithm Modified Step 4): Run Dijkstra’s algorithm from . Take all edges incident to nodes of at dist from . Call these edges and their endpoints . Run Dijkstra’s algorithm from both of their end points. Whp, and so , so that this Dijkstra run takes time. Let .
For every , determine a closest node to , and run Dijkstra’s algorithm from as well. This search also takes time. Let .
(Analysis Step 4): If , or or , we are done, so let us assume that .
Now consider the node on the shortest to path for which , but such that the node after it on has .
Suppose that . Then since , we have and hence . Let us consider . Since and , . If , then since we ran Dijkstra’s algorithm from , we got . If , then we ran Dijkstra’s algorithm from and , and hence . Thus if neither , nor are good approximations, then .
(Algorithm Modified Step 5): Take all edges incident to nodes of at dist from . Call these edges and their endpoints that are in , . Run Dijkstra’s algorithm from all nodes in .
Since , whp , so this step runs in time. Let .
(Analysis Step 5): If , we would be done, so assume that . Let be the node on with but so that the node after on has . Suppose that . Since , , and we ran Dijkstra’s algorithm from . However, also , and hence . Since , it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with . However, since is before , we have that . Thus, and we ran Dijkstra’s algorithm from . However, , and hence .
Hence if we set , we get that .
3.2 Undirected Bichromatic Radius
We begin with a simple near-linear time algorithm that achieves almost a -approximation.
Theorem 3.3**.**
Let be an undirected graph with nonnegative edge weights . Let . There is an time algorithm that outputs an estimate such that . If is unweighted, the algorithm runs in time and .
Proof.
The algorithm is as follows. Let be the smallest weight edge among those with . Run Dijkstra’s algorithm from and output .
Clearly . Let be the true -center. Then for all , . On the other hand, , and hence .
For unweighted graphs, and we can run BFS instead of Dijkstra’s algorithm.
We now present a algorithm for Bichromatic Radius, similar in spirit to our Bichromatic Diameter algorithm.
Theorem 3.4**.**
There is an time algorithm, that given an undirected unweighted graph and , can output estimates such that . If is divisible by , .
Proof.
Let be the -center of and let be the -Radius.
(Algorithm Step 1): The algorithm samples of size uniformly at random. For every , run BFS and find which is closest to . Let .
Then sample of size uniformly at random. For every , run BFS and find which is closest to . Let .
Let be the node minimizing . Let . Let be the node maximizing .
(Analysis Step 1): We know that , and hence .
Suppose that for every , . Then, and hence and would be a good approximate center. Thus, we can assume that there exists some with , and in particular, .
Moreover, suppose that there is some such that . Then, , contradicting the fact that . Thus, we must have that .
Now, since is random of size , by Lemma 2.2, the number of nodes of at distance from is at most , whp. Similarly, since is random of size , by Lemma 2.2, the number of nodes of at distance from is at most , whp.
(Algorithm Step 2): Run BFS from . Take the closest nodes of at distance from . Run BFS from all , and find closest to . Run BFS from each .
Let .
(Analysis Step 2): Since , the runtime of this step is .
Since , we know that . Now consider the node on the shortest to path for which , but such that the node after it on has . Since the graph is unweighted, we get that
Let us consider . Since and , .
Suppose that . By our previous argument, as , must be in . Then we ran BFS from and , and hence . Thus if is not a good approximation, then .
(Algorithm Step 3): Take the closest nodes of to . Call these . Run BFS from every . Set .
(Analysis Step 3): Since , the runtime of this step is .
Let be the node on with but so that the node after on has . We have that
Suppose that . As and is among the closest nodes to by our previous argument, we ran BFS from .
However, also , and hence . If is not a good approximation, it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with . However, since is before , we have that . Thus, and we ran BFS from . However, , and hence . Hence for every , . If is divisible by 3, the only source of additive error is the from using the edge instead of .
Hence if we set , we have . If is divisible by 3, .
We now use edge sampling to remove the additive error and make the algorithm work for weighted graphs as well, at the expense of increasing the runtime to .
Theorem 3.5**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output estimates such that .
Proof.
Let be the -center of and let be the -Radius.
(Algorithm Step 1): We sample edges uniformly at random. Let be the endpoints that are in and let be the endpoints in . For every , run Dijkstra and find which is closest to . Let .
For every , run Dijkstra and find which is closest to . Let .
Let be the node minimizing . Run Dijkstra from . Let . Let be the node maximizing .
(Analysis Step 1): The algorithm runs in time.
We know that , and hence .
Suppose that for every , . Then, and hence and would be a good approximate center. Thus, we can assume that there exists some with , and in particular, .
Moreover, suppose that there is some such that . Then, , contradicting the fact that . Thus, we must have that .
Now, since is random of size , by Lemma 2.3, the number of edges where and is at most , whp. Similarly, the number of edges where and is at most , whp.
(Algorithm Step 2): Run Dijkstra from . Consider the edges with sorted in nondecreasing order according to . Let be the first edges in this sorted order. Run Dijkstra from both endpoints of each edge in . Call those endpoints that are in and those in . Let .
For every , determine a closest node to , and run Dijkstra’s algorithm from as well. Let .
(Analysis Step 2): Since , the runtime of this step is .
If or , we are done. So let us assume that . Also, since , we know that .
Now consider the node on the shortest to path for which , but such that the node after it on has .
Suppose that . Then since and since by the previous argument the edges from nodes at distance from is at most , must be among the edges in . We thus run Dijkstra’s from both and .
Let us consider . Since and , . If , then since we ran Dijkstra’s algorithm from , we got . If , then we ran Dijkstra’s algorithm from and , and hence . Thus if neither nor are good approximations, then .
(Algorithm Step 3): Consider the edges with sorted in nondecreasing order according to . Let be the first edges in this sorted order. Run Dijkstra from both endpoints of each edge in . Call those endpoints that are in . Let .
(Analysis Step 3): As , , so this step runs in time.
If , we would be done, so assume that . Let be the node on with but so that the node after on has . Suppose that . Then since , , and we ran Dijkstra’s algorithm from . However, also , and hence . Since , it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with . However, since is before , we have that . Thus, and we ran Dijkstra’s algorithm from . However, , and hence .
Hence if we set , we have
3.3 Undirected Bichromatic Eccentricities.
In the next section we will give approximation algorithms for -Eccentricities in undirected graphs which imply algorithms for bichromatic Eccentricities in undirected graphs with same guarantees. We reproduce them here for convenience.
Proposition 2**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate for each node such that .
Theorem 3.6**.**
There is an time algorithm, that given an unweighted graph and , can output an estimate for each such that . If is divisible by , .
Theorem 3.7**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output estimates for each , such that .
3.4 Directed Bichromatic Diameter
Theorem 3.8**.**
There is an time algorithm, that given a directed graph with nonnegative integer weights and , can output an estimate such that .
Proof.
Suppose the (bichromatic) -Diameter endpoints are and and that the -Diameter is . The algorithm does not know , but we will use it in the analysis.
(Algorithm Step 1): The algorithm first samples of size for large enough uniformly at random from the edges which go from to . Let be the set of nodes incident to these edges. Define .
(Analysis Step 1): If there exists an with then we are done as by triangle inequality .
(Algorithm Step 2): Let be the vertex in which maximizes . Defining the distance to an edge to be distance to we find the closest edges to which cross from to . Let be the set of nodes incident to these edges. Let and . Our estimate is .
(Analysis Step 2): Note that all estimates are underestimates so we will just bound from below. Suppose then we are already done. So we can assume that . Let be the first edge going from to in the shortest path from to . If then by Lemma 2.3, this edge is among the closest edges to . Hence
4 Algorithms for -Eccentricities and Radius
All of the algorithms in this section are for undirected graphs; we later prove that the directed versions of these problems do not admit truly subquadratic algorithms with any finite approximation factor.
We do not give algorithms for -Diameter, as tight algorithms were already given in [4].
4.1 -Eccentricities
We begin with a near-linear time -approximation algorithm.
Proposition 3**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate for each node such that .
Proof.
The algorithm is as follows. Pick an arbitrary node and run Dijkstra’s algorithm from it. Let be a node in maximizing , and run Dijkstra’s algorithm from . For each , output .
Clearly . Now suppose that is the farthest node from in . So we have , where the first and third inequalities are from triangle inequality and the second inequality is from the definition of .
Now we turn to our -approximation algorithms. Our first theorem is for unweighted graphs. Later on, we modify the algorithm in this theorem to obtain an algorithm for weighted graphs as well, and at the same time remove the small additive error that appears in the theorem below.
Theorem 4.1**.**
There is an time algorithm, that given an undirected unweighted graph and , can output an estimate for each such that . If is divisible by , .
Proof.
For each , let be the farthest node from , i.e. .
(Algorithm Step 1): The algorithm samples of size uniformly at random. For every , run BFS and find which is closest to (if , ). Let .
Run BFS from each node . For each let .
Let be the node maximizing .
(Analysis Step 1): This step of the algorithm runs in .
Suppose there is some node such that . Then , and so is a good approximation for . Thus we can assume that , and so . Now since is random of size , by Lemma 2.2, the number of nodes of at distance from is at most whp.
Moreover, suppose that there is some node such that . Then , contradicting the fact that . Thus, we must have that .
Now, since is random of size , by Lemma 2.2, the number of nodes at distance from is at most whp.
(Algorithm Step 2): Run BFS from . For each , let .
Take the closest nodes of to . Call these . Run BFS from all , and let . Let .
(Analysis Step 2): If , then is a good estimate. So assume that .
Now consider the node on the shortest to path for which , but such that the node after it on has . Since the graph is unweighted, we get that .
If , then by the previous argument since , and we run BFS from . Since and , we have . So . Moreover, if is the farthest node from in , then , and hence is a good estimate.
So assume that .
(Algorithm Step 3): Take the closest nodes of to . Call these . Run BFS from all and find . Run BFS from each , and let . Let .
(Analysis Step 3): Consider the node on for which , but such that the node after it on has . Since the graph is unweighted, we get that .
If , then since , by previous argument and we run BFS from . Since , we have that . Similar to the previous step, we get that . By considering the farthest node from in , we can show that and hence is a good approximate. So if is not a good approximate, it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with and . However, since is on , we have . Thus, and we run BFS from . However, , and hence . So we get that
[TABLE]
Moreover, if is the farthest node in , then . Hence if for each we set , we have .
We now use edge sampling to remove the additive error from the above algorithm and make the algorithm work for weighted graphs as well, at the expense of increasing the runtime to .
Theorem 4.2**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output estimates for each , such that .
Proof.
For each , let be the farthest node from , i.e. .
(Algorithm Step 1): We sample edges uniformly at random. Run Dijkstra from both endpoints of edges in (we call these vertices ), and for each endpoint , find which is closest to . Let .
Run Dijkstra from each node in , and for each , let .
Let be the node maximizing .
(Analysis Step 1): Since , this step takes time.
Suppose there is some node such that . Then , and so is a good approximation for . Thus we can assume that , and so . Now since is random of size , by Lemma 2.3, the number of edges where and is at most , whp.
Moreover, suppose that there is some edge such that . Then , contradicting the fact that . Thus, we must have that .
Now, since is random of size , by Lemma 2.3, the number of edges where such that is at most , whp.
(Algorithm Step 2): Run Dijkstra from . For each , let .
Consider the edges sorted in nondecreasing order according to . Let be the first edges in this sorted order. Let be the endpoints of edges in that are in . Run Dijkstra from each node in and let . Let .
(Analysis Step 2): Since , this step takes time.
If , then is a good approximation. So assume that .
Now consider the node on the shortest to path for which , but such that the node after it on has .
Since , by the previous argument the number of edges from the nodes at distance from is at most , and so must be among the edges in . Suppose that . We thus run Dijkstra from .
Let us consider . Since and , . Thus . So . Now if is the farthest node from in , then , and hence is a good approximation.
So we assume that .
(Algorithm Step 3): Consider the edges with sorted in nondecreasing order according to . Let be the first edges in this sorted order. Run Dijkstra from both endpoints of each edge in (call these nodes ), and find closest to , for each . Run Dijkstra from each , and let . Let .
(Analysis Step 3):
Consider the node on for which , but such that the node after it on has .
Suppose that , then since , by the previous argument and we run Dijkstra from . Let us consider . Since , . Similar as in the previous step, we get that and also , thus is a good approximation. So if is not a good approximation, it must be that .
Now, since and , somewhere on the to shortest path , there must be an edge with and . However, since is on , we have . Thus, and we run Dijkstra from .
Let us consider . Since , . Moreover since is after on , , and thus . So .
Hence if for each we set , we have .
4.2 -Radius
A simple argument shows that given any approximation algorithm for -Eccentricities, one obtains an approximation algorithm for -Radius with the same approximation factor. First, run the -Eccentricities algorithm and let be the vertex with the smallest estimated Eccentricity . Then run Dijkstra’s algorithm from and report as the -Radius estimate . Let be the true -Radius of the graph and let be the true -center. If is the approximation ratio for the -Eccentricities algorithm then and . By choice of , . Thus, . Clearly , so .
Thus, we get the following theorems from our algorithms for -Eccentricities.
Theorem 4.3**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output an estimate such that .
Theorem 4.4**.**
There is an time algorithm, that given an undirected unweighted graph and , can output an estimate such that .
Theorem 4.5**.**
There is an time algorithm, that given an undirected graph with nonnegative integer edge weights and , can output estimates such that .
5 Algorithms for Subset Diameter, Eccentricities, and Radius
We obtain 2-approximations for Subset Diameter in directed graphs and Subset Radius in undirected graphs simply by running Dijkstra’s algorithm from an arbitrary vertex . We obtain an almost 2-approximation in almost linear time for directed Subset Eccentricities (and thus directed Subset Radius) by a slight modification of an algorithm for (non-Subset) Eccentricities in directed graphs from [4].
Proposition 4** (Directed Subset Diameter).**
There is an time algorithm, that given a directed graph with nonnegative integer weights and , outputs an estimate such that .
Proof.
Run Dijkstra’s algorithm both “forward” and “backward” from to obtain and . Return .
Let be the true endpoints of the Subset Diameter. Then, by the triangle inequality . Then since and , . Thus, .
Proposition 5** (Undirected Subset Radius).**
There is an time algorithm, that given an undirected graph with nonnegative integer weights and , outputs an estimate such that .
Proof.
Run Dijkstra’s algorithm from and return .
Let be the true center. Then since for all , the triangle inequality implies that for all , . Thus, .
Theorem 5.1** (Directed Subset Eccentricities).**
Suppose that we are given a directed graph with nonnegative integer weights. For any we can in time output for all an estimate such that .
Proof.
The algorithm proceeds in iterations and maintains a set of nodes for which we still do not have a good Eccentricity estimate. In each iteration either we get a good estimate for many new vertices and hence remove them from , or we remove all vertices from that have large Eccentricities, and for the remaining nodes in we have a better upper bound on their Eccentricities. After a small number of iterations we have a good estimate for all vertices of the graph. Initially and we will end with . When we can evaluate for all in the total time of .
Also we maintain a value that upper bounds the largest Eccentricity of a vertex in . That is, for all . Initially we set for some large enough constant (we assume that the set is strongly connected). The algorithm proceeds in phases. Each phase takes time and either decreases by a factor of at least or decreases by a factor of at least . After phases either or .
For a subset of vertices and a vertex we define a set to contain those vertices from that are closest to (according to distance ). The ties are broken by taking the vertex with the smaller id. Given a subset of vertices and a threshold , a phase proceeds as follows.
- •
We sample a set of random vertices from the set . By Lemma 2.1, with high probability for all we have .
- •
Let be the vertex in that maximizes . We can find it by constructing a vertex adjacent to every vertex in and running Dijkstra’s algorithm from .
- •
We consider two cases.
Case .
For all we have and we assign the estimate . This gives us that for all . We update to be . This decreases the size of by a factor of as required.
Case .
Set . For every vertex evaluate . We can evaluate these quantities by running Dijkstra’s algorithm from every vertex in and following the incoming edges. If , then assign the estimate and remove from . Similarly as in the previous case we have for all . Below we will show that for every we have . Thus we can update and decrease the threshold to as required.
Correctness
We have to show that, if there exists such that , then we will end up in the first case (this is the contrapositive of the claim in the second case). Since we must have that for all . Since , we must have that there exists such that . By the triangle inequality we get that for every . By choice of , we have . Since , we have and we will end up in the first case.
The guarantee on the approximation factor follows from the description.
Directed Subset Radius
Using the argument from Section 4.2, we obtain an algorithm for Directed Subset Radius from our algorithm for Directed Subset Eccentricities.
Theorem 5.2** (Directed Subset Radius).**
Suppose that we are given a directed graph with nonnegative integer weights. For any we can in time output an estimate such that .
6 Parameterized Algorithms for Bichromatic Diameter, Radius, and Eccentricities
In this section we give algorithms for Bichromatic Diameter, Radius, and Eccentricities with runtimes parameterized by the size of the boundary . Let be the set of vertices in that have a neighbor in and let be the set of vertices in that have a neighbor in . Let be whichever of or is smaller in size.
6.1 Undirected Parameterized Bichromatic Diameter
Theorem 6.1**.**
There is an time algorithm, that given an unweighted undirected graph and , outputs an estimate such that .
Proof.
(Algorithm): For all , we let ( is already defined for ). Suppose without loss of generality that (a symmetric argument works for ). For every vertex , run BFS from , let be an arbitrary neighbor of such that , and run BFS from . Let be the largest distance found. That is, . Let be the farthest vertex from . That is, is the vertex in that maximizes . Then, we run BFS from and let . Return .
(Analysis): Let be the true endpoints of the Bichromatic Diameter and let denote . If is of distance at most from some vertex then by the triangle inequality so and we are done. If is of distance at most from some vertex then by the triangle inequality so and we are done.
Now, if we are not already done, is of distance at least from every vertex in , so is also of distance at least from every vertex in . Additionally, is of distance at least from every vertex in . We observe that the shortest path between and must contain a vertex in . Thus, . Thus, and we are done.
6.2 Undirected Parameterized Bichromatic Radius
Theorem 6.2**.**
There is an time algorithm that, given an unweighted undirected graph and , returns an estimate such that .
Proof.
(Algorithm): If , we run BFS from all and let be the minimum Eccentricity found; that is, . If , for every , we let be an arbitrary neighbor of such that , and run BFS from . In this case we let . Let be the set of vertices that we have run BFS from so far.
Then, let be the vertex that is closest to all vertices in ; that is, let be the vertex that minimizes . Run BFS from and let . Return .
(Analysis): Let be the true center and let denote ; that is, . If there exists a vertex such that , then since and by the triangle inequality, and we are done.
If we are not done by the previous step, must be of distance at least from every vertex in , and thus of distance at least from every vertex in . We observe that the shortest path between and any vertex in must contain a vertex in . Thus, every vertex in must be of distance at most from some vertex in , and thus of distance at most from some vertex in .
Since for all , , the triangle inequality implies that for all , . Therefore, by choice of , for all , . We claim that . Consider an arbitrary vertex . Let be a vertex in such that ; such a exists by the previous paragraph. Then, . Thus, .
6.3 Undirected Parameterized Bichromatic Eccentricities
Theorem 6.3**.**
There is an time algorithm that, given an unweighted undirected graph and , returns for every an estimate such that .
Proof.
(Algorithm): Suppose . For every vertex , we run BFS from , let be the vertex in that maximizes , and run BFS from . Then for every vertex we let be an arbitrary neighbor of such that and run BFS from . Then, let be the farthest vertex from ; that is, is the vertex in that maximizes . Let be the set of vertices in that we have run BFS from. For every vertex , we return the estimate .
We use a similar algorithm for when : For every vertex , we run BFS from , let be the vertex in that maximizes , and run BFS from . Then, let be the farthest vertex from ; that is, is the vertex in that maximizes . Let be the set of vertices in that we we have run BFS from. For every vertex , we return the estimate .
(Analysis): Suppose . If there exists a vertex in such that , then so we are done. On the other hand, suppose . If there exists a vertex in such that , then we are done. Otherwise, is of distance at most from every vertex in . Thus, regardless of whether or , if we are not already done, is of distance at most from every vertex in .
Then, since every path from to any vertex in must contain a vertex in , there must exist a vertex in that is of distance at least from every vertex in . In particular, must be of distance at least from every vertex in .
Let be the true farthest vertex from ; that is, . If there exists a vertex in such that , then by the triangle inequality , so . Applying the triangle inequality again, , so we are done. Otherwise, every vertex is of distance at least from .
We claim that if we are not already done, . We observe that every path from to must contain a vertex in . Let be a vertex on the shortest path from to . Then, .
6.4 Directed Parameterized Bichromatic Diameter
For Bichromatic Diameter in undirected graphs, we assumed that only one of or was small (i.e. we set to be the smaller of the two); however for directed graphs we impose that both and are small, by defining a new parameter .
Theorem 6.4**.**
There is an time algorithm that, given an unweighted directed graph and , returns an estimate such that .
Proof.
(Algorithm): For all , we let denote ( is already defined for ). Run forward BFS from every vertex in and run backward BFS from every vertex in . Let be the largest distance found. That is, . Let be the farthest vertex from . That is, is the vertex in that maximizes . Then, we run BFS from and let . Return .
(Analysis): Let and be the true Bichromatic Diameter endpoints and let denote . If there exists a vertex such that , then by the triangle inequality, so and we are done. Similarly, if there exists a vertex such that , then by the triangle inequality, so and we are done.
Suppose we are not done. Then, for every vertex , and for every vertex , . By choice of , for all , . We observe that every path from to must contain an edge from a vertex in to a vertex in . Let be an edge on the shortest path from to . Then, , so .
7 Conditional Lower Bounds
7.1 Bichromatic Diameter, Eccentricities, and Radius
Undirected Bichromatic Diameter
The following theorem implies that our algorithms for undirected Bichromatic Diameter from Theorem 3.2 and Proposition 1 are tight under SETH.
Theorem 7.1**.**
Under SETH, for every , every algorithm that can distinguish between Bichromatic Diameter and in undirected unweighted graphs requires time.
In particular setting and 3 in Theorem 7.1 implies that our time -approximation algorithm from Theorem 3.2 is tight in approximation factor and runtime, respectively. Furthermore, setting to be arbitrarily large implies that our time almost 2-approximation algorithm from Proposition 1 is tight under SETH.
Theorem 7.1 follows from the following lemma.
Lemma 7.1**.**
Let be any integer. Given a -OV instance, we can in time construct an unweighted, undirected graph with vertices and edges that satisfies the following two properties.
If the -OV instance has no solution, then for all pairs of vertices and we have . 2. 2.
If the -OV instance has a solution, then there exists a pair of vertices and such that .
Proof.
Construction of the graph. We begin with the -OV-graph from Theorem 2.1. Additionally, we add new layers of vertices , where each new layer contains vertices and is connected to the previous layer by a matching. That is, each new layer contains one vertex for every tuple where for all , and each is connected to its counterpart by an edge, for all .
We let and we let contain the rest of the vertices in the graph.
Correctness of the construction.
Case 1: The -OV instance has no solution. By property 3 of Theorem 2.1 for all and , . Then, since form a series of matchings, for all and , . Furthermore, property 5 of Theorem 2.1 implies that for all and , . Thus, we have shown that for all and we have .
Case 2: The -OV instance has a solution. Let be a solution to the -OV instance where for all . We claim that . Since form a series of matchings, every path from to contains the vertex . By property 4 of Theorem 2.1, . Thus, .
Undirected Bichromatic Eccentricities
The following proposition implies that our algorithms for undirected Bichromatic Eccentricities from Theorem 3.7 and Proposition 2 are tight under SETH.
Proposition 6**.**
Under SETH, for every , every algorithm that can distinguish between Bichromatic Eccentricities and in undirected unweighted graphs requires time.
In particular setting and 3 in Theorem 6 implies that our time -approximation algorithm from Theorem 3.7 is tight under SETH in approximation factor and runtime, respectively. Furthermore, setting to be arbitrarily large implies that our time almost 3-approximation algorithm from Proposition 2 is tight under SETH.
Proposition 6 follows from the following lemma.
Lemma 7.2**.**
Let be any integer. Given a -OV instance, we can in time construct an unweighted, undirected graph with vertices and edges that satisfies the following two properties. Let be a particular subset of .
If the -OV instance has no solution, then for all vertices we have . 2. 2.
If the -OV instance has a solution, then there exists a vertex such that .
Proof.
We begin with the -OV-graph from Theorem 2.1. Let and let contain the rest of the vertices in the graph. Let .
If the -OV instance has no solution then by property 3 of Theorem 2.1 for all and , . Thus, for all , .
Suppose the -OV instance has a solution . Then by property 4 of Theorem 2.1, , so .
Undirected Bichromatic Radius
The following theorem implies that our time -approximation algorithm for undirected Bichromatic Radius from Theorem 3.5 is tight in approximation factor under the HS hypothesis.
Theorem 7.2**.**
Under the HS hypothesis, any algorithm for Bichromatic Radius that achieves a -approximation factor for in -edge undirected unweighted graphs requires time.
Proof.
Given an instance of OV, let be its OV-graph. Create which has the same vertex set as except instead of having a vertex for every it has two copies and .
The edges for are: for , we add as an edge iff . For , we add as an edge iff . For each we add an edge . Set and . The number of edges in the graph is .
Suppose that there is no HS solution, then for all there is some so that and hence . If there is an HS solution , then for all , .
Directed Bichromatic Diameter
The following theorem implies that our -approximation algorithm for directed Bichromatic Diameter from Theorem 3.8 has a tight approximation factor under SETH.
Theorem 7.3**.**
Under SETH, any algorithm for directed Bichromatic Diameter that achieves a -approximation factor for in -edge graphs requires time.
Proof.
We will show that under SETH, for any positive integer , distinguishing between Bichromatic Diameter and requires time.
Given an instance of OV, let be its OV-graph. Create which has the same vertex set as except instead of having one vertex for every it has copies for . It also has additional vertices: .
The edges of are: for , we add as an edge iff , and for , we add as an edge iff . We add a matching going from to where edges join the nodes which are copies of each other. For each , we add an edge . We add a path from to . For each , we add an edge . Set . The number of edges in the graph is .
Consider any . By construction, for . Suppose that there is no OV solution, then for all , and hence . If there is an OV solution , then, as the only path is through .
Directed Bichromatic Eccentricities
Proposition 7**.**
Under SETH, any algorithm for Bichromatic Eccentricities that achieves a finite approximation factor in -edge directed graphs requires time.
Proof.
Given an instance of OV, let be its OV-graph. Now, direct the edges from to and from to and set , . Notice this is an instance of Bichromatic Eccentricities.
Now, for every , if , and if , as there is no path from to . Thus, if there is an OV pair, then the -Eccentricity for every is , and otherwise it is . Any finite approximation to the -Eccentricities can distinguish between and , and thus can solve OV. (Notice, we do not even need the Eccentricities of nodes in .) Thus, there can be no time algorithm for that achieves a finite approximation factor if SETH holds.
Directed Bichromatic Radius
Proposition 8**.**
Under the HS hypothesis, any algorithm for Bichromatic Radius that achieves a finite approximation factor in -edge directed graphs requires time.
Proof.
The proof is similar to that for Bichromatic Eccentricities. Given an instance of HS, let be its OV-graph. Now, direct the edges from to and from to , and add an extra node so that for every there is a directed edge . Set , .
First, if the -Radius is finite, the -center (the node achieving the Radius) must be in , since no node in can reach , by construction. The distance is for all . For every , if , and if , as there is no path from to . Thus, if there is a HS solution, then the -Radius is , and otherwise it is . Any finite approximation to the -Radius can distinguish between and , and thus can solve HS. Thus, there can be no time algorithm for that achieves a finite approximation factor if the HS hypothesis holds.
7.2 -Diameter, Eccentricities, and Radius
Undirected -Diameter and Eccentricities
For undirected graphs, Backurs et al. [4] give a time-accuracy trade-off lower bound for -Diameter that immediately extends to -Eccentricities (since any Eccentricities algorithm gives a Diameter algorithm with the same running time and accuracy by taking the maximum of Eccentricities).
The following theorem shows that our algorithms for -Eccentricities from Theorem 4.2 and Proposition 3 are tight under SETH.
Theorem 7.4** ([4]).**
Under SETH, for every , every algorithm for -Diameter (and thus -Eccentricities) that achieves a -approximation for in undirected unweighted graphs requires time.
In particular, setting and in Theorem 7.4 shows that our time -approximation algorithm for -Eccentricities from Theorem 4.2 is tight under SETH, in terms of both approximation factor and runtime. Furthermore, setting to be arbitrarily large implies that our time 3-approximation algorithm for -Eccentricities from Proposition 3 is tight under SETH.
Undirected -Radius
The following proposition shows that our time 2-approximation algorithm for undirected -Radius from Theorem 4.5 has a tight approximation factor under the HS hypothesis.
Proposition 9**.**
Under the HS hypothesis, any algorithm for -Radius that achieves a -approximation for in -edge undirected graphs requires time.
Proof.
Given an instance of HS, let be the OV-graph defined on this instance. Let and . Suppose that there is a node which is not orthogonal to any node in . Then for each , by using the coordinate node on which both and are . So in this case the -Radius is . Suppose on the other hand that no such node in exists, so that for each node there is a node such that . Then . Since , the -Radius is at least in this case.
So any -approximation algorithm can distinguish between -Radius and , and thus solve HS. Therefore, there can be no time algorithm for that achieves a -approximation factor if HS hypothesis holds.
Directed -Diameter
Proposition 10**.**
Under SETH, any algorithm for -Diameter that achieves a finite approximation factor in -edge directed graphs requires time.
Proof.
Given an instance of OV, let be its OV-graph. Now, direct the edges from to and from to and set , .
Now, for every , if , and if , as there is no path from to . Thus, if there is an OV pair, then the -Diameter is , and otherwise it is . Any finite approximation to the -Diameter can distinguish between and , and thus can solve OV. Thus, there can be no time algorithm for that achieves a finite approximation factor if SETH holds.
Directed -Eccentricities and Radius
Propositions 7 and 8 immediately carry over to Directed -Eccentricities and -Radius since the Bichromatic version is a special case of the version. We state the results here for convenience.
Proposition 11**.**
Under SETH, any algorithm for -Eccentricities that achieves a finite approximation factor in -edge directed graphs requires time.
Proposition 12**.**
Under the HS hypothesis, any algorithm for -Radius that achieves a finite approximation factor in -edge directed graphs requires time.
7.3 Subset Diameter, Eccentricities, and Radius
Subset Diameter and Eccentricities
The following proposition implies that our time 2-approximation algorithm for Subset Diameter from Proposition 4 is tight under SETH, and that our near-linear time almost 2-approximation algorithm for Subset Eccentricities from Theorem 5.1 is essentially tight under SETH.
Proposition 13**.**
Under SETH, any algorithm for Subset Diameter (and thus Subset Eccentricities) that achieves a -approximation factor for in -edge directed graphs requires time.
Proof.
Given an instance of OV, we begin with the OV-graph defined on this instance. We add a vertex adjacent to every vertex in and a vertex adjacent to every vertex in . Let .
If there is no OV solution, every pair of vertices , . Also, every pair of vertices or has due to the addition of the vertices and .
On the other hand, if there is an OV solution, in the original OV-graph there exists , such that . We note that the addition of the vertices and does not change this fact.
Subset Radius
The following proposition implies that our time 2-approximation algorithm for Subset Radius from Proposition 5 is tight under the HS hypothesis.
Proposition 14**.**
Under the HS hypothesis, any algorithm for Subset Radius that achieves a -approximation factor for in -edge undirected graphs requires time.
Proof.
Given an instance of HS, we begin with the OV-graph defined on this instance. Then we add a vertex adjacent to every vertex in and a vertex adjacent to . Let .
If there is no HS solution, then in the original OV-graph, for all , there exists some such that . We note that the addition of the vertices and does not change this fact. Furthermore, for all vertices , . Thus, the Subset Radius is at least 4.
On the other hand, if there is a HS solution, then there exists a vertex such that for all vertices , . Also, . Thus, the Subset Radius is 2.
7.4 Parameterized Bichromatic Diameter, Eccentricities, and Radius
In this section we show that modifications of our lower bound constructions show that our algorithms parameterized by the boundary size for Bichromatic Diameter, Eccentricities, and Radius are conditionally tight. Recall that for undirected graphs, is the set of vertices in that have a neighbor in , is the set of vertices in that have a neighbor in , and is whichever of or is smaller in size. Since these our parameterized algorithms for undirected graphs have additive error, instead of showing that e.g. distinguishing between values 2 and 3 is hard, we will give results of the form “for all , distinguishing between e.g. and is hard”. This proves that even algorithms with constant additive error cannot achieve a better multiplicative approximation factor than e.g. .
Undirected Parameterized Bichromatic Diameter
The following theorem implies that the multiplicative factor in our time almost -approximation algorithm for undirected Bichromatic Diameter from Theorem 6.1 is tight under SETH for .
Theorem 7.5**.**
For any integer , under SETH any algorithm for Bichromatic Diameter in undirected unweighted graphs that distinguishes between Bichromatic Diameter and requires time, even for graphs with .
Proof.
Construction
Given an instance of OV, we begin with the OV-graph , , defined on this instance. We add a new set of vertices, one vertex for each vector in , and connect each vertex in to its corresponding vertex in to form a matching. Symmetrically, we add a new set of vertices, one vertex for each vector in , and connect each vertex in to its corresponding vertex in to form a matching. Then we subdivide each of the edges in the graph into a path of length . Let contain as well as the vertices on the subdivision paths from to and from to . Let be the remaining vertices, that is, contains , , the vertices that subdivide the edges between and , and the vertices that subdivide the edges between and .
Analysis
We note that and so .
If the OV instance has no solution then for every pair of vertices , , . Every vertex in is at most distance from some vertex in and every vertex in is at most distance from some vertex in so the Bichromatic Diameter is at most .
Suppose the OV instance has a solution , . We know that . Let be the vertex in that is matched to and let be the vertex in that is matched to . We claim that . Since and form matchings the only paths between and contain and . Thus, .
Undirected Parameterized Bichromatic Eccentricities
The following proposition implies that the multiplicative factor in our time almost -approximation algorithm for undirected Bichromatic Eccentricities from Theorem 6.3 is tight under SETH for .
Proposition 15**.**
For any integer , under SETH any algorithm for Bichromatic Eccentricities in undirected unweighted graphs that distinguishes for all vertices between and requires time, even for graphs with .
Proof.
Construction
Given an instance of OV, we begin with the OV-graph , , defined on this instance. We add a new set of vertices, one vertex for each vector in , and connect each vertex in to its corresponding vertex in to form a matching. Then we subdivide each of the edges in the graph into a path of length . Let contain , , and the vertices that subdivide the edges between and . Let contain the remaining vertices.
Analysis
We note that and so .
If there is no OV solution, then for all pairs of vertices , , . Every vertex in is of distance at most from some vertex in so for all vertices , .
If there is an OV solution , , . Let be the vertex matching to . Then, so .
Undirected Parameterized Bichromatic Radius
The following theorem implies that the multiplicative factor in our time almost -approximation algorithm for undirected Bichromatic Radius from Theorem 6.2 is tight under the HS hypothesis for .
Theorem 7.6**.**
For any integer , under the HS hypothesis any algorithm for Bichromatic Radius in undirected unweighted graphs that distinguishes between Bichromatic Radius and requires time, even for graphs with .
Proof.
Construction
Given an instance of HS, we begin with two copies of the construction from Theorem 7.5, , , , , , and , , , , . We then merge each vertex in with its corresponding vertex in .
Analysis
We note that and so .
It will be convenient to imagine that the graph is layered from left to right as , , , , , , , , .
If there is no HS solution, then for all , there exists some such that and for all , there exists some such that . Let be any vertex in that lies in or to the right of . Since any path to a vertex in contains a vertex in , there exists such that . Symmetrically, if is a vertex in that lies to the left of , there exists such that . Thus, the Bichromatic Radius is at least .
On the other hand, if there is a HS solution, then there exists a vertex such that for all vertices , . Let be the vertex in matched to and let be the vertex in matched to . Then, for all vertices , . Thus, for all vertices , , so for all vertices , . Thus, the Bichromatic Radius is at most .
Directed Parameterized Bichromatic Diameter
Recall that for directed graphs, is the set of vertices in with an outgoing edge to a vertex in , is the set of vertices in with an incoming edge from a vertex in , and . We will show that the construction from Theorem 7.5 can be made to have small (i.e. small and ), with a slight additive cost to the Diameter values. The construction will remain undirected.
The following proposition implies that the multiplicative factor in our time almost -approximation algorithm for Directed Bichromatic Diameter from Theorem 6.4 is tight under SETH for .
Proposition 16**.**
For any integer , under SETH any algorithm for Bichromatic Diameter in directed unweighted graphs that distinguishes between Bichromatic Diameter and requires time, even for graphs with .
Proof.
Construction
We begin with the construction from Theorem 7.5. We replace each vertex by a pair of vertices , and let be an edge. Let and be the set of all ’s and ’s respectively. That is, and form a matching. For every edge originally between and , we replace it with the undirected edge and for every edge originally between and , we replace it with the undirected edge .
Analysis
The correctness follows from the analysis of Theorem 7.5. Here, we get and instead of and due to the addition of the matching between and .
Acknowledgements
The authors would like to thank Arturs Backurs for discussions during the early stages of this work.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Amir Abboud, Virginia Vassilevska Williams, and Joshua R. Wang. Approximation and fixed parameter subquadratic algorithms for radius and diameter in sparse graphs. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016 , pages 377–391, 2016.
- 2[2] Pankaj K. Agarwal, Herbert Edelsbrunner, Otfried Schwarzkopf, and Emo Welzl. Euclidean minimum spanning trees and bichromatic closest pairs. Discrete Comput. Geom. , 6(1):407–422, December 1991.
- 3[3] D. Aingworth, C. Chekuri, P. Indyk, and R. Motwani. Fast estimation of diameter and shortest paths (without matrix multiplication). SIAM Journal on Computing , 28(4):1167–1181, 1999.
- 4[4] Arturs Backurs, Liam Roditty, Gilad Segal, Virginia Vassilevska Williams, and Nicole Wein. Towards tight approximation bounds for graph diameter and eccentricities. In Proceedings of STOC’18 , page to appear, 2018.
- 5[5] Massimo Cairo, Roberto Grossi, and Romeo Rizzi. New bounds for approximating extremal distances in undirected graphs. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2016, Arlington, VA, USA, January 10-12, 2016 , pages 363–376, 2016.
- 6[6] T. M. Chan. More algorithms for all-pairs shortest paths in weighted graphs. In Proc. STOC , pages 590–598, 2007.
- 7[7] Bernard Chazelle, Herbert Edelsbrunner, Leonidas J Guibas, and Micha Sharir. Algorithms for bichromatic line-segment problems and polyhedral terrains. Algorithmica , 11(2):116–132, 1994.
- 8[8] Shiri Chechik, Daniel H. Larkin, Liam Roditty, Grant Schoenebeck, Robert Endre Tarjan, and Virginia Vassilevska Williams. Better approximation algorithms for the graph diameter. In Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014 , pages 1041–1052, 2014.
