Abstract 1 Introduction 2 Preliminaries 3 Line Segments and String Graphs 4 Almost-Linear Time Const-Diameter Algorithm for 2D Unit Squares 5 Diameter-2 Lower Bound for 2D Triangles 6 Diameter-2 Lower Bound for Segments References

Charting the Landscape of Diameter Computation on Geometric Intersection Graphs in the Plane

Timothy M. Chan ORCID Siebel School of Computing and Data Science, University of Illinois Urbana-Champaign, IL, USA    Hsien-Chih Chang ORCID Department of Computer Science, Dartmouth College, Hanover, NH, USA    Jie Gao ORCID Department of Computer Science, Rutgers University, Piscataway, NJ, USA    Sándor Kisfaludi-Bak ORCID Department of Computer Science, Aalto University, Espoo, Finland    Hung Le ORCID Manning CICS, University of Massachusetts Amherst, MA, USA    Da Wei Zheng ORCID Institute of Science and Technology Austria, Klosterneuburg, Austria
Abstract

Computing the diameter of the intersection graphs of objects is a basic problem in computational geometry. Previous works showed that the complexity of computing the diameter mainly depends on the object types: for unit disks and squares in 2D, the problem is solvable in truly subquadratic time [9], while for other objects, including unit segments and equilateral triangles in 2D or unit balls and axis-parallel unit cubes in 3D, there is no truly subquadratic time algorithm under the Orthogonal Vector (OV) hypothesis [4].

We undertake a comprehensive study of computing the diameter of geometric intersection graphs for various types of objects. We discover many new irregularities, showing that the landscape is extremely nuanced: the source of hardness is a combination of the object type, the true diameter value, and how the objects intersect with each other. Our highlighted results for the 2D case include:

  1. 1.

    The diameter of non-degenerate, axis-aligned line segments can be computed in truly subquadratic time. Previous hardness result [4] for line segments applies only to degenerate instances. On the other hand, for the degenerate case, we show that a truly subquadratic time algorithm exists when the true diameter is constant.

  2. 2.

    An almost-linear-time algorithm for unit-square graphs of constant diameter. Previous algorithms [14, 9] rely on succinct representation assuming bounded VC-dimension; for such a strategy Ω(n7/4) time is an inherent barrier.

  3. 3.

    An O~(n4/3)-time algorithm to decide if the diameter of a unit-disk graph is at most 2. This improves upon the recent algorithm with running time O~(n21/9) [9].

  4. 4.

    Deciding if the diameter of intersection graphs of fat triangles or line segments is at most 2 is truly subquadratic-hard under fine-grained complexity assumptions. Previous lower bounds [4] only hold when deciding if diameter is at most 3.

Our findings are presented in a pair of papers. This paper focuses solely on the 2D case, while the companion paper is devoted to higher-dimensional cases.

Keywords and phrases:
String graphs, Fine-grained complexity
Category:
Track A: Algorithms, Complexity and Games
Funding:
Timothy M. Chan: Supported by NSF grant CCF-2224271.
Hsien-Chih Chang: Supported by NSF CAREER award CCF-2443017.
Jie Gao: Supported by NSF DMS-2220271, DMS-2311064, IIS-2229876, CCF-2118953, CNS-2515159.
Sándor Kisfaludi-Bak: Supported by the Research Council of Finland, Grant 363444.
Hung Le: Supported by an NSF grant CCF-2517033 and an NSF CAREER Award CCF-2237288.
Da Wei Zheng: This project has received funding from the Austrian Science Fund (FWF) grant DOI 10.55776/I5982. For open access purposes, the author has applied a CC BY public copyright license to any author-accepted manuscript version arising from this submission.
Copyright and License:
[Uncaptioned image] © Timothy M. Chan, Hsien-Chih Chang, Jie Gao, Sándor Kisfaludi-Bak, Hung Le,
and Da Wei Zheng; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Computational geometry
Related Version:
Full Version: https://arxiv.org/abs/2605.10692
Editors:
Sayan Bhattacharya, Danupon Nanongkai, Michael Benedikt, and Gabriele Puppis

1 Introduction

Computing the diameter of sparse graphs is truly subquadratic hard: under the Strong Exponential Time Hypothesis (SETH), there is no O(n2ε) algorithm for distinguishing diameter 2 vs. 3 of graphs with n vertices and O~(n)111O~() hides polylogarithmic factors. edges [20]. This conditional lower bound implies that the trivial algorithm for computing the diameter by doing BFS from every vertex is essentially optimal. Since then, the major research focus has been on substantially beating the BFS-based algorithm for structural families of graphs, especially planar/minor-free graphs and geometric intersection graphs. For planar/minor-free graphs, truly subquadratic algorithms were known [5, 16, 13, 18, 9].

For geometric intersection graphs, the complexity of diameter computation remains poorly understood due to the sheer diversity of geometric objects underlying the intersection graphs, for example, line segments, strings, (unit) disks, triangles, rectangles, balls, hypercubes, (axis-aligned) boxes, to name just a few. Another important subtlety is that intersection graphs can have Ω(n2) edges; therefore, a truly subquadratic time algorithm must use an implicit graph representation. (In a geometric intersection graph, each vertex corresponds to a geometric object, and there is an edge between every two intersecting objects.)

The pioneering work by Bringmann et al. [4] studied computing the diameter of intersection graphs of several types of objects: axis-parallel unit segments, equilateral triangles, axis-parallel hypercubes, and balls. They showed that it is truly subquadratic hard to solve: (i) Diameter-2 for axis-parallel hypercubes in 12 under the Hyperclique Hypothesis; (ii) Diameter-3 for (not necessarily axis-aligned) unit segments and equilateral triangles in 2 under Orthogonal Vector (OV) Hypothesis; and (iii) Diameter-Ω(logn) for unit balls and axis-parallel unit cubes in 3, and axis-parallel line segments in 2, all under OV Hypothesis. Here Diameter-Δ asks to decide if a given input graph has diameter at most Δ or at least Δ+1. Notably, basic objects such as axis-aligned squares, disks, and their unit versions were absent from this list of lower bounds. However, the same paper showed that Diameter-2 for axis-aligned unit squares can be solved in O(nlogn) time, which hinted at the possibility of truly subquadratic time for other diameter values and objects such as axis-aligned squares and (unit) disks. Later, Duraj, Konieczny, and Potępa [14] gave an algorithm with running time O~(Δn7/4) for Diameter-Δ of axis-aligned unit squares: it is truly subquadratic when the true diameter is O(n1/4ε). Chang, Gao, and Le [11] (arXiv version) designed a truly subquadratic +1-approximation algorithm for the diameter of axis-aligned unit squares, unit disks, and more generally, similar-sized fat pseudo-disks. Recently, Chan et al. [9] gave algorithms for computing the exact diameter of unit disks and arbitrary axis-aligned squares; the running time is truly subquadratic regardless of the diameter value.

Altogether, the previous work reveals highly contrasting pieces of the complexity landscape of geometric intersection graphs which depend on object types: either computing a very small diameter (e.g., Δ=2 or 3) is truly subquadratic hard for some objects, or the diameter can be computed in truly subquadratic time regardless of the value of the diameter for others.

We undertake a comprehensive study of computing the diameter of geometric intersection graphs for various types of objects. Our results are presented in two papers. The present paper focuses solely on the 2D case. All the previous truly subquadratic algorithms for diameter are for objects on the plane, and hence this basic case is of particular interest. We present numerous results, both positive and negative, on computing the diameter of the geometric intersection graphs of a wide variety of 2D objects. A high-level takeaway from our collection of results is that the complexity of computing the diameter depends not only on object type, but also on diameter range and how the objects intersect.

In the concurrent paper [8], we study objects in dimensions at least 3 and present various upper and lower bounds. Both papers together show that the landscape of computing the diameter on geometric intersection graphs is much more nuanced than previously known.

Table 1: Previous and new time bounds for deciding whether an intersection graph of geometric objects has diameter at most Δ. New results are highlighted in yellow. Conditional lower bounds marked “(OV)”, “(3H6)”, and “(combK4)” assume the Orthogonal Vectors hypothesis, the 3-uniform 6-hyperclique hypothesis, and the combinatorial 4-clique hypothesis respectively, where the latter is for combinatorial algorithms (all upper bounds are obtained from combinatorial algorithms). See Section 2 for definitions.
Graph class Lower bound Upper bound
Unit disks O(n21/18) for general Δ [9] O(n21/9) for Δ=O(1) [9]
O~(n4/3) for Δ=2 (full version)
Axis-aligned squares O(nlogn) for Δ=2 [4] O(n7/4) for Δ=O(1) [14] O~(n21/8) for general Δ [9]
unit squares O(n) for constant Δ (Thm. 18)
general O(n21/12) for general Δ [9]
Triangles in 2D cong. & equi. Ω(n2) for Δ=3 (OV) [4]
fat Ω(n2) for Δ=2 (3H6) (Thm. 22)
Line segments unit-length Ω(n2) for Δ=3 (OV) [4]
general Ω(n2) for Δ=2 (combK4) (Thm. 24)
axis-aligned w/ degeneracy Ω(n2) for general Δ (OV) [4] n21/O(2Δ) for any constant Δ (Thm. 14)
axis-aligned non-degenerate O~(n21/32) for general Δ (Thm. 10)
h-slopes w/wo degen. Ω(n2) for h=3 & general Δ (OV) (full version) n21/O(hΔ+1) for constant h & constant Δ (Thm. 14)
Strings O(1) bends Ω(n2) for Δ=2 (3H6) (Thm. 20)
O(logn) bends Ω(n2) for Δ=1 (OV) (full version)

