1 Introduction
This paper addresses exact diameter computation on several new classes of unweighted (undirected) graphs with a geometric flavor. We recall that the diameter of an unweighted graph is the maximum number of edges on a shortest path. Beyond its many practical applications, this fundamental problem in Graph Theory has attracted a lot of attention in the finegrained complexity study of polynomialtime solvable problems [AVW16, BRSV+18, BCH16, CGR16, CLRG+14, Dah6, Duc19, EvD16, RoV13]. More precisely, for every vertex edge unweighted graph the textbook algorithm for computing its diameter runs in time . In a seminal paper [RoV13] this roughly quadratic runningtime was matched by a quadratic lowerbound, assuming the Strong ExponentialTime Hypothesis (SETH). We stress that for graphs with millions of nodes and edges, quadratic time is already too prohibitive.
The conditional lowerbound of [RoV13] also holds for sparse graphs i.e., with only edges [AVW16]. However it does not hold for many wellstructured graph classes [AVW16, BCD98, BHM18, CDHP01, Cab18, CDP18, Dam16, Duc19, Epp00, FaP80, GKHM+18, Ola90]. Our work proposes some new advances on the characterization of graph families for which we can compute the diameter in truly subquadratic time.
1.1 Related work
Before we detail our contributions, we wish to mention a few recent (and not so recent) results that are most related to our approach.
Interval graphs.
An early example of lineartime solvable special case for diameter computation is the class of interval graphs [Ola90]. For every interval graph and for any integer , if we first compute an interval representation for in lineartime [HMPV00] then we can compute by dynamic programming, for every vertex , the contiguous segment of all the vertices at a distance from in . It takes almost lineartime and it implies a straightforward quasi lineartime algorithm for diameter computation. More efficient algorithms for diameter computation on interval graphs and related graph classes were proposed in [CDHP01]. Nevertheless we will show in what follows that interval orderings are a powerful tool for diameter computation on more general geometric graph classes.
Boundedtreewidth graphs.
More recently, quasi lineartime algorithms for diameter computation on boundedtreewidth graphs were presented in [AVW16, BHM18] with almost optimal dependency on the treewidth parameter. The cornerstone of these algorithms is the use of range trees in order to detect the furthest pairs that are disconnected by some smallcardinality separators. Since then a few other applications of range trees and, more generally, orthogonal range searching for diameter computation, have been presented in [Duc19, DHV19+]. In our work we uncover deeper connections between diameter computation and range searching techniques from computational geometry.
Planar graphs.
Finally, in a recent breakthrough paper [Cab18], Cabello presented the first truly subquadratic algorithm for diameter computation on planar graphs (see also [GKHM+18] for improvements on his work). For that he combined divisions: a recursive decomposition technique for planar graphs and other hereditary graph classes with sublinear balanced separators, with a clever use of additively weighted Voronoi diagrams. Cabello conjectured that his algorithm could be generalized to boundedgenus graphs although he sketched several difficulties to deal with before such a result can be obtained. Following his work, we partly reuse divisions within our algorithms. However we replace his intricate use of Voronoi diagrams with a quite different approach that is based on some interval representations of the balls of a given radius in a graph. In doing so, we can obtain truly subquadratictime algorithms for diameter computation on bounded genus graphs (and more generally, on any proper minorclosed graph family) while avoiding a great deal of topological complications.
We stress that for the aforementioned graph classes, the techniques used for computing their diameter are quite different from each other. Our work is a first step toward unifying all these previous results for unweighted graphs in a single framework (note that some of the aforementioned results also hold in the directed weighted case).
1.2 Our contributions
We study the parameterization of graph diameter by the VCdimension of various hypergraphs. More precisely, a set is shattered by a hypergraph if by intersecting with all hyperedges of one obtains the powerset of . The VCdimension of is then defined as the largest cardinality of a subset shattered by . This powerful notion was first introduced by Vapnik and Chervonenkis in [VaC15]
. Since then it has found applications in sampling complexity and machine learning, among other domains. We refer to
[KKR+97] for early work on VCdimension in graphs. In particular, the VCdimension of a graph is defined as the VCdimension of its closed neighbourhood hypergraph: whose hyperedges are the closed neighbourhoods of vertices in . Graphs of bounded interval number and proper minorclosed graph classes are two examples of graph families with a constant upperbound on their VCdimension [BoT15, KKR+97].First example.
As an appetizer we first consider an vertex split graph with cliquenumber , that is a notouriously hard case for diameter computation [BCH16]. Given such a split graph with stable set and maximal clique , we can preprocess in lineartime so as to partition the vertices of into twin classes: with two vertices in being called twins if and only if they have the same neighbourhood in (e.g., see [CDP18]). If the VCdimension of is at most then, by the SauerShelahPerles Lemma [Sau72, She72] the number of twin classes is an . Therefore, after some lineartime preprocessing, we are left with computing the diameter on a graph of polylogarithmic order! Unfortunately, such simple bruteforce arguments are no longer sufficient for split graphs of arbitrary cliquesize.
Overview of our techniques.
In order to generalize our approach to any graph of constant VCdimension, we use the central notion of spanning paths with low stabbing number. Chazelle and Welzl [ChW89] defined a spanning path for a hypergraph as a total ordering of its vertexset. The stabbing number of such a path is, up to , the maximum number of intervals of which a hyperedge in can be the union (we refer to Sec. 2 for a formal definition).
Assume for now that we are given a spanning path with stabbing number for the closed neighbourhood hypergraph of . Then in linear time, we can compute for every vertex the ends of the intervals of which is the union. We denote this set of intervals by in what follows. Then, in order to decide whether has diameter at most two, it is sufficient to check whether for every vertex we have . Since we only need to consider the ends of such intervals, this verification phase takes time for a vertex of degree , and so, total time. Note that such runningtime is always subquadratic if is sublinear in . Overall, we so reduced the diametertwo problem to the computation of a spanning path with low stabbing number for the closed neighbourhood hypergraph.
Motivated by range searching problems, Chazelle and Welzl proved the existence of spanning paths with strongly sublinear stabbing number for every hypergraph of constant VCdimension [ChW89]! We so obtain our first main result in this paper:
Theorem 1.
For every , there exists a constant such that in time we can decide whether a graph of VCdimension at most has diameter two.
We stress that in contrast to Theorem 1, under the Strong ExponentialTime we cannot decide whether a general graph has diameter at most two in truly subquadratic time [RoV13].
On our way to prove Theorem 1 our main difficulty was to show how to compute for a hypergraph a spanning path of low stabbing number. Computing a spanning path of minimum stabbing number is NPhard [BGRS04]. However, there exist approximation algorithms for this problem that run in polynomial time [BGRS04, Har09]
. Their approximation ratio is logarithmic, that is fine for our applications. Unfortunately, all these algorithms require us to solve a linear program. So far, the best known algorithms for this intermediate problem run in superquadratic time
[CLS18+]. We show how to decrease the runningtime of this part, at the price of a slightly increased stabbing number. For that, we carefully apply these previous approximation algorithms to some arbitrary partition of in subhypergraphs of sublinear size. This nice trick might be of independent interest.Theorem 2.
For every , there exists a constant such that in time, for every vertex hypergraph of VCdimension at most and order , we can compute a spannning path of stabbing number .
Moreover, for some universal constant .
From VCdimension to distance VCdimension.
In order to go beyond Theorem 1, we need to consider a stronger notion of VCdimension for graphs. The distance VCdimension^{1}^{1}1Our definition of distance VCdimension is slightly weaker than the one proposed in [BoT15]. of is equal to the VCdimension of its ball hypergraph: of which the hyperedges are all possible balls in . Note that a bounded distance VCdimension implies a bounded VCdimension, but the converse a priori does not hold. Nevertheless, and perhaps surprisingly, there are still many classes of graphs with a constant distance VCdimension. These classes include, among others: interval graphs, planar graphs and, more generally, any proper minorclosed graph family, as well as graphs of bounded rankwidth [BoT15].
Theorem 3.
For every positive integers and , there exists a constant that only depends on and such that, in time , we can decide whether a graph of distance VCdimension at most has diameter at most .
Eppstein proved in [Epp00] that for any constant , we can decide in linear time whether the diameter of a planar graph is at most . Our result can be seen as a generalization of his to any graph class of constant distance VCdimension – but at the price of a superlinear runningtime. Furthermore, our techniques also apply to superconstant diameters, say polylogarithmic in , or even polynomial in provided the exponent is in .
Our main technical contribution in this part is the efficient computation of spanning paths with strongly sublinear stabbing number for some dense hypergraphs of constant VCdimension. More precisely, the neighbourhood hypergraph of has for hyperedges the balls of radius in . For instance, the neighbourhood hypergraph of is exactly its closed neighbourhood hypergraph. In order to prove Theorem 3, we reduce the problem of deciding whether a graph has diameter at most to the computation of a spanning path with low stabbing number for its neighbourhood hypergraph. In this sense, the proofs of Theorems 1 and 3 are very similar. However, an additional difficulty here is that we cannot have direct access to this neighbourhood hypergraph. Indeed, in the worst case all hyperedges of this hypergraph may have a cardinality in , and then storing the hypergraph itself would already require quadratic space.
We overcome this issue by computing an net [HaW87, VaC15] in order to partition the vertices of the graph in a small number of groups, with every two vertices in the same group having almost the same ball of radius . By selecting only one vertex per group, we so reduce the number of hyperedges (i.e., balls of radius ) to be considered. Finally, once a spanning path was computed for this smaller hypergraph, for every unselected vertex we compute the symmetric difference between its ball of radius and the one of the unique vertex taken in its group. Our solution in order to do that efficiently is to first compute a spanning path with low stabbing number for the neighbourhood hypergraph. This is where the dependency on occurs, as overall we will need to compute a spanning path for consecutive hypergraphs.
We note that this above technique can be applied under slightly weaker hypothesis than the one we state in Theorem 3. For instance, Nešetřil and Ossona de Mendez proved that for all nowhere dense graph classes (i.e., a broad generalization of proper minorclosed graph classes and boundeddegree graphs), for any graph in the class and for any constant , the VCdimension of the neighbourhood hypergraph is constantly upperbounded [NeO16]. It allows us to derive the following weaker version of our Theorem 3:
Theorem 4.
Let be a class of nowhere dense graphs. Then, for every constant , there exists a constant such that for any graph in , we can decide whether its diameter is at most in time .
Let us mention that under SETH, Theorem 4 is the best result that we can hope for nowhere dense graph classes. Indeed, boundeddegree graphs are nowhere dense and, under SETH, we cannot compute their diameter in truly subquadratic time even if it is in [EvD16].
We conjecture that on every graph family of constant distance VCdimension, we can compute the diameter in truly subquadratic time. Our next main result shows the conjecture to be true for any monotone graph family with strongly sublinear balanced separators, a.k.a the graphs of polynomial expansion [DvN16].
Theorem 5.
Let be a monotone graph class with strongly sublinear balanced separators. Then for every , there exists a constant such that in time , we can compute the diameter of any graph in of distance VCdimension at most .
Let us recall that minor free graphs have a constant distance VCdimension [BoT15], and that they all have strongly sublinear balanced separators [AST90, KaR10, Wul11]. Therefore, as an important consequence of Theorem 5, we get a truly subquadratictime algorithm for computing the diameter on all the proper minorclosed graph classes.
It might be tempting, in the above Theorem 5, to drop the assumption that the distance VCdimension must be bounded. Unfortunately, this cannot be done assuming SETH. Indeed, there is also an equivalence between the graphs of strongly sublinear treewidth and those monotone graph classes with strongly sublinear balanced separators [DvN19]; however it follows from [AVW16] that under SETH, we cannot compute the diameter in truly subquadratic time already for vertex graphs of treewidth . Conversely, not all graph classes with constant distance VCdimension have strongly sublinear separators. This can be seen, e.g., with interval graphs.
The speedup of Theorem 5 follows from a faster computation of spanning paths for the neighbourhood hypergraphs. More precisely, we explain how to compute a spanning path for the neighbourhood hypergraph of from a spanning path of its neighbourhood hypergraph. Note that in doing so, we only need to consider logarithmically many intermediate hypergraphs in order to compute such spanning path. Our approach for that consists in computing a first (suboptimal) representation of the neighbourhood of every vertex. Then, as for Theorem 3, we partition the vertices into a small number of groups and we select a unique vertex in each group. The suboptimal representations are used at the end of the algorithm in order to compute, for every unselected vertex, the symmetric difference between its ball of radius and the one of the unique vertex taken in its group. So the problem becomes how to compute efficiently these suboptimal representations?
For that, we use a rather classical divideandconquer approach. Federickson [Fed87] proved that a planar graph can be edgecovered with subgraphs of order at most such that at most vertices of each subgraph can be contained in another subgraph of this decomposition. His construction directly follows from the planar separator theorem of Lipton and Tarjan [LiT79], and as such it can be easily adapted for any monotone graph family with sublinear balanced separators [HKRS97]^{2}^{2}2Note that Federickson proposed several refinements of his construction in [Fed87], some of which do use the fact that the input graph is planar. We will use in our proofs an even weaker version of his result than the one presented in this introduction.. For illustrating our method, we now focus in this introduction on the planar case. We can first compute, for some wellchosen , a decomposition as described above. For every two vertices in a same subgraph, we can check whether they are at distance at most by checking whether their balls of radius intersect; assuming is small enough, and we precomputed a spanning path with low stabbing number for the neighbourhood hypergraph, this phase can be implemented in order to run in truly subquadratic time. Then for every subgraph of the decomposition, we compute a breadthfirst search from each of the boundary vertices that are also contained in another subgraph. Overall, there can only be such boundary vertices, and so, it takes truly subquadratic time. Furthermore in doing so, we computed for every subgraph of the decomposition the distances between the boundary vertices and all the others. For any vertex that is not on the boundary, we observe that a vertex in another subgraph can be at a distance from if and only if it is at distance from some vertex on the boundary ( balls to be considered). Our strategy consists in computing a spanning path with low stabbing number for some “boundary hypergraph” whose hyperedges are the balls that we so obtained. We encounter a similar problem as for Theorem 3 because storing this hypergraph may require superquadratic space. Fortunately, we can encode this hypergraph in a much more compact way by taking advantage of (i) the fact that we can only have different centers for the balls, and (ii) that all the balls with a same center have a chainlike inclusion structure.
Although we keep the focus on computing the diameter, we shall stress in Sec. 2.4 that all our techniques can also be applied to radius computation (i.e., see Remark 1). Our algorithms almost need no particular information about the graph structure in order to be applied. In fact, we do not even need to compute the (distance) VCdimension of the input graph! From the applicative point of view, this observation (further discussed in Sec. 2.4) is quite important. Indeed, computing the VCdimension is W[1]hard [DEF93] and LogNPhard [PaY96].
1.3 Organization of the paper
In Sec. 2 we formally introduce the concepts of (distance) VCdimension and stabbing number, along with some of their basic properties. Then, we explain in Sec. 3 how to compute a spanning path with strongly sublinear stabbing number for a hypergraph of constant VCdimension (Theorem 2). As a direct application, we give a short proof of Theorem 1. Our techniques are generalized in Sec. 4 so as to prove Theorems 3 and 4. Finally, our main technical result (Theorem 5) is proved in Sec. 5. For that, we will need to recall some useful results on the graphs of polynomial expansion [DvN16]. We discuss some possible future work in Sec. 6.
2 Preliminaries
After recalling a few basic definitions about graphs and hypergraphs (Sec. 2.1 and 2.2) we introduce our framework for computing the diameter of a graph in Sec. 2.3 and 2.4.
2.1 Graphs and Diameter
For any undefined graph terminology, see [BoM08]. Throughout all this paper we only consider graphs that are undirected, unweighted and connected. For every graph , let be its order and be its size. We denote by and the open and closed neighbourhoods of vertex , respectively. The degree of is equal to and is denoted by in what follows. The length of a path is its number of edges, and the distance between is equal to the length of a shortest path. For every and , the neighbourhood of , also known as the ball of center and radius , is defined as . For instance, is exactly the closed neighbourhood of . The diameter of is equal to .
Problem 1 (Diameter).
Input: A graph . Output: The diameter of .Theorem 6 ( [RoV13]).
Under the Strong ExponentialTime Hypothesis, we cannot decide whether a graph has diameter at most two in time , for any .
2.2 Hypergraphs
More generally, a hypergraph is a pair with being the set of vertices and being the set of hyperedges. See also [Ber73] for any undefined hypergraph terminology. Let , and be the size, the order and the number of hyperedges of , respectively. For every vertex , let . The dual of is the hypergraph , where . In particular, and are isomorphic.
Several hypergraphs can be related to a graph :

