Fast deterministic algorithms for computing all eccentricities in (hyperbolic) Helly graphs
aa r X i v : . [ c s . D S ] F e b Fast deterministic algorithms for computing all eccentricities in(hyperbolic) Helly graphs
Feodor F. Dragan , Guillaume Ducoffe , and Heather M. Guarnera Computer Science Department, Kent State University, Kent, USA [email protected] National Institute for Research and Development in Informatics and University of Bucharest, Bucure¸sti, Romˆania [email protected] Department of Mathematical and Computational Sciences, The College of Wooster, Wooster, USA [email protected]
Abstract.
A graph is Helly if every family of pairwise intersecting balls has a nonempty commonintersection. The class of Helly graphs is the discrete analogue of the class of hyperconvex metricspaces. It is also known that every graph isometrically embeds into a Helly graph, making the latteran important class of graphs in Metric Graph Theory. We study diameter, radius and all eccentricitycomputations within the Helly graphs. Under plausible complexity assumptions, neither the diameternor the radius can be computed in truly subquadratic time on general graphs. In contrast to thesenegative results, it was recently shown that the radius and the diameter of an n -vertex m -edge Hellygraph G can be computed with high probability in ˜ O ( m √ n ) time ( i.e. , subquadratic in n + m ). In thispaper, we improve that result by presenting a deterministic O ( m √ n ) time algorithm which computesnot only the radius and the diameter but also all vertex eccentricities in a Helly graph. Furthermore,we give a parameterized linear-time algorithm for this problem on Helly graphs, with the parameterbeing the Gromov hyperbolicity δ . More specifically, we show that the radius and a central vertex of an m -edge δ -hyperbolic Helly graph G can be computed in O ( δm ) time and that all vertex eccentricitiesin G can be computed in O ( δ m ) time. To show this more general result, we heavily use our newstructural properties obtained for Helly graphs. Given an undirected unweighted graph G = ( V, E ), the distance d G ( u, v ) between two vertices u and v isthe minimum number of edges on any path connecting u and v in G . The eccentricity e G ( u ) of a vertex u isthe maximum distance from u to any other vertex. The radius and the diameter of G , denoted by rad ( G )and diam ( G ), are the smallest and the largest eccentricities of vertices in G , respectively. A vertex witheccentricity equal to rad ( G ) is called a central vertex of G . We are interested in the fundamental problemsof finding a central vertex and of computing the diameter and the radius of a graph. The problem of findinga central vertex of a graph is one of the most famous facility location problems in Operation Research andin Location Science. The diameter and radius of a graph play an important role in the design and analysisof networks in a variety of networking environments like social networks, communication networks, electricpower grids, and transportation networks. A naive algorithm which runs breadth-first-search from each vertexto compute its eccentricity and then (in order to compute the radius, the diameter and a central vertex) picksthe smallest and the largest eccentricities and a vertex with smallest eccentricity has running time O ( nm )on an n -vertex m -edge graph. Interestingly, this naive algorithm is conditionally optimal for general graphsas well as for some restricted families of graphs [1,10,23,66] since, under plausible complexity assumptions,neither the diameter nor the radius can be computed in truly subquadratic time on those graphs. Alreadyfor split graphs (a subclass of chordal graphs), computing the diameter is roughly equivalent to DisjointSets , a.k.a. , the monochromatic Orthogonal Vector problem [19]. Under the Strong Exponential-TimeHypothesis (SETH), we cannot solve
Disjoint Sets in truly subquadratic time [69], and so neither we cancompute the diameter of split graphs in truly subquadratic time [10].In a quest to break this quadratic barrier (in the size n + m of the input), there has been a longline of work presenting more efficient algorithms for computing the diameter and/or the radius on somepecial graph classes, by exploiting their geometric and tree-like representations and/or some forbiddenpattern ( e.g. , excluding a minor, or a family of induced subgraphs). For example, although the diameter ofa split graph can unlikely be computed in subquadratic time, there is an elegant linear-time algorithm forcomputing the radius and a central vertex of a chordal graph [20]. Efficient algorithms for computing thediameter and/or the radius or finding a central vertex are also known for interval graphs [40,63], AT-freegraphs [44], directed path graphs [24], distance-hereditary graphs [26,32,35,39], strongly chordal graphs [28],dually chordal graphs [11,31], chordal bipartite graphs [48], outerplanar graphs [53], planar graphs [15,55],graphs with bounded clique-width [26,47], graphs with bounded tree-width [1,13,51] and, more generally, H -minor free graphs and graphs of bounded (distance) VC-dimension [51]. See also [22,23,43,46,50,52] forother examples.We here study the Helly graphs as a broad generalization of dually chordal graphs which in turn containall interval graphs, directed path graphs and strongly chordal graphs. Recall that a graph is Helly if everyfamily of pairwise intersecting balls has a non-empty common intersection. This latter property on the ballswill be simply referred to as the Helly property in what follows. Helly graphs have unbounded tree-widthand unbounded clique-width, they do not exclude any fixed minor and they cannot be characterized viasome forbidden structures. They are sometimes called absolute retracts or disk-Helly graphs by oppositionto other Helly-type properties on graphs [27]. The Helly graphs are well studied in Metric Graph Theory.
E.g. , see the survey [5] and the papers cited therein. This is partly because every graph is an isometricsubgraph of some Helly graph, thereby making of the latter the discrete equivalent of hyperconvex metricspaces [42,57]. A minimal by inclusion Helly graph H which contains a given graph G as an isometricsubgraph is unique and called the injective hull [57] or the tight span [42] of G . Polynomial-time recognitionalgorithms for the Helly graphs were presented in [6,28,61]. Several structural properties of these graphs werealso identified in [6,7,8,18,28,29,30,33,34,64,65]. The dually chordal graphs are exactly the Helly graphs inwhich the intersection graph of balls is chordal, and they were studied independently from the general Hellygraphs [11,12,41,31,33,68]. As we already mentioned it [11,41,31], the diameter, the radius and a centralvertex of a dually chordal graph can be found in linear time, that is optimal. However, it was open untilrecently whether there are truly subquadratic-time algorithms for these problems on general Helly graphs.First such algorithms were recently presented in [49] for computing both the radius and the diameter andin [45] for finding a central vertex. Those algorithms are randomized and run, with high probability, in˜ O ( m √ n ) time on a given n -vertex m -edge Helly graph ( i.e. , subquadratic in n + m ). They make use of theHelly property and of the unimodality of the eccentricity function in Helly graphs [29]: every vertex of locallyminimum eccentricity is a central vertex. In [49], a linear-time algorithm for computing all eccentricities in C -free Helly graphs was also presented. The C -free Helly graphs are exactly the Helly graphs whose ballsare convex. They properly include strongly chordal graphs as well as bridged Helly graphs and hereditaryHelly graphs [49]. Our Contribution.
We improve those results from [49] and [45] by presenting a deterministic O ( m √ n )time algorithm which computes not only the radius and the diameter but also all vertex eccentricities in an n -vertex m -edge Helly graph. This is our first main result in the paper. Being able to efficiently computeall vertex eccentricities is of great importance. For example, in the analysis of social networks (e.g., citationnetworks or recommendation networks), biological systems (e.g., protein interaction networks), computernetworks (e.g., the Internet or peer-to-peer networks), transportation networks (e.g., public transportationor road networks), etc., the eccentricity e G ( v ) of a vertex v is used to measure its importance in the network:the eccentricity centrality index of v [60] is defined as e G ( v ) .Our second main result is a parameterized linear-time algorithm for computing all vertex eccentricities inHelly graphs, with the parameter being the Gromov hyperbolicity δ , as defined by the following four pointcondition. The hyperbolicity of a graph G [56] is the smallest half-integer δ ≥ u, v, w, x , the two largest of the three distance sums d ( u, v )+ d ( w, x ), d ( u, w )+ d ( v, x ), d ( u, x )+ d ( v, w ) differ byat most 2 δ . In this case we say that G is δ -hyperbolic. As the tree-width of a graph measures its combinatorialtree-likeness, so does the hyperbolicity of a graph measure its metric tree-likeness. In other words, the smallerthe hyperbolicity δ of G is, the closer G is to a tree metrically. The hyperbolicity of an n -vertex graph canbe computed in polynomial-time (e.g., in O ( n . ) time [54]), however it is unlikely that it can be done in2ubquadratic time [10,25,54]. A 2-approximation of hyperbolicity can be computed in O ( n . ) time [54] andan 8-approximation can be computed in O ( n ) time [16] (assuming that the input is the distance matrix ofthe graph). Graph hyperbolicity has attracted attention recently due to the empirical evidence that it takessmall values in many real-world networks, such as biological networks, social networks, Internet applicationnetworks, and collaboration networks, to name a few (see, e.g., [2,3,9,58,62,67]). Furthermore, many specialgraph classes (e.g., interval graphs, chordal graphs, dually chordal graphs, AT-free graphs, weakly chordalgraphs and many others) have constant hyperbolicity [2,4,14,21,34,38,59,70]. In fact, the dually chordalgraphs and the C -free Helly graphs are known to be proper subclasses of the 1-hyperbolic Helly graphs(this follows from results in [12,34]). Notice also that any graph is δ -hyperbolic for some δ ≤ diam ( G ) / m -edge Helly graph G with hyperbolicity δ canbe computed in O ( δm ) time and that all vertex eccentricities in G can be computed in O ( δ m log δ ) time,even if δ is not known to us. If either δ or a constant approximation of it is known, then the running timeof our algorithm can be lowered to O ( δ m ). Thus, for Helly graphs with constant hyperbolicity, all vertexeccentricities can be computed in linear time. As a byproduct, we get a linear time algorithm for computingall eccentricities in C -free Helly graphs as well as in dually chordal graphs, generalizing known resultsfrom [11,31,49]. Previously, for dually chordal graphs, it was only known that a central vertex can be foundin linear time [11,31]. Notice that the diameter problem can unlikely be solved in truly subquadratic timein general 1-hyperbolic graphs and that the radius problem can unlikely be solved in truly subquadratictime in general 2-hyperbolic graphs [23]. For general δ -hyperbolic graphs, there are only additive O ( δ )-approximations of the diameter and the radius, that can be computed in linear time [21,36,37].To show our more general results, additionally to the unimodality of the eccentricity function in Hellygraphs, we rely on new structural properties obtained for this class. It turns out that the hyperbolicity ofa Helly graph G is governed by the size of a largest isometric rectilinear grid in G . As a consequence, thehyperbolicity of an n -vertex Helly graph is at most √ n + 1 and the diameter of the center C ( G ) of G isat most 2 √ n + 3. These properties, along with others, play a crucial role in efficient computations of alleccentricities in Helly graphs. We also give new characterizations of the class of Helly graphs. Among others,we show that the Helly property for balls of equal radii implies the Helly property for balls with variableradii. It would be interesting to know whether a similar result holds for all (discrete) metric spaces. We arenot aware of such a general result. Notations.
Recall that d G ( u, v ) denotes the distance between vertices u and v in G = ( V, E ). Let n = | V | be the number of vertices and m = | E | be the number of edges in G . The ball of radius r and center v isdefined as { u ∈ V : d G ( u, v ) ≤ r } , and denoted by N rG [ v ]. Sometimes, N rG [ v ] is called the r -neighborhoodof v . In particular, N G [ v ] := N G [ v ] and N G ( v ) := N G [ v ] \ { v } denote the closed and open neighbourhoodsof a vertex v , respectively. More generally, for any vertex-subset S and a vertex u , we define d G ( u, S ) :=min v ∈ S d G ( u, v ) , N rG [ S ] := S v ∈ S N rG [ v ] , N G [ S ] := N G [ S ] and N G ( S ) := N G [ S ] \ S . The metric projectionof a vertex u on S , denoted by P r G ( u, S ), is defined as { v ∈ S : d G ( u, v ) = d G ( u, S ) } . The metric interval I G ( u, v ) between u and v is { w ∈ V : d G ( u, w ) + d G ( w, v ) = d G ( u, v ) } . For any k ≤ d G ( u, v ), we can alsodefine the slice L ( u, k, v ) := { w ∈ I G ( u, v ) : d G ( u, w ) = k } . Recall that the eccentricity of a vertex u isdefined as max v ∈ V d G ( u, v ) and denoted by e G ( u ). Note that we will omit the subscript if the graph G isclear from the context. The radius and the diameter of a graph G are denoted by rad ( G ) and diam ( G ),respectively. A vertex c is called central in G if e G ( c ) = rad ( G ). The set of all central vertices of G is denotedby C ( G ) := { v ∈ V : e G ( v ) = rad ( G ) } and called the center of G . The eccentricity function e G ( v ) of a graph G is said to be unimodal , if for every non-central vertex v of G there is a neighbor u ∈ N G ( v ) such that e G ( u ) < e G ( v ) (that is, every local minimum of the eccentricity function is a global minimum). Recall alsothat a vertex set S ⊆ V is called convex in G if, for every vertices x, y ∈ S , all shortest paths connectingthem are contained in S (i.e., I G ( x, y ) ⊆ S ). For β ≥
0, we say that S is β - pseudoconvex [36] if, for everyvertices x, y ∈ S , any vertex z ∈ I G ( x, y ) \ S satisfies min { d G ( z, x ) , d G ( z, y ) } ≤ β . A subgraph H of G iscalled isometric (or distance-preserving) if, for every vertices x, y of H , d G ( x, y ) = d H ( x, y ).3 Characterizations of Helly graphs and hyperbolicity in Helly graphs
Here we demonstrate that for Helly graphs, having a constant hyperbolicity is equivalent to the followingproperties: having β -pseudoconvexity of balls with a constant β , or having the diameter of the center boundedby a constant for all subsets of vertices, or not having a large ( γ × γ ) rectilinear grid as an isometric subgraph.These results generalize some known results from [17,21,34,36].First we give new characterizations of Helly graphs through a formula for the eccentricity function andrelations between diameter and radius for all subsets of vertices. For this we need to generalize our basicnotations. Define for any set M ⊆ V and any vertex v ∈ V the eccentricity of v in G with respect to M asfollows: e M ( v ) = max u ∈ M d G ( u, v ) . Let diam M ( G ) = max v ∈ M e M ( v ), rad M ( G ) = min v ∈ V e M ( v ), C M ( G ) = { v ∈ V : e M ( v ) = rad M ( G ) } . When M = V , these agree with earlier definitions. Theorem 1.
For a graph G the following statements are equivalent:(1) G is Helly;(2) the eccentricity function e M ( · ) is unimodal for every set M ⊆ V ;(3) e M ( v ) = d G ( v, C M ( G )) + rad M ( G ) holds for every set M ⊆ V and every vertex v ∈ V ;(4) rad M ( G ) − ≤ diam M ( G ) ≤ rad M ( G ) holds for every set M ⊆ V ;(5) rad M ( G ) = ⌊ diam M ( G )+12 ⌋ holds for every set M ⊆ V .Proof. The equivalence (1) ⇔ (2) was proven in [28,29]. It was also shown in [28] that (2) and (3) are equivalentfor M = V . Here, we complete the proof of all equivalencies. We will show (2) ⇔ (3), when one considers anyset M ⊆ V , and (1) ⇒ (4) ⇒ (5) ⇒ (1).(2) ⇒ (3): Let M be any subset of V . We will prove the formula in (3) by induction on k = e M ( v ) − rad M ( G ). If k = 0 then e M ( v ) = rad M ( G ), i.e., v ∈ C M ( G ), and the formula is trivially correct. Considernow a vertex v with e M ( v ) > rad M ( G ). By the triangle inequality, e M ( v ) ≤ d G ( v, C M ( G )) + rad M ( G )always holds. As the eccentricity function e M ( · ) is unimodal, there is a neighbor u of v with e M ( v ) > e M ( u ).By induction hypothesis, e M ( u ) = d G ( u, C M ( G )) + rad M ( G ). Hence, by the triangle inequality, e M ( v ) ≥ e M ( u ) + 1 = d G ( u, C M ( G )) + rad M ( G ) + 1 ≥ d G ( v, C M ( G )) + rad M ( G ). Combining both inequalities, weget e M ( v ) = d G ( v, C M ( G )) + rad M ( G ).(3) ⇒ (2): Let M be any subset of V and v be an arbitrary vertex of G with e M ( v ) > rad M ( G ). Let also c v be a vertex of C M ( G ) closest to v and u be a neighbor of v on a shortest path from v to c v . We have e M ( v ) = d G ( v, c v ) + rad M ( G ) = 1 + d G ( u, c v ) + rad M ( G ) ≥ d G ( u, C M ( G )) + rad M ( G ) = 1 + e M ( u ). Inparticular, e M ( v ) > e M ( u ).(1) ⇒ (4): It is clear that diam M ( G ) ≤ rad M ( G ) holds for every graph G and every set M ⊆ V (bythe triangle inequality). Assume now that for a subset M of V , diam M ( G ) ≤ rad M ( G ) − v in M , consider a ball centered at v and with radius rad M ( G ) −
1. All these balls pairwiseintersect as diam M ( G ) ≤ rad M ( G ) −
2. By the Helly property, there must exist a vertex c in G suchthat d G ( c, v ) ≤ rad M ( G ) − v ∈ M . The latter implies that e M ( c ) ≤ rad M ( G ) −
1, giving acontradiction.(4) ⇒ (5): It is straightforward.(5) ⇒ (1): We know that a graph G is Helly if and only if the family of unit balls of G has the Hellyproperty and for any three vertices x, y, v with d G ( x, y ) ≤ d G ( x, v ) = d G ( y, v ) = k ≥ u of x and y such that d G ( v, u ) = k − G a family F of pairwise intersecting unit balls with centers at vertices v , . . . , v q . Define M = { v , . . . , v q } . As the balls pairwise intersect, d G ( v i , v j ) ≤ i, j ∈ { , . . . , q } . Hence, diam M ( G ) ≤ rad M ( G ) = ⌊ diam M ( G )+12 ⌋ ≤
1. The latter implies the existence of a vertex c in G with d G ( c, v i ) ≤ i ∈ { , . . . , q } . Necessarily, c belongs to all unit balls from F . In other words, the familyof unit balls of G has the Helly property. 4et x, y, v be any three vertices of G with d G ( x, y ) ≤ d G ( x, v ) = d G ( y, v ) = k ≥
2. We willshow by induction on k that there exists a common neighbor u of x and y such that d G ( v, u ) = k −
1. If k = 2 then the existence of u follows from the Helly property for the family of unit balls of G . Assumenow that k > k is even, say k = 2 ℓ . Let M = { x, y, v } . As k > diam M ( G ) = k = 2 ℓ and therefore rad M ( G ) = ⌊ diam M ( G )+12 ⌋ = ℓ . Hence, there is a vertex c in G such that d G ( c, v ) = d G ( c, x ) = d G ( c, y ) = ℓ . Notice that ℓ ≥
2. By induction, there must exist a common neighbor u of x and y such that d G ( c, u ) = ℓ −
1. Necessarily, d G ( u, v ) = 2 ℓ − k −
1. Assume now that k is odd, say k = 2 ℓ + 1. If k ≥ x ′ of x on a shortest path from x to v and a neighbor y ′ of y on a shortest path from y to v . Let M = { x ′ , y ′ , v } . As d G ( x ′ , v ) = d G ( y ′ , v ) = k − ≥ d G ( x ′ , y ′ ) ≤ diam M ( G ) = k − ℓ and therefore rad M ( G ) = ⌊ diam M ( G )+12 ⌋ = ℓ . Hence, there is a vertex c in G suchthat d G ( c, v ) = d G ( c, x ′ ) = d G ( c, y ′ ) = ℓ . Since d G ( c, x ) = d G ( c, y ) = ℓ + 1, by induction, there must exist acommon neighbor u of x and y such that d G ( c, u ) = ℓ . Necessarily, d G ( u, v ) = 2 ℓ = k − k = 3. Let M = I G ( x, v ) ∪ I G ( y, v ). We have 3 ≤ diam M ( G ) ≤ rad M ( G ) = 2. The latter implies existence of a vertex c in G such that d G ( c, w ) ≤ w ∈ M . Consider a neighbor v x of v on a shortest path from v to x and a neighbor v y of v on a shortestpath from v to y . Since d G ( c, v x ) ≤ d G ( c, x ) ≤ d G ( x, v x ) = 2, the three unit balls centered atvertices x, c, v x pairwise intersect. By the Helly property for unit balls, there must exist a vertex x ′ in G which is adjacent to x and v x and at distance at most 1 from c . By symmetry, there exists also a vertex y ′ in G which is adjacent to y and v y and at distance at most 1 from c . Since d G ( v, x ′ ) = d G ( v, y ′ ) = 2 and d G ( x ′ , y ′ ) ≤ d G ( c, x ′ ) + d G ( c, y ′ ) ≤
2, by induction, there is a vertex v ′ in G adjacent to all x ′ , y ′ , v . Applyingagain the induction hypothesis to v ′ , x, y , we get a vertex u in G which is adjacent to all v ′ , x, y and henceat distance 2 from v . This concludes the proof. ⊓⊔ The equivalence between (1) and (5) can be rephrased as follows.
Corollary 1.
For every graph G = ( V, E ) , the family of all balls { N rG [ v ] : v ∈ V, r ∈ N } of G has the Hellyproperty if and only if the family of k -neighborhoods { N kG [ v ] : v ∈ V } of G has the Helly property for everynatural number k . That is, the Helly property for balls of equal radii implies the Helly property for balls with variable radii.It would be interesting to know whether a similar result holds for all (discrete) metric spaces. We are notaware of such a general result and did not find its analog in the literature.
Proof.
It is sufficient to prove that if the family of k -neighborhoods { N kG [ v ] : v ∈ V } of G has the Hellyproperty for every natural number k , then G satisfies the condition (5) of Theorem 1.Consider an arbitrary set M ⊆ V . Denote k := ⌊ diam M ( G )+12 ⌋ . Since d G ( x, y ) ≤ diam M ( G ) for every pair x, y of vertices from M , the family of k -neighborhoods { N kG [ v ] : v ∈ M } of G consists of pairwise intersectingsets. By the Helly property, there is a vertex c ∈ V which belongs to all those k -neighborhoods. Necessarily, d G ( c, v ) ≤ k holds for every v ∈ M . Hence, rad M ( G ) ≤ k = ⌊ diam M ( G )+12 ⌋ . As diam M ( G ) ≤ rad M ( G ), weget rad M ( G ) = ⌊ diam M ( G )+12 ⌋ . ⊓⊔ We will also need the following lemma from [28].
Lemma 1. [28] For every Helly graph G = ( V, E ) and every set M ⊆ V , the graph induced by the center C M ( G ) is Helly and it is an isometric (and hence connected) subgraph of G . Given this lemma, it will be convenient to denote by C M ( G ) not only the set of central vertices but also thesubgraph of G induced by this set. Then, diam ( C M ( G )) denotes the diameter of this graph ( diam ( C M ( G )) = diam C M ( G ) ( G ) by this isometricity).Let δ ( G ) be the smallest half-integer δ ≥ G is δ -hyperbolic. Let γ ( G ) be the largest integer γ ≥ G has a ( γ × γ ) rectilinear grid as an isometric subgraph. Let β ( G ) be the smallest integer β ≥ G are β -pseudoconvex. Finally, let κ ( G ) be the smallest integer κ ≥ diam ( C M ( G )) ≤ κ for every set M ⊆ V . 5 heorem 2. For every Helly graph G , a constant bound on one parameter from { δ ( G ) , γ ( G ) , β ( G ) , κ ( G ) } implies a constant bound on all others.Proof. Let δ := δ ( G ) , γ := γ ( G ) , β := β ( G ) , κ := κ ( G ). We will show that the following inequalities are trueusing a few claims: κ ≤ min { δ + 1 , γ + 3 , max { , β + 1 }} ,β ≤ min { max { , δ − } , γ + 1 , κ + 1 } ,γ ≤ min { δ, β, κ/ } ,δ ≤ min { γ, β, κ/ } + 1 . Claim 1 If G is δ -hyperbolic Helly, then diam ( C M ( G )) ≤ δ + 1 and rad ( C M ( G )) ≤ δ + 1 for every set M ⊆ V . In particular, κ ≤ δ + 1 . Let M be an arbitrary subset of V . Let also d G ( x, y ) = diam M ( G ) for x, y ∈ M and let d G ( u, v ) = diam ( C M ( G )) for u, v ∈ C M ( G ). As G is Helly, d G ( x, y ) ≥ rad M ( G ) −
1. We consider the followingdistance sums: d G ( x, y ) + d G ( u, v ) ≥ rad M ( G ) − diam ( C M ( G )), d G ( x, u ) + d G ( v, y ) ≤ rad M ( G ),and d G ( x, v ) + d G ( y, u ) ≤ rad M ( G ). If d G ( x, y ) + d G ( u, v ) is not the largest of the three sums, then diam ( C M ( G )) ≤
1. Otherwise, by the four point condition, diam ( C M ( G )) ≤ δ + 1. Consider the pairwiseintersecting balls N rad M ( G ) G [ v ] for all v ∈ M and N δ +1 G [ u ] for all u ∈ C M ( G ). By the Helly property, there isa vertex c ∈ C M ( G ) such that N δ +1 G [ c ] ⊇ C M ( G ). As C M ( G ) is isometric for any Helly graph (see Lemma1), the diameter and radius of C M ( G ) are realized by paths fully contained in C M ( G ). Claim 2 If G is δ -hyperbolic, then any ball of G is (2 δ − -pseudoconvex, when δ > , and is convex, when ≤ δ ≤ / . In particular, β ≤ max { , δ − } . Consider a ball N rG [ v ] centered at a vertex v ∈ V and with radius r . Let x, y ∈ N rG [ v ] and let u ∈ I G ( x, y ) be avertex which is not contained in N rG [ v ]. By contradiction, assume that d G ( u, x ) ≥ δ and d G ( u, y ) ≥ δ . Since u / ∈ N rG [ v ], d G ( u, v ) > r . Consider the following distance sums: d G ( x, y ) + d G ( u, v ) = d G ( x, u ) + d G ( u, y ) + d G ( u, v ) > d G ( x, u ) + d G ( u, y ) + r , d G ( x, u ) + d G ( v, y ) ≤ d G ( x, u ) + r , and d G ( x, v ) + d G ( y, u ) ≤ r + d G ( y, u ).Clearly, d G ( x, y ) + d G ( u, v ) is the largest sum. Without loss of generality, assume that d G ( x, u ) + d G ( v, y )is the second largest sum. By the four point condition, 2 δ ≥ d G ( x, y ) + d G ( u, v ) − d G ( x, u ) − d G ( v, y ) = d G ( u, y ) + d G ( u, v ) − d G ( v, y ) > δ + r − r = 2 δ , which is not possible. Claim 3 If G is a Helly graph whose all balls are β -pseudoconvex, then for every set M ⊆ V , diam ( C M ( G )) ≤ , when β = 0 , and diam ( C M ( G )) ≤ β +1 , when β > . In particular, κ ≤ max { , β +1 } . Let M be an arbitrary subset of V . Let also d G ( x, y ) = diam M ( G ) for x, y ∈ M and let d G ( u, v ) = diam ( C M ( G )) for u, v ∈ C M ( G ). It is known from [28] that if balls in a Helly graph G are convex (i.e., β = 0) then diam ( C M ( G )) ≤
3. Let now β ≥ d G ( u, v ) ≥ β + 2. As G is Helly, d G ( x, y ) ≥ rad M ( G ) −
1. Set r := rad M ( G ). Note that, since we always have diam ( C M ( G )) ≤ r and we further assume diam ( C M ( G )) ≥ β + 2, r ≥
2. In particular, 2 r − ≥ r + 1.Consider the following four balls: N r +1 G [ y ], N d G ( x,y ) − r − G [ x ], N β +1 G [ u ] and N d G ( u,v ) − β − G [ v ]. We show that theypairwise intersect. Clearly, N r +1 G [ y ] ∩ N d G ( x,y ) − r − G [ x ] = ∅ and N β +1 G [ u ] ∩ N d G ( u,v ) − β − G [ v ] = ∅ . Furthermore,since d G ( u, x ), d G ( u, y ), d G ( v, x ) and d G ( v, y ) are at most r , the ball N r +1 G [ y ] intersects both N β +1 G [ u ] and N d G ( u,v ) − β − G [ v ]. As ( d G ( x, y ) − r −
1) + ( β + 1) ≥ r − − r − β + 1 = r + β − ≥ r ≥ d G ( u, x ), theballs N d G ( x,y ) − r − G [ x ] and N β +1 G [ u ] also intersect. Similarly, the balls N d G ( x,y ) − r − G [ x ] and N d G ( u,v ) − β − G [ v ]must intersect as d G ( u, v ) − β − ≥ β + 1. As all four balls pairwise intersect, by the Helly property, theremust exist a vertex c in G such that d G ( u, v ) = d G ( u, c ) + d G ( c, v ) (i.e., c ∈ I G ( u, v )) and d G ( y, c ) = r + 1, d G ( x, c ) = d G ( x, y ) − r −
1. The latter contradicts with the β -pseudoconvexity of the ball N rG [ y ] as u, v belongto that ball and c ∈ I G ( u, v ) with min { d G ( c, u ) , d G ( c, v ) } ≥ β + 1 is not in N rG [ y ]. Claim 4
For every graph, γ ≤ min { δ, β, κ/ } . γ × γ ) rectilinear grid in G and let a, b, c, d be the corner vertices of that grid listedin counterclockwise order. The hyperbolicity of G is at least the hyperbolicity of the quadruple a, b, c, d which is exactly ( d G ( a, c ) + d G ( b, d )) − ( d G ( a, b ) + d G ( c, d )) = ((2 γ + 2 γ ) − ( γ + γ )) = γ . Hence, γ ≤ δ .For the ball N γG [ a ], we get: b, d ∈ N γG [ a ], c / ∈ N γG [ a ], and c is on a shortest path between b and d with d G ( c, b ) = d G ( c, d ) = γ . Hence, γ ≤ β . Let now M = { a, c } . Then, diam M ( G ) = 2 γ and rad M ( G ) = γ andboth b and d are in C M ( G ). As d G ( b, d ) = 2 γ , diam ( C M ( G )) ≥ γ , giving κ ≥ diam ( C M ( G )) ≥ γ . Claim 5
For every Helly graph, δ ≤ γ + 1 . This claim follows from a result in [34]. Let the hyperbolicity of G be δ . According to [34, Lemma 8], if δ is an integer, then G has an isometric subgraph (named H δ in [34]), which contains an isometric ( δ × δ )rectilinear grid, or an isometric subgraph (named H δ − in [34]), which contains an isometric (( δ − × ( δ − δ is a half-integer, then G has an isometric subgraph (named H δ − in [34]),which contains an isometric (( δ − ) × ( δ − )) rectilinear grid. Thus, in both cases (whether δ is a half-integeror an integer), γ ≥ δ − Claim 6
For every Helly graph, δ ≤ min { β, κ/ } + 1 , β ≤ min { κ, γ } + 1 , κ ≤ γ + 3 . These remaining inequalities follow from the previous claims. We have δ ≤ γ + 1 ≤ β + 1 ,δ ≤ γ + 1 ≤ κ/ ,β ≤ max { , δ − } ≤ max { , κ + 1 } = κ + 1 ,β ≤ max { , δ − } ≤ γ + 1 ,κ ≤ δ + 1 ≤ γ + 3 . This concludes the proof of the theorem. ⊓⊔ The following corollaries of Theorem 2 will play an important role in efficient computations of all eccen-tricities of a Helly graph. Corollary 2 gives a sublinear bound on the hyperbolicity of a Helly graph. Corollary3 gives a sublinear bound on the diameter of the center of a Helly graph.
Corollary 2.
The hyperbolicity of an n -vertex Helly graph G is at most √ n + 1 .Proof. If G is δ -hyperbolic then, by Claim 5, G contains an isometric rectilinear grid of side-length ≥ δ − δ − ≤ n . ⊓⊔ Corollary 3.
For any n -vertex Helly graph G , we have diam ( C ( G )) ≤ √ n + 3 .Proof. We apply Corollary 2 and Claim 1 (with M = V ). Thus, for a δ -hyperbolic Helly graph G , diam ( C ( G )) ≤ δ + 1 ≤ √ n + 3. ⊓⊔ It is known that the radius (see [49]) and a central vertex (see [45]) of an n -vertex m -edge Helly graph canbe computed in ˜ O ( m √ n )-time with high probability. In this section, we improve those results by presentinga deterministic O ( m √ n ) time algorithm which computes not only the radius and a central vertex but alsoall vertex eccentricities in a Helly graph.To show this more general result, we heavily make use of our new structural results from Section 2. Inparticular, the fact that both the hyperbolicity of a Helly graph G and the diameter of its center C ( G ) areupper bounded by O ( √ n ) will be very handy. The following results from [49], [45] and [21,36,37] will be alsovery useful. 7 emma 2. [49] Let G be an m -edge Helly graph and k be a natural number. One can compute the set of allvertices of G of eccentricity at most k , and their respective eccentricities, in O ( km ) time. Lemma 3. [45] Let G be an m -edge Helly graph and v be an arbitrary vertex. There is an O ( m ) -timealgorithm which either certifies that v is a central vertex of G or finds a neighbor u of v such that e ( u ) < e ( v ) . Lemma 4. [21,36,37] Let G be an arbitrary m -edge graph and δ be its hyperbolicity. There is an O ( δm ) -timealgorithm which finds in G a vertex c with eccentricity at most rad ( G ) + 2 δ . The algorithm does not need toknow the value of δ in order to work correctly. First, by combining Lemmas 3 and 4, we show that a central vertex of a Helly graph G can be computedin O ( δm ) time, where δ is the hyperbolicity of G . Lemma 5. If G is an m -edge Helly graph, then one can compute a central vertex and the radius of G in O ( δm ) time, where δ is the hyperbolicity of G .Proof. We use Lemma 4 in order to find, in O ( δm ) time, a vertex c of G with eccentricity e ( c ) ≤ rad ( G )+ 2 δ .Then we apply Lemma 3 at most 2 δ times in order to descend from c to a central vertex c ∗ . It takes O ( δm )time. ⊓⊔ Combining this with Corollary 2, we get.
Corollary 4.
For any n -vertex m -edge Helly graph G , a central vertex and the radius of G can be computedin O ( m √ n ) time. We are now ready to prove our main result of this section.
Theorem 3.
All vertex eccentricities in an n -vertex m -edge Helly graph G can be computed in total O ( m √ n ) time.Proof. Our goal is to compute e ( v ) for every v ∈ V . For that, we first find a central vertex c and computethe radius rad ( G ) of G , which takes O ( m √ n ) time by Corollary 4. If rad ( G ) ≤ √ n + 6 (the choice of thisnumber will be clear later), then diam ( G ) ≤ rad ( G ) ≤ √ n + 12 and we are done by Lemma 2 (appliedfor k = 10 √ n + 12); it takes in this case total time O ( m √ n ) to compute all eccentricities in G . Thus, fromnow on, we assume rad ( G ) > √ n + 6. By Theorem 1(3), for every v ∈ V , e ( v ) = d ( v, C ( G )) + rad ( G )holds. Thus, in order to compute all the eccentricities, it is sufficient to compute C ( G ). For a central vertex c ∈ C ( G ) found earlier, let S = N √ n +3 G [ c ]. Note that, by Corollary 3, C ( G ) ⊆ S .In what follows, let r = rad ( G ). Consider the BFS layers L i ( S ) = { v ∈ V : d ( v, S ) = i } . Note that if i ≤ r − √ n − ≤ r − diam S ( G ), then all the vertices of L i ( S ) are at distance at most r from all the verticesin S . As a result, in order to compute C ( G ) ∩ S (= C ( G )), it is sufficient to consider the layers L i ( S ), for i > r − √ n − A = S i>r − √ n − L i ( S ). Since for every v / ∈ S , d ( v, c ) = d ( v, S ) + 2 √ n + 3 ≤ r , we deduce that thereare at most ( r − √ n − − ( r − √ n −
6) = 2 √ n + 3 nonempty layers in A .We will need to consider the “critical band” of all the layers L i ( S ), for 1 ≤ i ≤ r − √ n − S and A ). We claim that there are at least √ n layers in this band. Indeed, under the aboveassumption, r > √ n + 6. Then, the number of layers is exactly e ( c ) − √ n − > √ n + 3, minus at most2 √ n + 3 layers most distant from c (layers in A ). Overall, there are at least √ n layers in the critical band,as claimed.Then, one layer in the critical band, call it L , contains at most n/ √ n = √ n vertices. Claim 7
For every a ∈ A , there exists a “distant gate” a ∗ ∈ P r ( a, L ) with the following property: N r [ a ] ∩ S = N r − d ( a,L ) [ a ∗ ] ∩ S .
8n order to prove the claim, set p = d ( a, L ) and q = d ( a, c ) ≤ r . Let us consider a family of balls F = { N p [ a ] , N q − p [ c ] } ∪ { N r − p [ s ] : s ∈ N r [ a ] ∩ ( S \ c ) } . We stress that N p [ a ] ∩ N q − p [ c ] = P r ( a, L ). Then,in order to prove the existence of a distant gate, it suffices to prove that the balls in F intersect; indeed, ifit is the case then we may choose for a ∗ any vertex in the common intersection of the balls in F . Clearly, N p [ a ] ∩ N q − p [ c ] = ∅ and, in the same way, N p [ a ] ∩ N r − p [ s ] = ∅ for each s ∈ N r [ a ] ∩ ( S \ c ). Furthermore,since L is in the critical band, d ( c, L ) > √ n + 3, and therefore we have for each s, s ′ ∈ S :2( r − p ) ≥ q − p ) = 2 d ( c, L ) > diam S ( G ) ≥ d ( s, s ′ ) . In the same way ( q − p ) + ( r − p ) ≥ q − p ) > diam S ( G ) ≥ d ( s, c ). The latter proves that the balls in F intersect. This concludes the proof of Claim 7.We finally explain how to compute these distant gates, and how to use this information in order tocompute S ∩ C ( G ). Specifically: – We make a BFS from every u ∈ L . it takes O ( m | L | ) = O ( m √ n ) time. Doing so, we can compute ∀ a ∈ A, P r ( a, L ), in total O ( | A || L | ) = O ( n √ n ) time. – Since A contains at most O ( √ n ) nonempty layers, then the number of pairwise distinct distances d ( a, L ),for a ∈ A , is also in O ( √ n ). Call the set of all these distances I A . Then, ∀ u ∈ L , and ∀ i ∈ I A , we alsocompute p ( u, i ) = | N r − iG [ u ] ∩ S | . For that, we consider the vertices u ∈ L sequentially. Recall that wecomputed a BFS tree rooted at u . In particular, we can order the vertices of S by increasing distanceto u . It takes O ( n ) time. Similarly, we can order I A in O ( √ n log n ) = o ( n ) time. In order to computeall the values p ( u, i ), it suffices to scan in parallel these two ordered lists. The running time is O ( n ) forevery fixed u ∈ L , and so the total running time is O ( n | L | ) = O ( n √ n ). – Now, in order to compute a distant gate a ∗ , for a ∈ A , we proceed as follows. Let i = d ( a, L ). We scan P r ( a, L ) and we store a vertex a ∗ maximizing p ( a ∗ , i ). It takes O ( | A || L | ) = O ( n √ n ) time. On the way, ∀ u ∈ L , let q ( u ) be the maximum i such that a ∗ ≡ u is the distant gate of some vertex a ∈ A , such that d ( a, L ) = i (possibly, q ( u ) = 0 if u was not chosen as the distant gate of any vertex). – Let s ∈ S be arbitrary. For having s ∈ S ∩ C ( G ), it is necessary and sufficient to have s ∈ N r [ a ] ∩ S, ∀ a ∈ A .Equivalently, ∀ u ∈ L , one must have d ( s, u ) ≤ r − q ( u ). This can be checked in time O ( | L | ) per vertexin S , and so, in total O ( n √ n ) time. ⊓⊔ In the previous section we showed that a central vertex of a Helly graph G can be computed in O ( δm ) time,where δ is the hyperbolicity of G . This nice result, combined with the property that all Helly graphs havehyperbolicity O ( √ n ) (Corollary 2), was key to the design of our O ( m √ n )-time algorithm for computing allvertex eccentricities. Next, we deepen the connection between hyperbolicity and fast eccentricity computationwithin Helly graphs.As we have mentioned earlier, many graph classes (e.g., interval graphs, chordal graphs, dually chordalgraphs, AT-free graphs, weakly chordal graphs and many others) have constant hyperbolicity. In particular,the dually chordal graphs and the C -free Helly graphs (superclasses to the interval graphs and to the stronglychordal graphs) are proper subclasses of the 1-hyperbolic Helly graphs. This raises the question whether allvertex eccentricities can be computed in linear time in a Helly graph G if its hyperbolicity δ is a constant.We prove in what follows that it is indeed the case, which is the main result of this section. The followingresult could also be considered as a parameterized algorithm on Helly graphs with δ as the parameter. Theorem 4. If G is an m -edge Helly graph of hyperbolicity δ , then the eccentricity of all vertices of G canbe computed in O ( δ m log δ ) time. The algorithm does not need to know the value of δ in order to workcorrectly. If δ (or a constant approximation of it) is known, then the running time is O ( δ m ) .
9s a byproduct, we get a linear time algorithm for computing all vertex eccentricities in C -free Hellygraphs as well as in dually chordal graphs, generalizing known results from [11,31,49]. We recall that fordually chordal graphs, until this paper it was only known that a central vertex of such a graph can be foundin linear time [11,31].The remainder of this section is devoted to proving Theorem 4. For that, the following result is provedin Subsection 4.1: Lemma 6.
Let G be an m -edge Helly graph, c be a central vertex of G and k be a natural number. There isan O ( k m ) -time algorithm which computes C ( G ) ∩ N k [ c ] .Proof (Proof of Theorem 4 assuming Lemma 6.). Since, by Theorem 1(3), e ( v ) = d ( v, C ( G )) + rad ( G ) holdsfor every v ∈ V , as before, in order to compute all the eccentricities, it is sufficient to compute C ( G ). Wefirst find a central vertex c and compute the radius rad ( G ) of G . This takes O ( δm ) time by Lemma 5.By Claim 1, we know that diam ( C ( G )) ≤ δ + 1. Therefore, C ( G ) ⊆ N δ +1 [ c ]. – If δ is kown to us, we will fix k := 2 δ + 1 (if only a constant approximation δ ′ ≥ δ of δ is known, we set k = 2 δ ′ + 1). Then, we are done applying Lemma 6. – Otherwise, we work sequentially with k = 2 , , , , , , . . . , p , p + 1 , p +1 , p +1 + 1,. . . , and we stopafter finding the smallest integer (power of 2) k such that C ( G ) ∩ N k [ c ] = C ( G ) ∩ N k +1 [ c ]. Indeed, by theisometricity (and hence connectedness) of C ( G ) in G (see Lemma 1), the set C ( G ) ∩ N k [ c ] will containall central vertices of G , i.e., C ( G ) ∩ N k [ c ] = C ( G ). The latter will happen for some k < δ + 1) afterat most O (log δ ) probes.Overall, since we need to apply Lemma 6 at most O (log δ ) times, for some values k < δ + 1), the totalrunning time is O ( δ m log δ ). If δ (or a constant approximation of it is known), then we call Lemma 6 onlyonce, and therefore the running time goes down to O ( δ m ). ⊓⊔ In what follows, G is a Helly graph, k is an integer and r = rad ( G ). Let S k = N k [ c ]. If r ≤ k , we cancompute all central vertices in O ( km ) time (see Lemma 2). Thus from now on, r > k . As diam S k ( G ) ≤ k ,to find all central vertices in S k (i.e., the set C ( G ) ∩ S k ), we will need to consider only the vertices at distance > r − k from S k .Let i < k be fixed (we need to consider all possible i between k and 2 k − A k,i = L r − i ( S k ) (where we recall that L r − i ( S k ) = { v ∈ V : d ( v, S k ) = r − i } ). We want to compute S k,i := { s ∈ S k : A k,i ⊆ N r [ s ] } . Indeed, C ( G ) ∩ S k = T k − i = k S k,i .The computation of S k,i (for k, i fixed) works by phases. We describe below the two main phases of theprocess.First phase of the algorithm. To give the intuition of our approach, we will need the following simple claim.For a vertex v ∈ V and an integer j , let L ( v, j, S k ) := { u ∈ V : d ( v, S k ) = d ( v, u ) + d ( u, S k ) and d ( v, u ) = j } . Claim 8
Let B ⊆ A k,i be such that T { L ( b, j, S k ) : b ∈ B } 6 = ∅ , for some ≤ j < r − i . Then, for every s ∈ S k , max b ∈ B d ( s, b ) ≤ r if and only if d ( s, T { L ( b, j, S k ) : b ∈ B } ) ≤ r − j .Proof. If d ( s, T { L ( b, j, S k ) : b ∈ B } ) ≤ r − j , then clearly max b ∈ B d ( s, b ) ≤ r . Conversely, let us assumemax b ∈ B d ( s, b ) ≤ r . Set F = { N r − jG [ s ] , N r + k − ( i + j ) G [ c ] } ∪ { N jG [ b ] : b ∈ B } . We prove that the balls in F intersect. 10 For each b, b ′ ∈ B , N jG [ b ] ∩ N jG [ b ′ ] ⊇ T { L ( b, j, S k ) : b ∈ B } 6 = ∅ . – Since we assume max b ∈ B d ( s, b ) ≤ r , N jG [ b ] ∩ N r − jG [ s ] = ∅ . – Furthermore, as for each b ∈ B we have d ( b, c ) = d ( b, S k )+ k = r − i + k , we obtain N r − i + k − jG [ c ] ∩ N jG [ b ] = L ( b, j, S k ) = ∅ . – Finally, since we have j < r − i , ( r − i + k − j ) + ( r − j ) > k + i ≥ k ≥ d ( s, c ). Therefore, N r + k − ( i + j ) G [ c ] ∩ N r − jG [ s ] = ∅ .It follows from the above that the balls in F pairwise intersect. By the Helly property, there exists a vertex y in the common intersection of all the balls in F . As for each b ∈ B , y ∈ N r − i + k − jG [ c ] ∩ N jG [ b ] = L ( b, j, S k ),we deduce that y ∈ T { L ( b, j, S k ) : b ∈ B } . Finally, we have d ( s, T { L ( b, j, S k ) : b ∈ B } ) ≤ d ( s, y ) ≤ r − j . ⊓⊔ We are now ready to present the first phase of our algorithm (for k, i fixed). It is divided into r − i steps:from j = 0 to j = r − i −
1. At step j , for 0 ≤ j < r − i , the intermediate output is a collection of disjointsubsets V j , V j , ..., V p j j of the layer L r − i − j ( S k ). These disjoint subsets are in one-to-one correspondence withsome partition B , B , ..., B p j of A k,i . Specifically, the algorithm ensures that: ∀ ≤ t ≤ p j , V tj = \ { L ( b, j, S k ) : b ∈ B t } 6 = ∅ . Doing so, by the above Claim 8, for any s ∈ S k we havemax z ∈ A k,i d ( s, z ) ≤ r ⇐⇒ max ≤ t ≤ p j d ( s, V tj ) ≤ r − j. Initially, for j = 0, every set B t is a singleton. Furthermore, B t = V t . Then, we show how to partition L r − i − ( j +1) ( S k ) from V j , V j , ..., V p j j in total O ( P x ∈ L r − i − j ( S k ) | N G ( x ) | ) time. Note that in doing so we get atotal running time in O ( m ) for that phase.For that, let us define W tj = N ( V tj ) ∩ L r − i − ( j +1) ( S r ). Since the subsets V tj are pairwise disjoint, theconstruction of the W tj ’s takes total O ( P x ∈ L r − i − j ( S k ) | N G ( x ) | ) time. Furthermore: Claim 9 W tj = T { L ( b, j + 1 , S k ) : b ∈ B t } .Proof. We only need to prove that we have T { L ( b, j + 1 , S k ) : b ∈ B t } ⊆ W tj (the other inclusion beingtrivial by construction). For that, let x ∈ T { L ( b, j + 1 , S k ) : b ∈ B t } be arbitrary. Recall that we have, foreach b ∈ B t , d ( b, c ) = k + d ( b, S k ) = r − i + k . In particular, x ∈ L ( b, j + 1 , S k ) = L ( b, j + 1 , c ). It impliesthat the balls in { N G [ x ], N r − i + k − jG [ c ] } ∪ { N jG [ b ] : b ∈ B t } pairwise intersect. By the Helly property, x has aneighbour in N r − i + k − jG [ c ] ∩ (cid:0)T { N j [ b ] : b ∈ B t } (cid:1) = T { L ( b, j, S k ) : b ∈ B t } = V tj . Since x ∈ L r − i − ( j +1) ( S k ),we obtain as desired x ∈ W tj . ⊓⊔ Finally, in order to compute the new sets V t ′ j +1 , we proceed as follows. Let W = { W tj : 1 ≤ t ≤ p j } .While W 6 = ∅ , we select some vertex x ∈ L r − i − ( j +1) ( S k ) maximizing { t : x ∈ W tj } . Then, we create a newset T t : x ∈ W tj W tj , and we remove { W tj : x ∈ W tj } from W . Note that, by the above Claim 9, T t : x ∈ W tj W tj = T t : x ∈ W tj T { L ( b, j + 1 , S k ) : b ∈ B t } = T { L ( b, j + 1 , S k ) : b ∈ S t : x ∈ W tj B t } . Furthermore, by maximality ofvertex x , T t : x ∈ W tj W tj is disjoint from the subsets in { W tj : x / ∈ W tj } . The latter ensures that all the new setswe create are pairwise disjoint.In order to implement this above process efficiently, we store each x ∈ L r − i − ( j +1) ( S k ) in a list indexed by { t : x ∈ W tj } . Then, we traverse these lists by decreasing index. We keep, for each x ∈ L r − i − ( j +1) ( S k ), apointer to its current position in order to dynamically change its list throughout the process. See also the proofof Lemma 2 in [49]. The running time is proportional to P {| W tj | : 1 ≤ t ≤ p j } = O ( P x ∈ L r − i − j ( S k ) | N G ( x ) | ).Second phase of the algorithm. Let C , C , ..., C p denote the sets V r − i − , ..., V p r − i − r − i − (i.e., those obtained atthe end of the first phase of our algorithm). Note that C , C , ..., C p are subsets of L ( S k ) (= N G ( S k )). Atthis point, it is not possible anymore to follow the shortest-paths between A k,i and S k .11hen, let X = A k,i ∪ { c } . Set α ( c ) = k + i + 2 and α ( a ) = r for each a ∈ A k,i . We define the set Y = { y : ∀ x ∈ X, d ( y, x ) ≤ α ( x ) } . Observe that S k,i = Y ∩ S k (recall that S k,i was defined as { s ∈ S k : A k,i ⊆ N r [ s ] } ).Therefore, in order to compute S k,i , it suffices to compute Y .For that, we proceed in i + 2 steps. At step ℓ , for 0 ≤ ℓ ≤ i + 1, we maintain a family ofnonempty pairwise disjoint sets Z ℓ , Z ℓ , ..., Z q ℓ ℓ and a covering X ℓ , X ℓ , . . . , X q ℓ ℓ of X such that the followingis true for every 1 ≤ t ≤ q ℓ : Z tℓ = \ x ∈ X tℓ N α ( x ) − ( i +1)+ ℓG [ x ] . Doing so, after i + 2 steps, the set Y is nonempty if and only if q i +1 = 1 (the above partition is reduced toone group). Furthermore, if it is the case, Y = Z i +1 .Initially, for ℓ = 0, we start from Z = C , ..., Z p = C p , and then the corresponding covering is ∀ ≤ t ≤ p , X t = B t ∪ { c } (with B , B , ..., B p being the partition of A k,i after the first phase of our algorithm). – Notethat this is only a covering, and not a partition, because the vertex c is contained in all the groups. – Forgoing from ℓ to ℓ + 1, we proceed as we did during the first phase. Specifically, for every t , let U tℓ = N G [ Z tℓ ].Since the sets Z tℓ are pairwise disjoint, the computation of all the intermediate sets U tℓ takes total O ( m )time. Claim 10 U tℓ = T x ∈ X tℓ N α ( x ) − ( i +1)+( ℓ +1) G [ x ] . The proof is similar to that of Claim 9.Finally, in order to compute the new sets Z t ′ ℓ +1 , let U = { U tℓ : 1 ≤ t ≤ q ℓ } . While U 6 = ∅ , we select somevertex u ∈ V maximizing { t : u ∈ U tℓ } . Then, we create a new set T t : u ∈ U tℓ U tℓ , and we remove { U tℓ : u ∈ U tℓ } from U . The running time is proportional to P {| U tℓ | : 1 ≤ t ≤ q ℓ } = O ( m ).Complexity analysis. Overall, the first phase runs in O ( m ) time, and the second phase runs in O ( im ) = O ( km ) time. Since it applies for k, i fixed, the total running time of the algorithm of Lemma 6 (for k fixed)is in O ( k m ).This completes the proof of Lemma 6. References
1. A. Abboud, V. Vassilevska Williams, and J. Wang. Approximation and fixed parameter subquadratic algorithmsfor radius and diameter in sparse graphs. In
SODA , pages 377–391. SIAM, 2016.2. M. Abu-Ata and F. F. Dragan. Metric tree-like structures in real-world networks: an empirical study.
Networks ,67(1):49–68, 2016.3. A. B. Adcock, B. D. Sullivan, and M. W. Mahoney. Tree-like structure in large social and information networks.In , pages 1–10. IEEE, 2013.4. H.-J. Bandelt and V. Chepoi. 1-hyperbolic graphs.
SIAM J. Discret. Math. , 16(2):323–334, 2003.5. H.-J. Bandelt and V. Chepoi. Metric graph theory and geometry: a survey.
Contemporary Mathematics , 453:49–86, 2008.6. H.-J. Bandelt and E. Pesch. Dismantling absolute retracts of reflexive graphs.
European Journal of Combinatorics ,10(3):211–220, 1989.7. H.-J. Bandelt and E. Pesch. A Radon theorem for Helly graphs.
Archiv der Mathematik , 52(1):95–98, 1989.8. H.-J. Bandelt and E. Prisner. Clique graphs and Helly graphs.
Journal of Combinatorial Theory, Series B ,51(1):34–45, 1991.9. M. Borassi, D. Coudert, P. Crescenzi, and A. Marino. On computing the hyperbolicity of real-world graphs. In
Algorithms-ESA 2015 , pages 215–226. Springer, 2015.10. M. Borassi, P. Crescenzi, and M. Habib. Into the square: On the complexity of some quadratic-time solvableproblems.
Electronic Notes in Theoretical Computer Science , 322:51–67, 2016.11. A. Brandst¨adt, V. Chepoi, and F. F. Dragan. The algorithmic use of hypertree structure and maximum neigh-bourhood orderings.
Discret. Appl. Math. , 82(1-3):43–77, 1998.12. A. Brandst¨adt, F. F. Dragan, V. Chepoi, and V. Voloshin. Dually chordal graphs.
SIAM Journal on DiscreteMathematics , 11(3):437–455, 1998.
3. K. Bringmann, T. Husfeldt, and M. Magnusson. Multivariate analysis of orthogonal range searching and graphdistances parameterized by treewidth. In
IPEC , 2018.14. G. Brinkmann, J. Koolen, and V. Moulton. On the hyperbolicity of chordal graphs.
Annals of Combinatorics ,5(1):61–69, 2001.15. S. Cabello. Subquadratic algorithms for the diameter and the sum of pairwise distances in planar graphs.
ACMTransactions on Algorithms , 15(2):21, 2018.16. J. Chalopin, V. Chepoi, F. F. Dragan, G. Ducoffe, A. Mohammed, and Y. Vax`es. Fast approximation and exactcomputation of negative curvature parameters of graphs. In , pages 22:1–22:15, 2018.17. J. Chalopin, V. Chepoi, A. Genevois, H. Hirai, and D. Osajda. Helly groups, 2020.18. M. Chastand, F. Laviolette, and N. Polat. On constructible graphs, infinite bridged graphs and weakly cop-wingraphs.
Discrete Mathematics , 224(1-3):61–78, 2000.19. V. Chepoi and F. F. Dragan. Disjoint sets problem. 1992.20. V. Chepoi and F. F. Dragan. A linear-time algorithm for finding a central vertex of a chordal graph. InJ. van Leeuwen, editor,
Algorithms - ESA ’94, Second Annual European Symposium, Utrecht, The Netherlands,September 26-28, 1994, Proceedings , volume 855 of
Lecture Notes in Computer Science , pages 159–170. Springer,1994.21. V. Chepoi, F. F. Dragan, B. Estellon, M. Habib, and Y. Vax`es. Diameters, centers, and approximating trees of δ -hyperbolic geodesic spaces and graphs. In M. Teillaud, editor, Proceedings of the 24th ACM Symposium onComputational Geometry, College Park, MD, USA, June 9-11, 2008 , pages 59–68. ACM, 2008.22. V. Chepoi, F. F. Dragan, and Y. Vax`es. Center and diameter problems in plane triangulations and quadrangu-lations. In
SODA , pages 346–355, 2002.23. V. Chepoi, F. F. F. Dragan, M. Habib, Y. Vax`es, and H. Alrasheed. Fast approximation of eccentricities anddistances in hyperbolic graphs.
Journal of Graph Algorithms and Applications , 23(2):393–433, 2019.24. D. Corneil, F. F. Dragan, M. Habib, and C. Paul. Diameter determination on restricted graph families.
DiscreteApplied Mathematics , 113(2-3):143–166, 2001.25. D. Coudert and G. Ducoffe. Recognition of c4-free and 1/2-hyperbolic graphs.
SIAM J. Discret. Math. ,28(3):1601–1617, 2014.26. D. Coudert, G. Ducoffe, and A. Popa. Fully polynomial FPT algorithms for some classes of bounded clique-widthgraphs.
ACM Transactions on Algorithms , 15(3), 2019.27. M. Dourado, F. Protti, and J. Szwarcfiter. Complexity aspects of the Helly property: Graphs and hypergraphs.
The Electronic Journal of Combinatorics , 1000:17–12, 2009.28. F. F. Dragan.
Centers of Graphs and the Helly Property (in Russian) . PhD thesis, Moldava State University,Chi¸sin˘au, 1989.29. F. F. Dragan. Conditions for coincidence of local and global minima for eccentricity function on graphs and theHelly property (in Russian).
Studies in Applied Mathematics and Information Science , pages 49–56, 1990.30. F. F. Dragan. Domination in quadrangle-free Helly graphs.
Cybernetics and Systems Analysis , 29(6):822–829,1993.31. F. F. Dragan. HT-graphs: centers, connected r-domination and Steiner trees.
Comput. Sci. J. of Moldova(Kishinev) , 1(2):64–83, 1993.32. F. F. Dragan. Dominating cliques in distance-hereditary graphs. In E. M. Schmidt and S. Skyum, editors,
Algorithm Theory - SWAT ’94, 4th Scandinavian Workshop on Algorithm Theory, Aarhus, Denmark, July 6-8,1994, Proceedings , volume 824 of
Lecture Notes in Computer Science , pages 370–381. Springer, 1994.33. F. F. Dragan and A. Brandst¨adt. r-dominating cliques in graphs with hypertree structure.
Discrete Mathematics ,162(1-3):93–108, 1996.34. F. F. Dragan and H. M. Guarnera. Obstructions to a small hyperbolicity in Helly graphs.
Discrete Mathematics ,342(2):326 – 338, 2019.35. F. F. Dragan and H. M. Guarnera. Eccentricity function in distance-hereditary graphs.
Theor. Comput. Sci. ,833:26–40, 2020.36. F. F. Dragan and H. M. Guarnera. Eccentricity terrain of δ -hyperbolic graphs. J. Comput. Syst. Sci. , 112:50–65,2020.37. F. F. Dragan, M. Habib, and L. Viennot. Revisiting radius, diameter, and all eccentricity computation in graphsthrough certificates.
CoRR , abs/1803.04660, 2018.38. F. F. Dragan and A. Mohammed. Slimness of graphs.
Discret. Math. Theor. Comput. Sci. , 21(3), 2019.39. F. F. Dragan and F. Nicolai. LexBFS-orderings of distance-hereditary graphs with application to the diametralpair problem.
Discret. Appl. Math. , 98(3):191–207, 2000.
0. F. F. Dragan, F. Nicolai, and A. Brandst¨adt. LexBFS-orderings and power of graphs. In F. d’Amore, P. G.Franciosa, and A. Marchetti-Spaccamela, editors,
Graph-Theoretic Concepts in Computer Science, 22nd Inter-national Workshop, WG ’96, Cadenabbia (Como), Italy, June 12-14, 1996, Proceedings , volume 1197 of
LectureNotes in Computer Science , pages 166–180. Springer, 1996.41. F. F. Dragan, K. Prisakaru, and V. Chepoi. The location problem on graphs and the Helly problem.
DiskretnayaMatematika , 4(4):67–73, 1992.42. A. Dress. Trees, tight extensions of metric spaces, and the cohomological dimension of certain groups: a note oncombinatorial properties of metric spaces.
Advances in Mathematics , 53(3):321–402, 1984.43. G. Ducoffe. A New Application of Orthogonal Range Searching for Computing Giant Graph Diameters. In
SOSA ,2019.44. G. Ducoffe. Around the diameter of AT-free graphs.
CoRR , abs/2010.15814, 2020.45. G. Ducoffe. Distance problems within Helly graphs and k-Helly graphs.
CoRR , abs/2011.00001, 2020.46. G. Ducoffe. Isometric embeddings in trees and their use in the diameter problem.
CoRR , abs/2010.15803, 2020.47. G. Ducoffe. Optimal diameter computation within bounded clique-width graphs.
CoRR , abs/2011.08448, 2020.48. G. Ducoffe. Beyond Helly graphs: the diameter problem on absolute retracts.
CoRR , abs/2101.03574, 2021.49. G. Ducoffe and F. F. Dragan. A story of diameter, radius, and (almost) Helly property.
Networks, to appear .50. G. Ducoffe, M. Habib, and L. Viennot. Fast diameter computation within split graphs. In
COCOA , pages155–167. Springer, 2019.51. G. Ducoffe, M. Habib, and L. Viennot. Diameter computation on H -minor free graphs and graphs of bounded(distance) VC-dimension. In SODA , pages 1905–1922. SIAM, 2020.52. D. Eppstein. Diameter and treewidth in minor-closed graph families.
Algorithmica , 27(3-4):275–291, 2000.53. A. Farley and A. Proskurowski. Computation of the center and diameter of outerplanar graphs.
Discrete AppliedMathematics , 2(3):185–191, 1980.54. H. Fournier, A. Ismail, and A. Vigneron. Computing the Gromov hyperbolicity of a discrete metric space.
Inf.Process. Lett. , 115(6-8):576–579, 2015.55. P. Gawrychowski, H. Kaplan, S. Mozes, M. Sharir, and O. Weimann. Voronoi diagrams on planar graphs, andcomputing the diameter in deterministic ˜ O ( n / ) time. In SODA , pages 495–514. SIAM, 2018.56. M. Gromov.
Hyperbolic Groups , pages 75–263. Springer, New York, NY, 1987.57. J. Isbell. Six theorems about injective metric spaces.
Commentarii Mathematici Helvetici , 39(1):65–76, 1964.58. W. S. Kennedy, I. Saniee, and O. Narayan. On the hyperbolicity of large-scale networks and its estimation. In , pages 3344–3351. IEEE, 2016.59. J. H. Koolen and V. Moulton. Hyperbolic bridged graphs.
Eur. J. Comb. , 23(6):683–699, 2002.60. D. Kosch¨utzki, K. A. Lehmann, L. Peeters, S. Richter, D. Tenfelde-Podehl, and O. Zlotowski. Centrality indices.In
Network Analysis , pages 16–61. Springer, 2005.61. M. Lin and J. Szwarcfiter. Faster recognition of clique-Helly and hereditary clique-Helly graphs.
InformationProcessing Letters , 103(1):40–43, 2007.62. O. Narayan and I. Saniee. Large-scale curvature of networks.
Physical Review E , 84(6):066108, 2011.63. S. Olariu. A simple linear-time algorithm for computing the center of an interval graph.
International Journalof Computer Mathematics , 34(3-4):121–128, 1990.64. N. Polat. Convexity and fixed-point properties in Helly graphs.
Discrete Mathematics , 229(1-3):197–211, 2001.65. N. Polat. On constructible graphs, locally Helly graphs, and convexity.
Journal of Graph Theory , 43(4):280–298,2003.66. L. Roditty and V. Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparsegraphs. In
STOC , pages 515–524. ACM, 2013.67. Y. Shavitt and T. Tankel. Hyperbolic embedding of internet graph for distance estimation and overlay construc-tion.
IEEE/ACM Transactions on Networking , 16(1):25–36, 2008.68. J. L. Szwarcfiter and C. F. Bornstein. Clique graphs of chordal and path graphs.
SIAM J. Discret. Math. ,7(2):331–336, 1994.69. R. Williams. A new algorithm for optimal 2-constraint satisfaction and its implications.
Theoretical ComputerScience , 348(2-3):357–365, 2005.70. Y. Wu and C. Zhang. Hyperbolicity and chordality of a graph.
Electr. J. Comb. , 18(1):Paper , 18(1):Paper