1.1 Our Contributions

We focus on the intersection graphs of objects in 2D; see Table 1 for a complete catalog. Our first set of results concerns line segments. Previous results about line segments [4] are overwhelmingly negative: for unit line segments, Diameter-3 is (truly subquadratic) hard, and for axis-aligned unit segments, Diameter-Δ is also hard when Δ=Ω(logn). For axis-aligned unit segments, the lower bound construction requires that there is an overlap between horizontal segments; in other words, the instance is degenerate. Both the requirement Δ=Ω(logn) and the degeneracy seem like artifacts of the proof technique: better lower bounds seem achievable with a more refined technique. Surprisingly perhaps, we show that these “artifacts” are necessary by giving truly subquadratic-time algorithms otherwise. First, we provide a truly subquadratic algorithm for any diameter value on non-degenerate instances. Thus, degeneracy is a source of hardness for diameter computation. Second, we provide a truly subquadratic algorithm for Diameter-Δ for any constant Δ, even when the instances are degenerate. It implies that the diameter range is another source of hardness. Our second result holds even for a more general case of h-slope line segments, where the slope of each segment is one of h distinct values. (Axis-parallel line segments are 2-slope.) Finally, on the lower bound side, we strengthen the (truly subquadratic) lower bound for line segments by Bringmann et al. [4] from Diameter-3 under the OV hypothesis to Diameter-2 under the combinatorial 4-clique (combK4) hypothesis (Definition 8). We also give a separation between 2-slope and 3-slope non-degenerate segments: for 2-slope, we can get truly subquadratic time for any diameter value, whereas for 3-slope, the problem becomes hard for diameter Ω(logn).

Theorem 1.

Let G be the intersection graph of n line segments.

  1. 1.

    Truly subquadratic algorithms:

    • Diameter can be solved in O~(n21/32) time for non-degen. axis-aligned line segments.

    • Diameter-Δ can be solved in n21/O(hΔ+1) time for h-slope line segments. Thus, the running time is truly subquadratic for any constant h and Δ.

  2. 2.

    Lower bounds: there is no O(n2ε) time algorithm for any constant ε(0,1) for:

    • Diameter-2 for general line segments under the CombK4 hypothesis.

    • Diameter-Ω(logn) for 3-slope non-degenerate line segments under the OV hypothesis.

To obtain the algorithms in Theorem 1, we apply the framework of Chan et al. [9]: (1) bounding the VC-dimension of the set system 𝒩(VG,{Nr[v]}vV,r0), where Nr[v] is the r-neighborhood of v, and (2) designing a geometric data structure for the objects. For line segments, the geometric data structure follows from standard techniques. The main difficulty is to bound the VC-dimension. We do so by decomposing 𝒩 into so-called types where each type induces a subset of set systems whose corresponding shortest paths share the same “color pattern”. We use the color pattern on top of the standard crossing argument to bound the VC-dimension of each subset. Our technique naturally generalizes to string graphs, giving the following theorem. See Section 3 for the details.

Theorem 2.

Let G be the intersection graph of n strings on the plane.

  1. 1.

    If G is bipartite, then the VC-dimension of 𝒩(VG,{Nr[v]}vVG,r0) is at most 8.

  2. 2.

    If G has diameter Δ and chromatic number χ, then the VC-dimension of 𝒩 is O(χΔ+1).

Our lower bound for Diameter-2 for general line segments in Theorem 1 is inspired by the lower bound for Diameter-2 for axis-parallel hypercubes in 12 from the hyperclique hypothesis by Bringmann et al. [4]. It is somewhat surprising that their proof approach can be carried out in dimension as low as 2 for line segments – a key challenge in such a reduction is avoiding unintended crossings of objects, which is tougher to do in 2D; see Section 6.

The VC-dimension underpins most recent truly subquadratic diameter algorithms. A major open question is to design an algorithm with nearly linear running time for the truly subquadratic easy cases. The VC-dimension technique does not seem suited for this fast running time. Only Diameter-2 for axis-aligned unit squares [4] is known to admit O~(n) time. Here we give an almost linear (O(n)) time algorithm222O() notation hides a subpolynomial factor no(1). for unit-square graphs of any constant diameter. Our algorithm is far more involved than the previous algorithm for diameter 2 (which did not work even for diameter 3), and uses a novel no(1)-way divide-and-conquer approach based on the coordinate values modulo 1. We identify a key special case that can be reduced to orthogonal range searching, not in dimension 2 but in a dimension that grows as a function of the diameter! Afterwards, we recursively reduce to this key special case. See Section 4 for the details. We are not aware of too many low-dimensional geometric problems that are solved using orthogonal range searching in a much higher dimension as a function of some parameter (one example is Cabello and Knauer’s algorithms for distance problems on bounded-treewidth graphs [6], but our algorithm is quite different).

Another simple, yet highly non-trivial, problem is Diameter-2 for unit disks; orthogonal range searching does not seem to help here. The best running time, based on VC-dimension, is O~(n21/18) [9]. Here, we improve the running time for Diameter-2 for unit disks to O~(n4/3). Notably, we do not use VC-dimension. Instead, we exploit the fact that 1-neighborhoods behave like pseudodisks, and adapt known range searching techniques for pseudodisks. Note that our pseudodisks have non-constant complexity and can only be represented implicitly (similar ideas were used before in Agarwal, Sharir, and Welzl’s algorithm for the discrete 2-center problem [2]). See the full version for the details. The bound n4/3 is natural for many problems about unit disks (related to Hopcroft’s problem); for example, the current best algorithm for counting the number of edges in a unit disk graph requires O(n4/3) time [10].

Theorem 3.

Let G be an intersection graph with n vertices.

  • Diameter-Δ can be solved in O(n) time when vertices of G are axis-aligned unit squares.

  • Diameter-2 can be solved in O~(n4/3) time when vertices of G are unit disks.

Finally, we show new lower bounds for triangles and strings. Since line segments are strings, our lower bounds for line segments also hold for strings. For triangles, we show that Diameter-2 is subquadratically hard even when the triangles are fat; the previous lower bound is only for Diameter-3 and non-fat triangles [4]. Here we follow the same idea in our lower bound for Diameter-2 of line segments in Theorem 1. The key challenge is handling the unintended crossings of triangles in 2D. The fatness requirement makes the overall argument more delicate. We then obtain the lower bound for Diameter-2 of strings with O(1) complexity as a simple corollary; details are given in Section 5. For strings of O(logn) complexity, we show that Diameter-1 is subquadratically hard. Observe that Diameter-1 problem is equivalent to deciding if the intersection graph of a given set of objects is a clique. For objects that are semialgebraic sets of constant description complexity, Diameter-1 can be solved in truly subquadratic time by known data structures for intersection searching [3]. Our lower bound in Theorem 4 shows that the problem is hard for strings of O(logn) complexity by a reduction from OV. The idea is to create a polygonal chain of d vertices from each vector of dimension d, such that there are two orthogonal vectors if and only if there are two non-intersecting chains; details are given in the full version.

Theorem 4.

There is no O(n2ε) time algorithm for constant ε(0,1) for:

  • Diameter-2 of fat triangles or strings of O(1) complexity under the 3-uniform 6-hyperclique hypothesis.

  • Diameter-1 of strings of O(logn) complexity under OV hypothesis.

2 Preliminaries

Graph preliminaries.

Throughout this paper, we will let G=(V,E) be a geometric intersection graph of n=|V| geometric objects 𝒪. We will assume that we are given the geometric objects 𝒪. In this paper, we mostly consider connected objects that have O(1) complexity, unless noted otherwise. We use d(u,v) to denote the distance between two vertices u,vV in G. We denote the 1-hop neighborhood of a vertex v by N[v], and the r-neighborhood ball of v by Nr[v]:={uV:d(u,v)r}. For any two vertices u and v, we denote by πG(u,v) the shortest path between them and |πG(u,v)| its number of edges.

VC-dimension.

Given a set system (U,) with a ground set U and a family of subsets of U, its VC-dimension is the cardinality of the largest SU such that S is shattered by – for every SS, there is some X such that XS=S. We denote this VC-dimension by VC-Dim(U,). We say that a graph G has distance VC-dimension at most d if the set system of neighborhood balls (VG,{Nr[v]}vV,r0) has VC dimension at most d.

Let 𝒜 and be two families of subsets of the same ground set U. We define 𝒜{AB:A𝒜,B}. It is well known that:

Lemma 5 (Vapnik [21]).