The closed neighbourhood hypergraph, denoted by , has for vertexset and hyperedgeset ;

More generally, for every fixed , the neighbourhood hypergraph of is defined as . We stress that and its dual are isomorphic [BoT15].

Finally, the ball hypergraph of , simply denoted by , has for hyperedges the balls of all possible center and radius in . Equivalently, .
2.3 VCdimension
Let be a fixed hypergraph. A subset is shattered by if, for every , there exists a hyperedge such that . Then, the VapnikChervonenkis dimension of (abbreviated in what follows to VCdimension) is the largest cardinality of a shattered subset. Similarly, the dual VCdimension of is the VCdimension of its dual . We will often use the following (easy) properties in our analysis:
Lemma 1 (SauerShelahPerles, [Sau72, She72]).
Every vertex hypergraph of VCdimension at most has hyperedges.
Lemma 2 ([ChW89]).
Every hypergraph of VCdimension has dual VCdimension at most .
Lemma 3 ([Kle04]).
For every hypergraph and , let . Then, the VCdimension of is at most the VCdimension of .
VCdimension for graphs.
The VCdimension of a graph is defined as the VCdimension of its closed neighbourhood hypergraph . For instance, minor free graphs (and so, minor free graphs for any of order at most ) have VCdimension at most [ABC95]. Every interval graph has VCdimension in [DHV19+]. Other classes of constant VCdimension – at most three – are unit disk graphs, chordal bipartite graphs, free bipartite graphs, graphs of girth at least five and undirected path graphs [BLLP+15].
The distance VCdimension of a graph is defined as the VCdimension of its ball hypergraph . Bousquet and Thomassé proved in [BoT15] that for many interesting graph classes the distance VCdimension is upperbounded by some constant. In particular, planar graphs have distance VCdimension at most , and more generally every minor free graph has distance VCdimension at most . Graphs of bounded distance VCdimension also generalize graphs of bounded rankwidth. Indeed, every graph of rankwidth has distance VCdimension at most . For purpose of illustration, we next adapt a proof from [BLLP+15] in order to show that interval graphs have distance VCdimension at most two:
Lemma 4.
Every interval graph has distance VCdimension at most .
Proof.
Let be an interval graph. We fix an interval model for . For every , let be the corresponding interval in the representation. Suppose now by contradiction that there is a set that is shattered by . W.l.o.g., . Since is shattered, there exist some and such that . But then, let be the contiguous segment of all the vertices at a distance from . Note that because we assume that . In this situation, either or . In fact we must have because otherwise, and so, , a contradiction. Since , it implies that , and so, . As a result we have . But then, for any and , we have . The latter contradicts our hypothesis that is shattered. ∎
2.4 Stabbing number and applications to Diameter
A spanning tree of is a tree whose nodeset is exactly . The stabbing number of such spanning tree is the least such that, for every hyperedge , there exist at most edges such that (we also say that is stabbed by ). Given a set , we let of all edges stabbed by . Finally, the stabbing number of is the minimum stabbing number over its spanning paths^{3}^{3}3As noted in [ChW89], every spanning tree can be transformed into a spanning path of stabbing number at most twice bigger than for . Therefore, there is essentially no loss of generality in restricting ourselves to spanning paths..
Lemma 5 ( [ChW89]).
Every vertex hypergraph of dual VCdimension has stabbing number .
Overall it follows from Lemmata 2 and 5 that any vertex hypergraph of VCdimension at most has strongly sublinear stabbing number in . We stress that the proof of Lemma 5 is constructive but that it cannot be transformed in a truly subquadratictime algorithm. Efficient computations of spanning paths with sublinear stabbing number – or related data structures – were proposed for many special cases from computational geometry [Cha12, Mat91, Wel92].
Problem 2 (Approx Stabbing Number).
Input: A hypergraph of VCdimension at most . Output: A spanning path of stabbing number at most and, for every , the set of all edges stabbed by .For simplicity of exposition, we will assume throughout the remainder of this paper that the VCdimension of all the hypergraphs considered is part of the input. However in practice, we can easily weaken this assumption as follows. Given some “guess” on the VCdimension of the input, we can modify our proposed solutions so that they either output a spanning path whose stabbing number is at most , for some function , or conclude that the VCdimension of the input is larger than . By dichotomic search, we so can compute some minimum such that, for any , our algorithms always output a spanning path of stabbing number . We stress that is at most the VCdimension of , but that it can be much smaller in practice.
Reduction from diameter computation.
We now recall the following simple but beautiful approach that we use in order to solve Diameter on graphs of constant VCdimension.
Lemma 6.
Let be a graph and . If the hypergraph has VCdimension at most , and we can solve Approx Stabbing Number for in time , then we can decide whether has diameter at most in time .
Proof.
Let us first compute a spanning path of stabbing number at most for . By the hypothesis, it takes time. For every we can compute from a set of intervals, where , such that . This preprocessing phase takes time , and so, total time. Then in order to decide whether , we are left deciding whether for every we have . For that, it suffices to collect the ends of the intervals in , and then to order them lexicographically. As a result, this last verification phase can be done in total time . ∎
Remark 1.
The radius of a graph is equal to . Under the Hitting Set conjecture, we cannot compute the radius of a graph in truly subquadratictime [AVW16]. We here observe that we can easily modify the framework of Lemma 6 in order to decide whether a graph has radius at most . Indeed, for that it suffices to check whether there exists at least one vertex such that .
Our main task in the remainder of this article will be to solve Approx Stabbing Number efficiently on neighbourhood hypergraphs, for some fastly growing function . Then, we can apply Lemma 6 in order to efficiently solve Diameter.
3 Computation of Spanning paths with low Stabbing Number
We prove in this section our first main result in the paper, whose statement is reminded below:
See 1
We will need the following result in our proofs:
Lemma 7 ( [Bgrs04, Har09]).
There is a polynomialtime algorithm that outputs, for every vertex hypergraph of stabbing number , a spanning path of stabbing number .
The algorithm from [Har09] works by phases. During a phase, it needs to solve an ILP relaxation and then to apply some randomized rounding technique. In the worst case, this main phase is repeated times. We observe that even by using the best known upperbounds on the time complexity of linear programming, this overall process takes superquadratic time. In what follows, we use the SauerShelahPerles Lemma (Lemma 1) in order to obtain better tradeoffs between the runningtime and the quality of our approximation.
See 2
Proof.
Let to be fixed later in the proof. We partition the vertexset into subsets such that and, for every , . Our aim is to apply Lemma 7 to the subhypergraphs . We stress that all these subhypergraphs can be constructed in total time, as follows: we scan all the hyperedges once in order to compute ; then, for every , we use a lineartime sorting algorithm in order to suppress duplicated values in .
Claim 1.
Given , we can compute a spanning path for of stabbing number . Moreover, it takes time for some universal constant .
Proof. By Lemma 3, every has VCdimension at most . This implies that has hyperedges (Lemma 1), and so it has order . Furthermore by Lemma 2 has dual VCdimension at most , and so by Lemma 5, its stabbing number is in . By Lemma 7 we can compute a spanning path of stabbing number , in time for some universal constant .
Let be the spanning paths that we so computed. We obtain a spanning path for by concatenating all the ’s. For every , we recall that the stabbing number of is in . Therefore by construction, the stabbing number of is in .
Let be the spanning path obtained with Claim 1. Finally, for every we compute the set of all edges of stabbed by , in total time, simply by scanning once all the hyperedges. The total runningtime is in . Overall, we achieve a good tradeoff between runningtime and approximation factor if we have . Therefore we set , and then . ∎
We observe that our analysis could be easily improved in some particular cases, e.g., for all hypergraphs that are isomorphic to their dual.
We are now ready to prove the main result in this section:
4 Bounded Diameter with nets
For graphs of bounded distance VCdimension we now generalize Theorem 1 from the previous section to larger values for the diameter.
See 3
Our proof crucially relies on the concept of net. We recall that for a hypergraph , a subset is called an net if, for every , we have .
Lemma 8 ([HaW87, VaC15]).
For every hypergraph of VCdimension at most , any random subset of size is an
net with probability
.We will also need the following result:
Lemma 9 ( [ChW89]).
For every hypergraph , let be the set of symmetric differences between hyperedges. If has VCdimension at most then, has bounded VCdimension.
We observe that no explicit upper bound on the VCdimension of was stated in [ChW89]. Nevertheless it can be easily deduced from their proof that it is in (see also [EiA07]).
The following partition lemma is the cornerstone of our algorithm.
Corollary 1.
Let be a graph of distance VCdimension at most , and let be any random subset of size . Then w.h.p., for every and for every such that , we have .
Proof.
This above partition lemma will be useful in order to group the vertices in a small number of groups, with every two vertices in a group having almost the same ball of radius . Here there is a tradeoff between the number of groups (that we upperbound by using the SauerShelahPerles Lemma) and, for every two vertices in the same group, the maximum number of vertices in which their respective balls of radius can differ.
More precisely, our approach in the next two sections can be summarized as follows:

We compute a spanning path for of low average stabbing number, with the latter being equal to ;

Then, we compute an net, for some wellchosen , and in doing so we partition the vertexset into disjoint groups . For every we select a unique . We restrict ourselves to . We compute a spanning path of low stabbing number for this subhypergraph.

We observe that if is a spanning path of stabbing number for , then it is also a spanning path of stabbing number for . Finally, for every , we consider the unselected vertices sequentially. We compute the set of all the edges in that are stabbed by . For that, it suffices to compute the vertices of . We do so efficiently by using the auxiliary spanning path .
We next give a first application of our approach (we will give another such application in the proof of Theorem 5).
Proof of Theorem 3. Let be the constant of Theorem 2. We shall prove the following claim by finite induction:
Claim 2.
For every , we can compute a spanning path of stabbing number for . Moreover, it can be done in time .
The result will follow from this claim and Lemma 6 by taking .
Proof. By Theorem 2, the claim is true for the base case . Assume by our induction hypothesis that the claim holds for . We divide the remainder of the proof into two subclaims.
Subclaim 1.
Let be a spanning path of stabbing number for . We can transform into a spanning path for , such that . Moreover, the transformation takes time .
Proof. Let . Then in time , we can collect the edgesets of all the edges of that are stabbed by , for . We compute from these edgesets a (suboptimal) representation of into intervals of .
Subclaim 2.
Let be a spanning path for , such that . Then, in time , we can compute a spanning path of stabbing number .
Proof. Let . We perform a breadthfirst search from every vertex in some random subset of cardinality . In doing so we define an equivalence relation on such that . We so partition into some groups . Since by the hypothesis has distance VCdimension at most then, by Lemma 1 we have . Furthermore by Corollary 1, we have w.h.p. . The algorithm now proceeds as follows:

For every , we select a unique , and then we start a breadthfirst search from this vertex. Since and we have , this phase can be implemented in time , that is truly subquadratic.

Let , and let . Note that since , the VCdimension of is at most . Furthermore, the order and the size of are, respectively, and . By Theorem 2, we can compute a spanning path for of stabbing number in time .

We observe that is a spanning path of of stabbing number:
We are now left with computing, for every and , the set of all the edges stabbed by the ball of radius centered at . For that, since we are already given , it suffices to compute . We proceed in three steps:

By our hypothesis, we computed a spanning path for , such that . Then, we can compute from a (suboptimal) representation of into intervals. In doing so, we also compute within the same amount of time a representation of into intervals of . Overall this step takes total time .

Let be the permutation that maps every vertex to its position in the spanning path . For every , we construct two balanced binary search trees whose items are, respectively, and . Overall, this takes total time .

Finally, let us again consider some for some . For every interval from , we want to enumerate the vertices of that lie on this interval. Since we stored all of into a balanced binary search tree, this can be done in time plus extra time per solution. In the same way, for every interval from , we enumerate the vertices of that lie on this interval. For a fixed , the total time for this step is in . Therefore, this last step takes total time .

Now, by the induction hypothesis we get a spanning path of stabbing number for . By Subclaim 1 we transform such spanning path into a spanning path for , where . Finally, by Subclaim 2 we can use in order to compute, in time , a spanning path of stabbing number . The above algorithm achieves proving that our claim holds for .
Summarizing, by Claim 2 we can compute a spanning path of stabbing number for the hypergraph , in time . By Lemma 6 it implies that we can also decide whether has diameter at most , and if so compute exactly, in time . ∎
4.1 Application to nowhere dense graph classes
A closer look at the proof of Theorem 3 shows that it also holds if, instead of having bounded distance VCdimension, there rather exists some constant such that, for every , the VCdimension of the neighbourhood hypergraph is at most (the latter value is sometimes called the distance VCdimension of the graph [NeO16]). It has algorithmic implications for some special cases of sparse graphs. Namely, is an shallow minor of a graph if it can be obtained from some subgraph of by the contraction of pairwise disjoint subgraphs of radius at most [PRS94]; a graph family is termed nowhere dense if, for any , there exists a graph which is not an shallow minor for any graph in [NeO12]. Of interest here is that, for any graph class nowhere dense, and for any , the distance VCdimension of any graph in is upperbounded by some constant [NeO16]. By choosing , we so obtain the following weaker version of Theorem 3 for nowhere dense graphs:
See 4
We left open whether there exists a truly subquadratictime FPT algorithm for diameter computation on nowhere dense graph classes (i.e., with no dependency on in the exponent).
5 Diameter computation in truly Subquadratic time
We finally improve the results of Theorem 3 for a more restricted family of graphs of bounded distance VCdimension. Before that, we need to introduce a bit more of graph terminology. A class of graphs is called monotone if it is closed by taking subgraphs. For a connected vertex graph , a separator is a subset such that is disconnected. It is called balanced if every connected component of has order at most . Finally, a class of graphs has strongly sublinear balanced separator if every connected vertex graph in the class has a balanced separator of cardinality at most for some constants and .
See 5
We postpone the technical proof of this result to Sec. 5.2. Let us emphasize that Theorem
Comments
There are no comments yet.