VC-Dim(U,𝒜)VC-Dim(U,𝒜)+VC-Dim(U,).

Fine-grained complexity hypotheses.

Recent development of fine-grained complexity has identified a few hypotheses that we include here for completeness. We use them to prove our lower bounds.

Definition 6 (Orthogonal Vectors (OV) hypothesis).

Given sets A,B of n vectors in {0,1}d with d=ω(logn), deciding whether there exists an orthogonal pair (a,b)A×B requires n2o(1) time.

The OV hypothesis is implied [22] by the Strong Exponential Time Hypothesis [17].

Definition 7 (3-uniform 6-hyperclique (3H6) hypothesis [19]).

Given a 6-partite 3-uniform hypergraph G=(V,E) where V is the disjoint union of vertex set V(1),,V(6), each containing n vertices, and E(V3) such that each edge connects three vertices from different vertex sets. The problem is to decide whether there are 6 vertices S={v1,v2,,v6} with viV(i), i=1,,6, forming a 6-clique, i.e., {vi,vj,vk}E for all {i,j,k}(S3). The 3H6 hypothesis says that the problem requires n6o(1) time.

Definition 8 (Combinatorial 4-clique (combK4) hypothesis [7, 1]).

Any combinatorial algorithm detecting whether a graph of n vertices contains a 4-clique requires n4o(1) time.

3 Line Segments and String Graphs

A string graph is an intersection graph of curves in the plane. Each curve is called a string. Note that intersection graphs of line segments are string graphs. In this section, we will devote to proving VC-dimension bounds for string graphs that will give subquadratic diameter algorithms for line-segment intersection graphs. Once we have upper bounds for VC-dimension, we can apply (variations of) the algorithmic framework of [9] to obtain subquadratic time algorithms.

Figure 1: (a) Two (vertex-disjoint) paths P and Q cross on the plane; their canonical (red) curves cross. (b) Two paths πG(vij,ai) (yellow) and πG(vcd,ac) (blue) cross on the plane; in this figure, |πG(vij,ac)||πG(vij,ai)|.

Our key technical contribution in this section is a new color-based argument to bound the VC dimension. To set the stage, we need to introduce the notion of canonical curves. Let G be the intersection graph of (connected) objects. For each object ox corresponding to a vertex xV, we pick a point pxox as a representation of ox. For a path P between two vertices x and y in G, there is a planar curve, denoted by σP, that connects pxox and pyoy, and traces the objects corresponding to the vertices in P. We call σP the canonical curve of P. For a pair of vertices x and y, we define their canonical curve σ(x,y) to be the canonical curve of the shortest path in G between x and y. (We will fix one arbitrary shortest path per pair to define the canonical curve.) We say that two paths P and Q of G cross on the plane if they do not share any endpoint and their canonical curves intersect in 2. Note that P and Q might be vertex-disjoint; see Figure 1(a).

Our starting point is the K5-avoidance argument by Chang, Gao, and Le [11] for showing that the distance VC-dimension of any intersection graph of pseudo-disks is at most 4, which we briefly review here. The proof is by contradiction: suppose that 5 vertices {a1,a2,,a5} are shattered, then, for every two points ai and aj where ij[5], there is a (distinct) vertex vij whose neighborhood contains ai and aj only. The two canonical curves σ(ai,vij)σ(vij,aj) form a curve between pai and paj on the plane. The set of 5 points {pai}i[5] and 10 curves {σ(ai,vij)σ(vij,aj)}ij[5] between these points form a drawing of K5 on the plane. Then, by the Hanani–Tutte theorem, there exist two curves that do not share endpoints and cross (an odd number of times). Consequently, there exists vij and vcd for four distinct indices i,j,c,d[5] such that πG(vij,ai) and πG(vcd,ac) cross on the plane. Using the fact that objects are pseudo-disks, they conclude that either (i) |πG(vcd,ai)||πG(vcd,ac)| or (ii) |πG(vij,ac)||πG(vij,ai)|; see Figure 1(b). In the former case, the neighborhood of vcd contains ai, contradicting that vcd only contains ac and ad; in the latter case, the neighborhood of vij contains ac, contradicting that vij only contains ai and aj. The last part of the argument depends crucially on the fact that objects are pseudo-disks, and therefore, does not apply to strings and line segments (which are not pseudo-disks).

Here, we devise a new argument based on vertex coloring on top of the K5-avoidance technique. Our idea is best illustrated in the case of bipartite string graphs G=(AB,E) (in Section 3.1). Specifically, each vertex can be colored as A or B, depending on which side it belongs to. Then we can view each canonical curve σ(ai,vij) as a sequence Sij of alternating colors: Sij=ABAB. Following the setup of the K5-avoidance argument, when πG(vij,ai) and πG(vcd,ac) cross on the plane, our key idea is to align the corresponding color sequences Sij and Scd at the crossing objects, which have different colors. Then, by a simple case analysis, we can still show that either (i) |πG(vcd,ai)||πG(vcd,ac)| or (ii) |πG(vij,ac)||πG(vij,ai)| as in the case of pseudo-disks and get a contradiction. We note that the color alignment argument holds only when there are two colors (due to bipartiteness); it does not hold when there are three or more colors. Indeed, for the case of three colors, we have a quadratic conditional lower bound by Theorem 1, and the VC-dimension is unbounded.

For string graphs of bounded chromatic number and bounded diameter, we decompose the set system (V,{Nr[v]}vV,r0) into set systems of different types, each type corresponds to a fixed sequence of (vertex) colors. Then, for each sequence of colors S, we define a notion of ball BS(v) that contains all vertices reachable from v by paths whose vertex colors form a subsequence of S; the goal is then to bound the VC dimension of (V,{BS(v)}vV). Our key insight is that, by restricting the color sequences in the definition of BS(v) to be subsequences of S, we could apply our color alignment argument again. The case analysis is more delicate, but the underlying idea remains the same as in bipartite string graphs. The proof is given in Section 3.2.

Finally, in Section 3.3, we adapt the argument for string graphs of bounded chromatic number and bounded diameter to (possibly degenerate) line segments with few slopes. Here, the new issue is that the colors are not proper: the endpoints of an edge could share the same color. We get around this issue by exploiting the fact that objects are line segments. Roughly speaking, if two segments s and s~ of the same slope, say horizontal, intersect, then one of the neighbors of s will intersect s~ (or vice versa). This means we can align the color of a neighbor of s with that of s~, and hence the color alignment argument can be applied again.

3.1 Bipartite String Graphs

Theorem 9.

Every bipartite string graph (AB,E) has distance VC-dimension at most 8.

Proof.

Suppose that at least 9 vertices are shattered by the set system, then at least 5 vertices in one side, say A, are shattered. Let these be XA{a1,a2,,a5}. Let vij and rij be such that XANrij[vij]={ai,aj}. We call rij the the radius associated with vij.

For every string sx corresponding to a vertex xV, we pick a point pxsx, as a representation of sx. Recall that for every two vertices x and y and a shortest path πG(x,y) between them in graph G, the canonical curve σ(x,y) is a planar curve tracing the strings corresponding to vertices in πG(x,y) that connects xsx and ysy.

Write the vertices of the canonical curve from ai to vij as a sequence Sij of alternating colors of length irij+1: Sij=ABAB where each color corresponds to which set (either A or B) the vertices belong. The initial color of Sij is A since aiA. We’ll use the notation Sij[k] to denote the kth color in the sequence Sij and the notation Sij[k1k2] to denote the contiguous subsequence of Sij between the indices k1 and k2.

To get a contradiction, we follow the K5-avoidance argument using the Hanani–Tutte theorem. Specifically, observe that XA and the set of curves {σ(ai,vij)σ(vij,aj)}1i,j5 form a drawing of K5 on the plane. Then by the Hanani–Tutte theorem, there exist two curves not sharing endpoints that cross an odd number of times, i.e., the curves cross at least once. Suppose that the crossing pair of canonical curves were σ(ai,vij) and σ(ac,vcd) for four distinct indices i,j,c,d[5]. We will show that the following two facts result in a contradiction.

  1. 1.

    There are two vertices xi corresponding to a string on the canonical curve σ(ai,vij) and xc corresponding to a string on σ(ac,vcd) where either xi=xc or xi crosses xc (i.e. (xi,xc)E).

  2. 2.

    acNrij[vij] and aiNrcd[vcd].

Suppose that xi was the kith vertex out of i total vertices on the canonical curve σ(ai,vij) and that xc was the kcth vertex out of c total vertices on the canonical curve σ(ac,vcd). Recall that as xcNrcd[vcd], we must have crcd+1. Without loss of generality, assume that kikc.

First we consider the case where xi=xc. Then there must be a path from ai to vcd corresponding to the concatenated sequence Sij[1ki]Scd[(kc+1)c]. However the length of this sequence is ki+(ckc)crcd+1, which means that aiNrcd[vcd] which is a contradiction.

Next we consider the case that xi and xc cross. Note that exactly one of xi and xc is in A while the other is in B. In particular, this means that kikc, since both Sij and Scd are alternating sequences beginning with A, so ki<kc. As both are integers, ki+1kc. Now this means that the path corresponding with the sequence Sij[1ki]Scd[kcc] has length at most ki+(ckc+1)crcd+1 which again means that aiNrcd[vcd], a contradiction.

In the full version we show that this VC-dimension bound can be easily used in the framework of [9] to obtain a subquadratic time algorithm.

Theorem 10.

The diameter of axis-aligned segments in general position can be computed in O~(n21/32) time.

This sharply contrasts with the conditional lower bound by Bringmann et al. [4] who showed that computing the diameter of an intersection graph of axis-aligned segments that are not in general position requires Ω(n2ε) time for any ε>0.

3.2 String Graphs of Bounded Diameter and Chromatic Number

In this section, we prove the following VC-dimension bound for string graphs with bounded chromatic number and bounded diameter.

Theorem 11.

Let G=(V,E) be a string graph with chromatic number χ and diameter Δ. Then (V,{Nr[v]}vV,r0) has VC-dimension at most O(χΔ+1).

The key insight into proving Theorem 11 is to decompose (V,{Nr[v]}vV,r0) into set systems of different types, and show that each type has bounded VC-dimension. First, we introduce the types. Let 𝒮 be the set of sequences of length at most Δ+1 where each element of a sequence is a color in [χ]. Observe that |𝒮|=O(χΔ+1).

We will use the notation P(vu) to denote a directed path obtained from an undirected path P(v,u) by directing all the edges away from v. If a and b are two vertices in P(vu) such that b is reachable from a on the path, then we denote by P(vu)[a,b] the subpath from a to b. We consider a proper coloring of the vertices in G with at most χ different colors. The colors of the vertices in P(vu) induce a sequence of colors, say S. We say that P(vu) is an S-rainbow path from v to u. If a sequence of colors S is a (not necessarily contiguous) subsequence of S, we write SS. For every sequence S𝒮, let

BS(v){uV: SS and an S-rainbow path P(vu)} (1)

We show that these carefully defined balls have bounded VC-dimension using a generalization of the bipartite argument.

Lemma 12.

VC-Dim(V,{BS(v)}vV)4 for any sequence of colors S.

Proof.

We follow the setup (and proof technique) of Theorem 9. In particular, X={a1,,a5} is the set of vertices shattered by {BS(v)}vV, and vij is such that XBS(vij)={ai,aj}. Then, there exist four distinct indices i,j,c,d[5] inducing an Si-rainbow path Pi with canonical curve σ(vij,ai) and an Sc-rainbow path Pc with canonical curve σ(vcd,ac) which cross. Note that SiS and ScS. We show the following result in a contradiction.

  1. 1.

    There are two vertices xi corresponding to a string on the canonical curve σ(vij,ai) and xc corresponding to a string on σ(vcd,ac) where either xi=xc or xi intersects xc (i.e. (xi,xc)E).

  2. 2.

    aiBS(vcd) and acBS(vij).

As Si is a subsequence of S, there exist some mapping ISi(k) for k{1,,|Si|} such that if ISi(k)=h then Si[k]=S[h], and for all 1<2, we have that ISi(1)<ISi(2) (this is by the formal definition of subsequence). We call ISi(k) the S-index of Si[k]. We similarly define the ISc(k) to be the S-index of Sc[k]. Let ki denote the index of xi in the path Pi and kc for the index of xc in Pc. Without loss of generality, assume that ISi(ki)ISc[kc].

Now consider if xi=xc. There must exist a path from vij to xi=xc to ac with the sequence S=Si[1ki]Sc[(kc+1)|Sc|]. Furthermore, Si[1ki]S[1ISi(ki)] and Sc[(kc+1)|Sc|]S[(ISc[kc]+1)|S|]. Since ISi(ki)ISc[kc], then it follows that SS which is a contradiction as this would mean acBS(vij).

On the other hand suppose there is an edge between xi and xc. Note that as xi and xc have different colors, we must have ISi(ki)ISc(kc), meaning that ISi(ki)<ISc(kc) and as S-indices take on integer values, ISi(ki)+1ISc(kc). There must exist a path from vij to xi=xc to ac with the sequence S′′=Si[1ki]Sc[kc|Sc|]. As Si[1ki]S[1ISi(ki)] and Sc[kc|Sc|]S[ISc[kc]|S|]S[(ISi[ki]+1)|S|], this shows that S′′S. This means acBS(vij) which is a contradiction.

Proof of Theorem 11.

Since the diameter of G is Δ, every shortest path P(uv) from u to v induces a sequence of at most Δ+1 colors. Recall that 𝒮 is the set of all sequences of colors of length at most Δ+1, so |𝒮|O(χΔ+1). Let S={BS(v)}vV and G={Nr[v]}vV,r0. Observe that GS𝒮S, and hence

VC-Dim(V,G)Lem. 5S𝒮VC-Dim(V,S)Lem. 124|𝒮|=O(χΔ+1).

3.3 Intersection Graphs of Line Segments with Few Slopes

Recall that we say that a collection of line segments is h-slope if the slopes of the line segments have h distinct values. To show the following theorem, we will again use the Hanani-Tutte theorem, but now we must allow overlaps for the curves. We say that two curves cross if they cross in the traditional sense after some sufficiently small local perturbations, as in [15].

Theorem 13.

Let G=(V,E) be an intersection graph of h-slope line segments with diameter Δ. Then (V,{Nr[v]}vV,r0) has VC-dimension at most O(hΔ+1).

Proof.

It is tempting to directly apply Theorem 11 to prove Theorem 13, but a set of h-slope line segments may be degenerate, so two line segments of the same slope can intersect, and therefore, the graph is not h-colorable. However, we can still create a (non-proper) coloring of the geometric intersection graph G where each line segment is colored by its slope, and define S-rainbow paths for sequences of colors S as before. The only issue occurs in the proof of Lemma 12. If two canonical paths considered share any vertices we can apply the argument in Lemma 12.

It suffices to show that we can always find two adjacent vertices that correspond to different S-indices. Unfortunately, the intersection guaranteed by the Hanani-Tutte theorem may consists of two canonical curves σ(ai,vij)σ(vij,aj) and σ(ac,vcd)σ(vcd,ad) that cross at two distinct edges (vertices of the intersection graph) xij and xcd with the same S-index, meaning that (xij,xcd)E and have the same slope as line segments. By rotating the plane, we may assume that xij and xcd are horizontal line segments. Note that both canonical curves consists of at least two vertices. If xij (or xcd) intersects with the predecessor/successor of xcd (or xij) on their corresponding canonical curve, we would be done (since that predecessor/successor vertex does not have identical S-index) by the same argument of Lemma 12. The remainder of this proof is dedicated to showing that any such intersection given by the Hanani-Tutte theorem also guarantees an intersection between a predecessor/successor vertex.

Figure 2: Cases for the proof of Theorem 13. The blue and red paths indicate the canonical curves. In all cases, the horizontal segments lie on the same line, but have been drawn with a small gap in between for clarity. The predecessor/successor curves may not exist, or may also be horizontal, but we have drawn them as non-horizontal (if they exist) for clarity.

See Figure 2 for illustrations of how the canonical curves can intersect at two vertices that correspond to horizontal line segments, where a blue canonical curve can intersect with a red canonical curve at two horizontal line segments. In the figure, the predecessor/successor edges can be either horizontal or non-horizontal. We illustrate them as non-horizontal for clarity, as only the location of intersection with the predecessor/successor edges matters. The cases reflect how the horizontal intervals on the two canonical curves can intersect, in case (i) the red and blue horizontal segments are nested, in cases (ii) and (iv) they intersect but do not nest, and in case (iii) they are completely disjoint. In case (i), the blue horizontal segment is nested in the red horizontal segment, and thus intersection of the blue predecessor/successor with the red horizontal segment is unavoidable. In case (iii) the horizontal segments of the red and blue curves are not intersecting at all, which is not a valid intersection that the Hanani-Tutte theorem can give us. In case (ii) and (iv) the blue and red horizontal segments intersect, but are not nested. In these cases either a predecessor/successor segment intersects the horizontal segment of the other as in case (ii), or they can be separated as curves in case (iv), and are not a valid intersection that is given by the Hanani-Tutte theorem (they can be perturbed to be non-intersecting).

We would like to apply Theorem 13 to the framework of [9] to obtain a result for Diameter-Δ of line segments with h slopes. However, there are technical issues with implementing an efficient data structure for line segments with h slopes. Indeed, even for a collection of axis-aligned segments (i.e., with two slopes), we do not see how to implement the colored range searching data structure efficiently. We resolve these technical issues in the full paper by carefully computing neighborhood balls in the order of increasing length of sequences to reuse prior computation and ensure that the data structure problem involves exactly one type of slope at a time.

Theorem 14.

Diameter-Δ of line segments with at most h different slopes can be solved in n21/O(hΔ+1) time.

4 Almost-Linear Time Const-Diameter Algorithm for 2D Unit Squares

In this section, we present an O(n)-time algorithm for testing whether the diameter of a 2D unit-square graph is at most Δ, for any given constant Δ. The precise time bound is n2O(lognloglogn), interestingly. All squares in this section are axis-aligned. Our result significantly extends Bringmann et al.’s near-linear algorithm for unit-square graphs [4], which worked only for Δ=2. It also significantly improves the O~(n7/4) time bound of Duraj, Konieczny, and Potępa’s algorithm [14] in the constant Δ case; since Duraj et al.’s approach is based on distance VC-dimension, it does not seem possible to improve their time bound to near linear (the VC-dimension or shatter dimension for unit squares is at least 2 even for 1-neighborhoods!). Our new algorithm employs an unusual divide-and-conquer approach:

  1. 1.

    Often in computational geometry, we divide based on (say) the median x- or y-coordinate, but in our new algorithm, we will divide based on coordinate values modulo 1.

  2. 2.

    We will use a larger fan-out rather than dividing 2-way.

  3. 3.

    We will repeatedly map input points to new points in a higher dimension (dependent on Δ), constructed in a nontrivial way, to enable orthogonal range searching techniques.

Even though the diameter problem may not at first seem amenable to divide-and-conquer (not being a “decomposable” problem), we show that a combination of these ideas is powerful enough to solve the problem efficiently for any constant Δ (unlike the far more straightforward approach by Bringmann et al. for Δ=2).

For a point p2, denote by p the unit square centered at p. Let x(p) and y(p) denote the x- and y-coordinate of a point p respectively. To keep the presentation simple, we assume that all coordinate values are distinct. It is straightforward to modify the algorithm below to handle cases when some values may be equal, just by being more careful about < vs. signs and open vs. closed intervals. (This is unlike our other results on axis-aligned line segments, where degeneracies can make a big difference.) We will solve the problem in a slightly more general setting for Δ+1 point sets P0,,PΔ: testing whether all distances between p0 and pΔ for (p0,pΔ)P0×PΔ are exactly Δ in the (Δ+1)-partite intersection graph of the unit squares centered at P0,,PΔ, i.e., the subgraph of the intersection graph where we include an edge between p and q only when pPj and qPj+1 for some j{0,,Δ1}. The original problem reduces to the case when P0,,PΔ are identical sets (or almost identical, if we want to ensure general position).

Build a uniform grid over 2 of unit side length. We first identify a special case which we can solve quickly. Specifically, suppose that the points pjPj lie in a fixed grid cell for a fixed j, and points in pj+1Pj+1 lie in a fixed neighboring grid cell, w.l.o.g., say, to its right; furthermore, suppose that all such points satisfy x(pj)mod1>μ and x(pj+1)mod1<μ. Then we already know that |x(pj)x(pj+1)|<1, and so it suffices to enforce only the constraint that |y(pj)y(pj+1)|<1. Consequently, we can proceed greedily: for each p0P0, we only need to find the lowest point in Pj reachable from p0, and for each pΔPΔ, we only need to find the highest point in Pj+1 reachable from pΔ (or vice versa, depending on the position of neighboring cell), as explained in the lemma below:

Lemma 15.

Given Δ+1 point sets P0,,PΔ2 of total size n, and given j{0,,Δ1} and μ(0,1), we can compute mappings ϕ:P0 and ψ:PΔ in O~(n) time, satisfying the following property for every (p0,pΔ)P0×PΔ:

((p1,,pΔ1)P1××PΔ1: pi intersects pi+1 for all i, and
pj(μ,1)×(0,1), and pj+1((0,μ)(1,1+μ))×(1,1))
ϕ(p0)<ψ(pΔ).

Proof.

Define the weight of each point in Pj((μ,1)×(0,1)) to be its y-coordinate; the weights of all other points in Pj is set to . For each i=j1,,0, define the weight of each point pPi to be the min weight among all points in Pi+1 with L-distance at most 1 from p. These values can be computed by orthogonal range min queries. For each pP0, define ϕ(p) to be the weight of p.

Similarly, define the weight of each point in Pj+1((1,1+μ)×(1,1)) to be its y-coordinate; the weights of all other points in Pj+1 is set to . For each i=j+2,,Δ, define the weight of each point pPi to be the max weight among all points in Pi1 with L-distance at most 1 from p. These values can be computed by orthogonal range min queries. For each pPΔ, define ψ(p) to be the weight of p plus 1.

Then the property is satisfied (pj(μ,1)×(0,1) and pj+1((0,μ)(1,1+μ))×(1,1) imply |x(pj)x(pj+1)|<1 and y(pj+1)y(pj)<1, so we only need y(pj)y(pj+1)<1).

Suppose P0 lies in a fixed grid cell, say, (0,1)2. We apply Lemma 15 to solve the above special case for each of the Δ choices for j and each of the O(Δ2) choices of grid cells for Pj and its neighboring cells for Pj+1. However, we cannot solve these cases separately, since the diameter problem is not decomposable. Instead, our idea is to view each special case as imposing an additional constraint in a new dimension, so that the combined problem can be reduced to an orthogonal range searching problem [3, 12] in a higher (O(Δ3)) dimension.

Lemma 16.

Given Δ+1 point sets P0,,PΔ2 of total size n where P0(0,1)2, and given μ(0,1), we can compute mappings ϕ:P0O(Δ3) and ψ:PΔO(Δ3) in O~(Δ3n) time, satisfying the following for every (p0,pΔ)P0×PΔ:

((p1,,pΔ1)P1××PΔ1,j: pi intersects pi+1 for all i, and
x(pj)mod1>μ and x(pj+1)mod1<μ, or vice versa)
ϕ(p0) does not dominate ψ(pΔ).

Proof.

For each α2 with L-norm at most Δ, and each j{0,,Δ1}, we compute mappings ϕ(α,j,1),,ϕ(α,j,4):P0 and ψ(α,j,1),,ψ(α,j,4):PΔ satisfying the following properties:

  1. 1.

    ((p1,,pΔ1)P1××PΔ1: pi intersects pi+1 for all i, and
    pjα+((μ,1)×(0,1)), and pj+1α+(((0,μ)(1,1+μ))×(1,1)))
    ϕ(α,j,1)(p0)<ψ(α,j,1)(pΔ).

  2. 2.

    ((p1,,pΔ1)P1××PΔ1: pi intersects pi+1 for all i, and
    pjα+((μ,1)×(1,0)) and pj+1α+(((0,μ)(1,1+μ))×(1,1)))
    ϕ(α,j,2)(p0)<ψ(α,j,2)(pΔ).

  3. 3.

    ((p1,,pΔ1)P1××PΔ1: pi intersects pi+1 for all i, and
    pj+1α+((μ,1)×(0,1)), and pjα+(((0,μ)(1,1+μ))×(1,1)))
    ϕ(α,j,3)(p0)<ψ(α,j,3)(pΔ).

  4. 4.

    ((p1,,pΔ1)P1××PΔ1: pi intersects pi+1 for all i, and
    pj+1α+((μ,1)×(1,0)) and pjα+(((0,μ)(1,1+μ))×(1,1)))
    ϕ(α,j,4)(p0)<ψ(α,j,4)(pΔ).

The first two properties differ only in the location of pjα+((μ,1)×(0,1)) versus pjα+((μ,1)×(1,0)), and the second two properties are identical to the first with the locations of pj and pj+1 swapped. Each such mapping can be computed by Lemma 15 (shifting by α, possibly with y-coordinates negated and/or P0,,PΔ reversed). Finally, we define ϕ and ψ as the Cartesian products of these mappings ϕ(α,j,1),,ϕ(α,j,4) and ψ(α,j,1),,ψ(α,j,4) over all O(Δ2) choices of α and Δ choices of j.

How can we reduce the problem in the general case to the case from Lemma 16? A natural approach is binary divide-and-conquer. We divide the input sets into two parts: points with x-coordinates less than μ modulo 1, and points with x-coordinates greater than μ modulo 1, where μ is the median of the x-coordinates mod 1. There are 3 cases for a path p0,,pΔ: (i) it stays entirely in {(x,y):xmod1<μ}; (ii) it stays entirely in {(x,y):xmod1>μ}; (iii) it crosses between {(x,y):xmod1>μ} and {(x,y):xmod1<μ}. Case (i) can be handled by one recursive call with half of the points. Case (ii) can be handled by another recursive call with the other half of the points. If case (iii) occurs, there must be some j for which x(pj)mod1>μ and x(pj+1)mod1<μ or vice versa – this is precisely the case handled by Lemma 16!

However, there is one important issue: the diameter problem is not decomposable. For example, consider a pair (p0,pΔ)P0×PΔ with x(p0)mod1<μ and x(pΔ)mod1<μ. It could be covered by case (i) or case (iii). If we are solving the distance oracle problem (testing whether p0 and pΔ have distance Δ for a given query pair (p0,pΔ)), we could consider both cases, recurse, and take the “or” of the answers, thus obtaining logarithmic query time. However, for the diameter problem, we need to exclude pairs (p0,pΔ) that already pass the test from case (iii) when we make the recursive call to handle case (i). We cannot afford to enumerate all such pairs since there are quadratically many in the worst case. Our idea is to realize that the pairs we want to exclude are encodable by orthogonal range searching/dominance constraints in O(1) dimensions, according to Lemma 16. As we recurse, we just add more and more dimensions to the encoding.

A binary divide-and-conquer has O(logn) recursion depth, and if the dimension were to increase to O(logn), we would no longer be able to solve the orthogonal range searching subproblems in near-linear time. A final idea is to use a larger fan-out b for the divide-and-conquer (for example, the recursion depth is reducible to O(1) by setting b=nε, though we will suggest a slightly better choice of b below). The details are made precise below:

Lemma 17.

Given Δ+1 point sets P0,,PΔ2 of total size n where P0(0,1)2, parameter D, and mappings f:P0D and g:PΔD, we can decide whether for all (p0,pΔ)P0×PΔ with f(p0) dominating g(pΔ), there exists (p1,,pΔ1)P1××PΔ1, such that pi intersects pi+1 for all i, in n2O(Δ3lognloglogn)logDn time.

Proof.

We use b-way divide-and-conquer for a parameter b to be set later:

  1. 1.

    Compute quantiles 0=μ0<μ1<<μb1<μb=1 such that each interval (μk,μk+1) contains roughly n/b elements of {x(p)mod1:pP0PΔ}. For each k{0,,b1} and i{0,,Δ}, let Pi(k)={pPi:x(p)mod1(μk,μk+1)}.

  2. 2.

    For each k{0,,b}, compute mappings ϕ(k):P0O(Δ3) and ψ(k):PΔO(Δ3), satisfying the following property:

    ((p1,,pΔ1)P1××PΔ1,j: pi intersects pi+1 for all i, and
    x(pj)mod1>μk and x(pj+1)mod1<μk, or vice versa)
    ϕ(k)(p0) does not dominate ψ(k)(pΔ).

  3. 3.

    For each k{0,,b1}, verify that there is no pair (p0,pΔ)P0(k)×(PΔPΔ(k)) such that (f(p0),ϕ(k)(p0),ϕ(k+1)(p0)) dominates (g(p0),ψ(k)(pΔ),ψ(k+1)(pΔ)). This can be done by (D+O(Δ3))-dimensional orthogonal range searching in bn(logn)D+O(Δ3) time.

  4. 4.

    For each k{0,,b1}, recursively solve the problem for P0(k),,PΔ(k) with f and g replaced by (f,ϕ(k),ϕ(k+1)) and (g,ψ(k),ψ(k+1)).

To see correctness, observe that for any (p0,,pΔ)P0××PΔ and any k, one of the following is true: (i) j:x(pj)mod1<μk and x(pj+1)mod1>μk, or vice versa, or (ii) j:x(pj)mod1<μk+1 and x(pj+1)mod1>μk+1, or vice versa, or (iii) (p0,,pΔ) is in P0(k)××PΔ(k), or (iv) (p0,,pΔ) is in (P0P0(k))××(PΔPΔ(k)). (In other words, if the sequence of x-coordinates in (p0,,pΔ) modulo 1 does not “cross” μk nor μk+1, then the sequence must stay completely inside the interval (μk,μk+1) or completely outside.) For (p0,pΔ)P0(k)×(PΔPΔ(k)), it is (i) or (ii) (handled by step 3). For (p0,pΔ)P0(k)×PΔ(k), it is (i), (ii), or (iii) (handled by step 4).

The running time satisfies the recurrence T(n,D)bT(n/b,D+O(Δ3))+bn(logn)D+O(Δ3). There are O(logbn) levels of recursion, and the dimension parameter D increases by O(Δ3) at each level. The recurrence solves to T(n,D)bn(logn)D+O(Δ3logbn). Setting b=2Δ3lognloglogn yields T(n,D)n2O(Δ3lognloglogn)logDn.

Theorem 18.

Given Δ+1 point sets P0,,PΔ2 of total size n, we can decide whether for all (p0,pΔ)P0×PΔ, there exists (p1,,pΔ1)P1××PΔ1, such that pi intersects pi+1 for all i, in time n2O(Δ3lognloglogn), which is O(n) for any constant Δ (or, in fact, for any Δ=o(log1/3n/log1/3logn)).

Proof.

Build a uniform grid of side length 1. For each nonempty grid cell α+(0,1)2 (with α2), we solve the problem for P0(α+(0,1)2), P1(α+(1,2)2), …, PΔ(α+(Δ,Δ+1)2) by Lemma 17 (with trivial mappings f and g, i.e., D=0). Each point participates in O(Δ2) subproblems.

5 Diameter-2 Lower Bound for 2D Triangles

In this and the next three sections, we turn to proving conditional lower bounds. We begin with a proof of a near-quadratic lower bound for Diameter-2 for 2D triangles, assuming the 3-uniform 6-hyperclique hypothesis.

Consider convex chains Cleft,Cright on six points each (i.e., including endpoints), positioned so that for any point pair pleftCleft,prightCright, the segment pleftpright is disjoint from the interiors of the convex hulls of Cleft and Cright. See Figure 3 for an example of such a configuration. Let v1,,v6 denote the vertices along Cleft, and sAB,sBC,sCA the segments v1v2,v3v4, and v5v6, respectively. We define the segments sDE,sEF,sFD analogously along Cright.

Figure 3: Left: Two convex chains Cleft and Cright placed so that any segment connecting them remains disjoint from the interiors of their convex hulls (the red shaded regions). Right: Defining a group of k×k points along sAB, such that pAB(a,b) are grouped by the value of a, and groups have gaps of size |sAB|/k.

Let G=(VAVBVCVDVEVF,E) be a 6-partite 3-uniform hypergraph with k:=n1/3 vertices in each of the six parts. Our idea is to encode some edges and non-edges of this graph via certain triangles. First, we associate specific points on the previously defined segments with certain pairs (a,b)[k]2. We will then encode a triplet (va,vb,vc)VA×VB×VC via the pairs (a,b), (b,c) and (c,a).

Consider now the segment sAB. For each a,b[k]2 let pAB(a,b) be the point of sAB at distance |sAB|(a1k+bτk2) from v1, where |sAB| denotes the length of sAB, and τ2 is a constant we can choose freely; for now, we can set τ=2. Similarly, for each (b,c)[k]2 and (c,a)[k]2 we set pBC(b,c) and pCA(c,a) to be the point of sBC at distance |sBC|(b1k+cτk2) from v3 and the point of sCA at distance |sCA|(c1k+aτk2) from v5, respectively. Define the points pDE(d,e), pEF(e,f) and pFD(f,d) along the segments sDE,sEF,sFD analogously.

In each part VX of G, X{A,B,C,D,E,F} we index the vertices from 1 to k, i.e., VX={v1X,,vkX}. We will drop the superscripts of the vertices when they can be inferred from the context. Let {X,Y,Z} be three distinct symbols among {A,B,C,D,E,F}. The triplet {X,Y,Z} is considered a crossing triplet if {X,Y,Z} has a non-empty intersection with both {A,B,C} and {D,E,F}.

Our reduction realizes an intersection graph similar to the intersection graph for a lower bound of [4] designed for 12-dimensional hypercubes.

Let G be the intersection graph of the following triangles (see also Figure 4):

  • For each edge (va,vb,vc)E(G)(VA×VB×VC) add the triangle

    ΔABC(a,b,c) with vertices pAB(a,b),pBC(b,c),pC,A(c,a).
  • For each edge (vd,ve,vf)E(G)(VD×VE×VF) add the triangle

    ΔDEF(d,e,f) with vertices pDE(d,e),pEF(e,f),pFD(f,d).
  • For each crossing triplet {X,Y,Z} with XY{AB,BC,CA} and ZW{DE,EF,FD} and each non-edge (vx,vy,vz)(X×Y×Z)E(G) add a triangle

    ΔXYZ(x,y,z) with vertices pXY(x,y)pZW(z,1)pZW(z,k).
  • For each crossing triplet {X,Y,Z} with XY{DE,EF,FD} and ZW{AB,BC,CA} and each non-edge (vx,vy,vz)(X×Y×Z)E(G) add a triangle

    ΔZXY(z,x,y) with vertices pZW(z,1)pZW(z,k)pXY(x,y).
  • Add a triangle Δleft that covers all triangles ΔABC, intersects all triangles corresponding to crossing triplets, and is in the open half-plane x<0. Let Δright be the mirror image of Δleft.

Figure 4: The construction of the intersection graph G. Triangles on the left and right (red and blue) correspond to edges of G, crossing triangles (green) correspond to non-edges of G. The two gray triangles are the dummy triangles Δleft and Δright.
Observation 19.

The vertices of the constructed graph G satisfy the following properties:

  1. 1.

    ΔABC(a,b,c)ΔABD(a,b,d) if and only if a=a and b=b.

  2. 2.

    ΔABC(a,b,c)ΔADE(a,d,e) if and only if a=a.

  3. 3.

    ΔABC(a,b,c)ΔDEF(d,e,f)=.

  4. 4.

    ΔABD(a,b,d)Δleft and ΔABD(a,b,d)Δright.

  5. 5.

    ΔABC(a,b,c)Δright= and ΔABC(a,b,c)Δleft.

The analogous statements hold when exchanging ABC with DEF or exchanging the crossing triplets with other crossing triplets.

We can now prove the desired lower bound.

Theorem 20.

Assuming the 3-uniform 6-hyperclique hypothesis, there is no O(n2ε) time algorithm for deciding if the intersection graph of a given set of n triangles in the Euclidean plane has diameter at most 2.

Proof.

Bringmann et al. [4] show that an intersection graph that satisfies Conditions 1-3 as described in Observation 19 has a pair of vertices ΔABC(a,b,c),ΔDEF(d,e,f) with hop distance greater than 2 if and only if (va,vb,vc,vd,ve,vf) is a hyperclique of G. We recall the argument briefly. Consider a pair of triangles Δ1=ΔABC(a,b,c) and Δ2=ΔDEF(d,e,f). They both correspond to edges, so we have that the tuple (va,vb,vc,vd,ve,vf) forms a hyperclique if and only if all crossing triplets among (va,vb,vc) and (vd,ve,vf) are present in G. Since we only represent non-crossing triplets in the graph, the tuple forms a hyperclique if and only if there is no crossing triangle ΔXYZ connecting Δ1 and Δ2, i.e., they have no shared neighbor, or equivalently, they have hop distance at least 3.

The reduction is almost complete. However, we need to ensure that no other vertex pairs can form a pair whose distance is at least 3 in G. Let Dleft denote the set of triangles ΔABC(a,b,c), and let Dright denote the set of triangles ΔDEF(d,e,f). One can verify that the triangles Δleft,Δright ensure that if a given pair Δ,Δ of vertices of G satisfies (a) Δ,ΔDleft, or (b) Δ,ΔDright, or (c) at least one of Δ,Δ is not in DleftDright, then the hop distance of Δ and Δ is at most 2. Thus the only setting where distance 3 is possible is the one discussed above.

We can strengthen Theorem 20 to fat triangles; in fact the angles of every triangle can be forced to be close to a right-angled isoceles triangle, henceforth called half-squares. For a fixed ε>0 we say that a triangle is an ε-half-square if its longest side length is in the interval [(2ε)s,(2+ε)s] and its two shorter side lengths fall in the interval [(1ε)s,(1+ε)s] for some s>0.

We claim that the above intersection graph can be realized with ε-half-squares for any fixed ε>0, as follows. First, we choose both convex chains in such a way that the segments sXY for {XY}{AB,BC,CE} have length ε/100 and there is a triangle with base v2v5 of length 2+ε/2 whose third vertex is the midpoint of sBC=v3v4. We place the chain as depicted in Figure 5(i) so that it is symmetric on the x axis, and the line through sAB and sCA have slope 1ε/10 and 1+ε/10, respectively, and they intersect the x-axis at some point (T,0), where T=T(ε) will be determined later. The segments sDE,sEF,sFD are obtained by reflecting sAB,sBC,sCA on the origin. Observe that the triangles ΔABC(a,b,c) and ΔDEF(d,e,f) are ε-half-squares. For all other triangles, we modify them so that they are half-squares, as follows:

  • For each crossing triplet {X,Y,Z} with XY{AB,BC,CA} and ZW{DE,EF,FD} and each non-edge (vx,vy,vz)X×Y×ZE(G) add the unique half-square ΔXYZ(x,y,z) with base uu and third vertex u^ as follows:

    • We set u=pXY(x,y),

    • u is chosen so that the intersection of ΔXYZ(x,y,z) with sZW is the segment pXW(z,1)pZW(z,k), and

    • u^ lies in the half-plane y>0.

  • For each crossing triplet {X,Y,Z} with XY{DE,EF,FD} and ZW{AB,BC,CA} and each non-edge (vx,vy,vz)X×Y×ZE(G) we modify ΔZXY(z,x,y) analogously.

  • The triangles Δleft,Δright are half-squares with the properties in Observation 19.

Figure 5: (i) Placement of the segments sAB,sBC,sCA. (ii) By choosing T large enough we ensure that the base of the half-square ΔABF(a,b,f) has angle O(ε) with the x-axis. (iii) The intersection of ΔABF(a,b,f) with the segment sFD. We need to ensure that ΔABF(a,b,f) remains disjoint from ΔDEF(d,e,f) for all ff. (iv) The vertex u of ΔABF(a,b,f) is on the arc of inscribed angle π/4 with respect to the segment pFD(f,1)pFD(f,k). By choosing τ=Ω(1/ε) large enough, we ensure that the arc is disjont from ΔDEF(d,e,f+1) for all d,e[k].

The following geometric properties establish Observation 19 for this modified construction.

Lemma 21.

For every ε>0 there exist τ and T such that:

  1. (1)

    The intersection of ΔXYZ(x,y,z) and conv(Cleft)conv(Cright) is
    the triangle upZW(z,1)pZW(z,k) and the point u.

  2. (2)

    The triangle upZW(z,1)pZW(z,k) is disjoint from all triangles corresponding to edges (i.e., the triangles ΔABC and ΔDEF) that are not incident to zVZ.

Proof.

First, notice that the placement of the segments (Figure 5(i)) ensures that sAB, sCA, sDE,and sFD have angle π/4+c0ε with the x-axis for some c0>0. Thus, if we set T=c1/ε for a large enough c1, then any segment connecting the left and right convex chain has angle at most c02ε with the x-axis, and thus the segment directions of sZW (ZW{DE,EF,FD}) do not fall into the angle cone of u for any crossing triangle ΔXYZ(x,y,z). The symmetric claim holds for crossing triangles that intersect one of sAB,sBC,sCD in an interval of positive length. This concludes the proof of (1).

Due to the placement of the segments (Figure 5(i)), any side of the triangle ΔDEF(d,e,f) and any of the segments sDE,sEF,sFD have angle at least c2ε for some ε>0 (Figure 5(ii)). Observe that for the vertex u of the crossing triangle ΔDEF(d,e,f) the angle subtended by pFD(f,1)pFD(f,k) from u is π/4, thus u is on a circular arc that has diameter O(|pFD(f,1)pFD(f,k)|)=O(|sFD|/(τk)) (see Figure 5(iii)). On the other hand, the distance between the segment pFD(f,1)pFD(f,k)| and any other point pFD(f,d) for ff is at least |sFD|/(2k) when τ2. Consequently, the distance of any point on the segment pFD(f,1)pFD(f,k)| and any triangle ΔDEF(d,e,f) where ff is at least Ω(ε|sFD|/k) (see Figure 5(iv)). Thus, if we set τ=c3/ε for some large enough τ, then upFD(f,1)pFD(f,k) is disjoint from ΔDEF(d,e,f) for all ff. This concludes the proof of (2).

Theorem 22.

Assuming the 3-uniform 6-hyperclique hypothesis, there is no O(n2ε) time algorithm for deciding if the intersection graph of a given set of n fat triangles (or even δ-half-squares for any given δ>0) in the Euclidean plane has diameter at most 2.

6 Diameter-2 Lower Bound for Segments

In this section, we prove a near-quadratic lower bound for Diameter-2 for line segments for combinatorial algorithms, assuming the combinatorial 4-clique hypothesis. Our construction uses a geometric configuration that is similar to (but a bit simpler than) our lower bound construction for triangles in Section 5. We will also rely on a very similar encoding of number pairs [k]2.

Let Cleft be the convex chain given by the vertices v1=(3,3),v2=(2,1),v3=(2,1),v4=(3,3). Let sAB,sBA denote the segments v1v2,v3v4, respectively. We define Cright to be the reflection of Cleft on the origin, and we define the segments sCD,sDC analogously along Cright. See Figure 6. Let G=(VAVBVCVD) be a 4-partite graph with k:=n1/2 vertices in each of the four parts. Our idea is to encode some edges and non-edges of this graph via certain segments. First, we associate specific points on the previously defined segments sAB,sBA,sCD,sDC with certain pairs (x,y)[k]2. We will then represent certain edges and non-edges of G with the help of these points.

Figure 6: Left: the segments sAB,sBA,sCD,sDC. Any segment connecting a left and right segment among them has angle at least ϕ with them. Right: placing the points pAB(a,b) along sAB.

Consider first the segment sAB. For each (a,b)[k]2 let pAB(a,b) be the point of sAB at distance |sAB|(a1k+bτk2) from v1, where |sAB| denotes the length of sAB, and τ2 is a constant we can choose freely; for now, we can set τ=2. Similarly, for each (b,a)[k]2 we set pBA(b,a) to be the point of sBA at distance |sBA|(b1k+aτk2) from v3 . Define the points pCD(c,d), pDC(d,c) along the segments sCD,sDC analogously.

In each part VX of G, X{A,B,C,D}, we index the vertices from 1 to k, i.e., VX={v1X,,vkX}. We drop the superscripts of the vertices when they can be inferred from the context. Let {X,Y} be distinct symbols among {A,B,C,D}. The pair {X,Y} is considered a crossing pair if {X,Y} has a non-empty intersection with both {A,B} and {C,D}.

Let G be the intersection graph of the following segments (see Figure 7):

  • For each edge (va,vb)E(G)(VA×VB) add the segment tAB(a,b) with endpoints pAB(a,b),pBA(b,a). We call these segments left segments.

  • For each edge (vc,vd)E(G)(VC×VD) add the triangle tCD(c,d) with endpoints pCD(c,d),pDC(d,c). We call these segments right segments.

  • For each crossing pair {X,Y} with XX{AB,BA} and YY{CD,DC} and each non-edge (vx,vy)(VX×VY)E(G) add a segment hXY(x,y) as defined in Lemma 23 below. We call these segments crossing segments.

  • Add the four sides of the square with vertices (3,0),(0,3),(3,0),(0,3) as well as its vertical diagonal from (0,3) to (0,3). These five segments are called dummy segments.

The crossing segments are guaranteed due to the following lemma.

Lemma 23.

For each crossing pair {X,Y} with XX{AB,BA} and YY{CD,DC} and each (x,y)[k]2 there exists a segment hXY(x,y) that intersects the segment tXX(x~,x) (resp., tYY(y~,y)) if and only if x=x~ (resp., y=y~).

Figure 7: (i) The construction with segments, with dummy segments in light blue. The segment hAD(a,d) (green) corresponding to a crossing pair is lengthened beyond pAB(a,k) to cross all segments tAB(a,b) for all b[k]. (ii) Any segment tAB(a,b) has angle at least ψ=v3v1v2 with both sAB and sBA. (iii) The two ends of the segment hAD(a,d) (the middle of this picture is distorted). Segment hAD(a,d) crosses the quadrilateral Qa (orange, left) to ensure that it intersects all segments tAB(a,b) for all b[k]. The angle of hAD(a,d) with the segment pAB(a,1)v4 is bounded by a constant, thus its endpoint stays inside the circle. By setting τ large enough, we ensure that hAD(a,d) does not intersect any segment tAB(a,b) where aa.

We are now ready to prove our lower bound for segment intersection graphs.

Theorem 24.

Assuming the combinatorial 4-clique hypothesis, there is no O(n2ε) time combinatorial algorithm for deciding if the intersection graph of a given set of n segments in the plane has diameter at most 2.

Proof.

Consider a pair of edges (a,b)VA×VB and (c,d)VC×VD. We claim that tAB(a,b) and tCD(c,d) have hop distance at least 3 in the constructed intersection graph if and only if (a,b,c,d) is a 4-clique in G. Indeed, they have hop distance at least 3 if and only if there is no cross-edge hXY connecting them. Since the segments hXY are defined for non-edges, this is equivalent to saying that all of the edges ac,ad,bc,bd are in G, thus (a,b,c,d) is a 4-clique.

It remains to show that no other pair of segments can have hop distance at least 3 in the constructed intersection graph. Indeed, one can verify that unless s is a left segment and s is a right segment (or vice versa), there is always a dummy segment that is a shared neighbor of s and s. The construction takes linear time, thus the theorem follows.

References

  • [1] Amir Abboud, Arturs Backurs, and Virginia Vassilevska Williams. If the current clique algorithms are optimal, so is Valiant’s parser. In 56th Annual IEEE Symposium on Foundations of Computer Science, pages 98–117, 2015. doi:10.1109/FOCS.2015.16.
  • [2] P. K. Agarwal, M. Sharir, and E. Welzl. The discrete 2-center problem. Discrete & Computational Geometry, 20(3):287–305, 1998. doi:10.1007/pl00009387.
  • [3] Pankaj K. Agarwal and Jeff Erickson. Geometric range searching and its relatives. In B. Chazelle, J. E. Goodman, and R. Pollack, editors, Advances in Discrete and Computational Geometry, pages 1–56. AMS Press, 1999.
  • [4] Karl Bringmann, Sándor Kisfaludi-Bak, Marvin Künnemann, André Nusser, and Zahra Parsaeian. Towards sub-quadratic diameter computation in geometric intersection graphs. In 38th International Symposium on Computational Geometry (SoCG), pages 21:1–21:16, 2022. doi:10.4230/LIPIcs.SOCG.2022.21.
  • [5] Sergio Cabello. Subquadratic algorithms for the diameter and the sum of pairwise distances in planar graphs. ACM Transactions on Algorithms, 15(2):1–38, December 2018. doi:10.1145/3218821.
  • [6] Sergio Cabello and Christian Knauer. Algorithms for graphs of bounded treewidth via orthogonal range searching. Computational Geometry, 42(9):815–824, 2009. doi:10.1016/j.comgeo.2009.02.001.
  • [7] Timothy M. Chan. A (slightly) faster algorithm for Klee’s measure problem. In 24th Annual Symposium on Computational Geometry, pages 94–100, 2008. doi:10.1145/1377676.1377693.
  • [8] Timothy M. Chan, Hsien-Chih Chang, Jie Gao, Sándor Kisfaludi-Bak, Hung Le, and Da Wei Zheng. Charting the diameter computation landscape of geometric intersection graphs in three dimensions and higher. CoRR, abs/2603.21790, 2026. doi:10.48550/arXiv.2603.21790.
  • [9] Timothy M. Chan, Hsien-Chih Chang, Jie Gao, Sándor Kisfaludi-Bak, Hung Le, and Da Wei Zheng. Truly subquadratic time algorithms for diameter and related problems in graphs of bounded VC-dimension. In 66th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pages 2728–2765, 2025. doi:10.48550/arXiv.2510.16346.
  • [10] Timothy M. Chan and Da Wei Zheng. Hopcroft’s problem, log* shaving, two-dimensional fractional cascading, and decision trees. ACM Trans. Algorithms, 20(3):24, 2024. doi:10.1145/3591357.
  • [11] Hsien-Chih Chang, Jie Gao, and Hung Le. Computing diameter+2 in truly-subquadratic time for unit-disk graphs. In 40th International Symposium on Computational Geometry (SoCG), pages 38:1–38:14, 2024. Arxiv version https://arxiv.org/abs/2401.12881. doi:10.4230/LIPIcs.SoCG.2024.38.
  • [12] Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry: Algorithms and Applications. Springer, 3rd edition, 2008. doi:10.1007/978-3-540-77974-2.
  • [13] Guillaume Ducoffe, Michel Habib, and Laurent Viennot. Diameter computation on h-minor free graphs and graphs of bounded (distance) VC-dimension. In 30th ACM-SIAM Symposium on Discrete Algorithms (SODA), Proceedings, pages 1905–1922. Society for Industrial and Applied Mathematics, 2019.
  • [14] Lech Duraj, Filip Konieczny, and Krzysztof Potępa. Better diameter algorithms for bounded VC-dimension graphs and geometric intersection graphs. In 32nd Annual European Symposium on Algorithms (ESA), volume 308, pages 51:1–51:18, 2024. doi:10.4230/LIPIcs.ESA.2024.51.
  • [15] Radoslav Fulek and Jan Kyncl. Hanani-Tutte for approximating maps of graphs. In Proc. 34th International Symposium on Computational Geometry (SoCG), volume 99 of LIPIcs, pages 39:1–39:15, 2018. See full version at https://www.arxiv.org/pdf/1705.05243v3. doi:10.4230/LIPIcs.SOCG.2018.39.
  • [16] Paweł Gawrychowski, Haim Kaplan, Shay Mozes, Micha Sharir, and Oren Weimann. Voronoi diagrams on planar graphs, and computing the diameter in deterministic O~(n5/3) time. SIAM Journal on Computing, 50(2):509–554, 2021. doi:10.1137/18M1193402.
  • [17] Russell Impagliazzo and Ramamohan Paturi. On the complexity of k-SAT. J. Comput. Syst. Sci., pages 367–375, 2001. doi:10.1006/JCSS.2000.1727.
  • [18] Hung Le and Christian Wulff-Nilsen. VC set systems in minor-free (di)graphs and applications. In 35th Annual ACM-SIAM Symposium on Discrete Algorithms (SODA), pages 5332–5360, 2024. doi:10.1137/1.9781611977912.192.
  • [19] Andrea Lincoln, Virginia Vassilevska Williams, and Ryan Williams. Tight hardness for shortest cycles and paths in sparse graphs. In 29th Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1236–1252, 2018.
  • [20] Liam Roditty and Virginia Vassilevska Williams. Fast approximation algorithms for the diameter and radius of sparse graphs. In 45th Annual ACM Symposium on Theory of Computing (STOC), pages 515–524, 2013. doi:10.1145/2488608.2488673.
  • [21] Vladimir N. Vapnik. Statistical Learning Theory. Wiley-Interscience, 1998.
  • [22] Ryan Williams. A new algorithm for optimal 2-constraint satisfaction and its implications. Theor. Comput. Sci., pages 357–365, 2005. doi:10.1016/J.TCS.2005.09.023.