An Algorithm for Single-Source Shortest Paths in Disk Graphs
Abstract
We prove that the single-source shortest-path problem on disk graphs can be solved in expected time, and that it can be solved on intersection graphs of fat triangles in time.
Keywords and phrases:
shortest path, geometric intersection graph, disk graph, fat trianglesFunding:
Mark de Berg: Supported by the Dutch Research Council (NWO) through Gravitation-grant NETWORKS-024.002.003.Copyright and License:
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithmsEditors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz HermanSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl β Leibniz-Zentrum fΓΌr Informatik
1 Introduction
Finding shortest paths in graphs is a classic topic covered in all basic courses and textbooks on algorithms. In the most basic setting, which is the setting we consider here, the graph is unweighted and the length of a path refers to the number of edges in the path. In the single-source shortest-path (SSSP) problem, the task is to compute shortest paths from a given vertex, the source, to all other vertices of the graph. The solution is represented using a so-called shortest-path tree.
The SSSP problem for a graph with vertices and edges can be solved in time by breadth-first search, which is optimal if the graph is given as a collection of vertices and edges. In this paper we will consider the SSSP problem for implicitly defined graphs. In particular, we consider (planar) intersection graphs: graphs whose node set corresponds to a set of objects in the plane and that contain an edge between two distinct objects iff and intersect. If the objects in are disks then the intersection graph, which we denote by , is called a disk graph β see Figure 1 β and if all disks have unit radius then it is called a unit-disk graph. Disk graphs are arguably the most popular and widely studied intersection graphs. One can solve the SSSP problem on intersection graphs by first constructing explicitly and then running breadth-first search. In the worst case, however, this requires time. This raises the question: is it possible to solve the SSSP problem on intersection graphs in subquadratic time in the worst case?
Given the basic nature of the SSSP problem and the prominence of (unit-)disk graphs, it is not surprising that this question has already been considered for such graphs. For unit disks, Roditty and Segal [24] noticed that the dynamic data structure of Chan [6] for nearest-neighbor queries can be used to solve the problem in expected time. Cabello and JejΔiΔ [4] gave an algorithm and showed that this is asymptotically optimal in the algebraic decision-tree model. They remarked that Efrat noted that the semi-dynamic data structure of Efrat, Itai and Katz [14] also gives an algorithm with running time . Finally, Chan and Skrepetos [8] provided a simpler algorithm. The above algorithms either use Delaunay triangulations [4] or fixed-resolution grids [8, 14]; these approaches are not applicable for disks of arbitrarily different sizes.
For arbitrary disks graphs, Kaplan et al. [20] and Liu [22] presented algorithms running in time. This was recently improved by Klost [21], who presented a general framework for solving SSSP problems in intersection graphs. She used the framework to obtain an algorithm for the SSSP problem on disk graphs, and to obtain an algorithm for intersection graphs of axis-aligned squares.
Our results.
Our main result in this paper is an algorithm for the SSSP problem in disk graphs that runs in expected time. We obtain this result using a version of the framework proposed by Klost [21]; our specialized framework and its relation to Klostβs framework are discussed in detail in Section 2. A core ingredient in the framework is a clique-based contraction of the intersection graph : a graph obtained from by contracting certain cliques to single nodes. To compute such a clique-based contraction in time, we combine shifted quadtrees [5] and skip quadtrees [15] β powerful and beautiful concepts that we believe deserve more attention β with standard techniques for stabbing fat objects.
Our algorithm for computing a clique-based contraction not only applies to disk graphs but also to intersection graphs of fat triangles, that is, triangles all of whose internal angles are lower bounded by a fixed constant [2]. By combining this with a novel intersecting-detection data structure for fat triangles, we obtain an algorithm for the SSSP problem on intersection graphs of fat triangles. We are not aware of previous work on the SSSP problem for fat triangles. The all-pairs shortest-path (APSP) problem, however, has been considered for fat triangles, by Chan and Skrepetos [9]. The algorithm they present runs in time, under the condition that the fat triangles have roughly the same size. (They also present an algorithm for the APSP problem for arbitrary disk graphs, and an algorithm for unit-disk graphs [8].) Running our new SSSP algorithm times, once for each input triangle as the source, we obtain an APSP algorithm for arbitrarily-sized fat triangles that runs in time. This is faster and more general than the algorithm of Chan and Skrepetos. (The improvement for the APSP problem is mainly because of our new intersection-detection data structure for fat triangles; using this data structures in the existing algorithm [9] would also give an algorithm.)
In the full version of this work [11] we provide two enhancements: we obtain a deterministic algorithm for the SSSP problem in disk graphs and we reduce the running time for the SSSP problem on intersection graphs of fat triangles to . The basic structure of the algorithms is the same as here, but we improve some of the subroutines that we use.
On the model of computation.
We use the real-RAM model β this is the standard model in computational geometry, which allows us for example to check in time if two disks intersect β extended with an additional operation that allows us to compute a compressed quadtree on a set of points in time. This extension is common when working with quadtrees; see the book by Har-Peled [19].
2 The framework
Our framework for computing a shortest-path tree on an intersection graph is an instantiation of the framework of Klost [21]. We describe it in detail to keep the paper self-contained and make the required subroutines explicit; at the end of this section we discuss the correspondence of our approach to that of Klost. For convenience, we will from now on not distinguish between the objects in the set and the corresponding nodes in .
Let be the given source node, and let be the shortest-path tree of that we want to compute for the given source. For an object , let be the distance from to in , and let . Thus, is the set of nodes at level in . We follow the natural approach of computing level by level. To be able to go from one level to the next, we need a subroutine for the following problem.
Bichromatic Intersection Testing. Given a set of blue objects and a set of red objects, report the blue objects that intersect at least one red object, and for each reported blue object, report a witness (a red object intersecting it).
A subroutine BIT-Subroutine that solves Bichromatic Intersection Testing allows us to compute by setting and , where is a set of candidate objects that should contain all objects from and no objects from , where . We could simply set , but this will not be efficient; we must keep the total size of the candidates sets over all levels under control. We do this using a so-called clique-based contraction, as defined next.
Let be an (undirected) graph. We say that a graph is a clique-based contraction of if
-
each node corresponds to a clique in and the cliques in form a partition111In our application, it would also be sufficient to require that each node in appears in cliques, but we do not need this extra flexibility. of the nodes in ;
-
there is an edge iff there are nodes and such that .
Note that for each edge there exists a clique that contains both and , or there are cliques and such that .
A clique-based contraction of the intersection graph helps us to find good candidate sets. To see this, let denote the set of cliques222With a slight abuse of terminology, we not only use the term clique to refer a complete graph, but also to refer to a set of geometric objects whose intersection graph is a clique. that contain at least one object from . Then any object must be part of a clique that is either in itself or that is a neighbor in of a clique in . In other words, if then for some clique , where denotes the closed neighborhood of in . Moreover, the objects in a clique are in at most two levels in the shortest-path three , which helps to control the total size of the candidate sets. The following pseudocode describes our framework in detail. It does not explicitly construct the shortest-path tree itself (it only constructs the levels), but this is easy to do using the witnesses reported by BIT-Subroutine.
We obtain the following theorem.
Theorem 1.
Let be a set of constant-complexity objects in the plane. Suppose that
-
(i)
we can compute a clique-based contraction for in time,
-
(ii)
for any two subsets we can solve Bichromatic Intersection Testing in time, where and .
Then we can compute a shortest-path tree in for a given source node in time.
Proof.
It is straightforward to prove by induction on that our algorithm correctly computes the levels of the shortest-path tree. To prove the bound on the running time, observe that Steps 1β3 take time. It remains to bound the runtime of the while-loop.
For a clique , let . Note that for objects in cliques that are neighbors in , we have . Hence, can only be in the candidate set in iterations of the while-loop where . Thus, if we denote the size of in iteration by , then the total time needed for Step 6 over all iterations is , where and . Since is at least linear in and (and at most quadratic), we have . This also bounds the total runtime of Steps 7β11 over all iterations.
To bound the total time for Step 5, note that a clique is only considered in iterations where . This implies that the total time to find the relevant cliques in Step 5 is . The total time to inspect those cliques in order to find the candidate sets, is . Thus, the total time for Step 5 over all iterations is , which can be bounded by .
Β Remark (relation to the framework of Klost).
The framework presented above is an instantiation of the framework of Klost [21]: she also computes the shortest-path tree level by level as described above β this natural approach was also taken by earlier papers on the SSSP problem on (unit-)disk graphs [4, 8, 9, 21] β and she also keeps the size of the candidate sets under control using an auxiliary graph. Klost uses a so-called shortcut graph as auxiliary graph. The nodes in correspond to the objects in , and the edge set is a superset of the edge set of such that for any edge we have that the distance between and in is . As is a superset of the edge set of , the size of can be quadratic, so needs to be constructed implicitly. Our clique-based contraction provides such an implicit shortcut graph, by defining and are part of the same clique in or of neighboring cliques.
3 The algorithm for disks
In this section we implement the framework presented above for the case where the input is a set of disks in the plane. We first explain how to create the cliques in our clique-based contraction of , and how to compute the edge set of . Using known results on Bichromatic Intersection Testing for disks we then obtain our final result.
Finding the cliques.
Our algorithm to create the set of cliques is related to a recent construction by Chan and Huang [7, Section 3] of 3-hop spanners for disk graphs; we comment more on the similarities and differences later. The construction is based on so-called shifted quadtrees, introduced by Chan [5], which we describe next.
We start by defining hierarchical grids, a concept closely related to quadtrees; the connection will be made clear below. Let be any point in the plane. A cell in the hierarchical grid centered at is any square of the form
for integers . Note that is a translation of the square by the vector , and that the set forms a regular grid. Moreover, the grid is a refinement of the grid , obtained by partitioning each cell of into four quadrants. We define the hierarchical grid centered at , denoted by , to be the (infinite) collection of nested grids.
Define the size of any object , denoted by , to be the side length of a smallest enclosing (axis-parallel) square of . Thus for any cell . We say that an object is -aligned with a hierarchical grid , for a given constant , if there exists a cell in such that and . Note that whether or not is -aligned with only depends on the choice of the center of the hierarchical grid. The definition of being -aligned trivially implies the following.
Observation 2.
Let be an object that is -aligned with a hierarchical grid , and let be a cell of such that intersects the boundary of . Then .
Let be a finite set of objects. In general, it is impossible to choose the center of a hierarchical grid such that each object is -aligned with . However, Chan [5] has shown that, surprisingly, it is possible to pick a small number of different centers such that each object is -aligned with at least one of the resulting hierarchical grids, for a suitable constant . Even more surprisingly, we can select these centers independently of . The following lemma follows directly from Lemma 3.2 in Chanβs paper.333Chan uses the term shifted quadtree in his lemma. To stress the fact that the shifts are independent of any input set on which one might build a quadtree, we prefer to use the term hierarchical grid.
Lemma 3 ([5]).
There is a collection of three hierarchical grids, each centered at a different point, with the following property: for any object contained in the square there is a hierarchical grid such that is 6-aligned with .
Let be a set of points, let be a hierarchical grid centered at a given center , and let be a cell of that contains . Then we can construct a quadtree on β see Figure 2(i) β whose root node corresponds to . Any node in this quadtree corresponds to a cell of . Let be the corresponding compressed quadtree [19]. Each internal node of corresponds to a cell of and each leaf node corresponds to a region that is either a cell of or a donut cell; see Figure 2(ii). (A donut cell is the difference of two cells and of with .) The subdivision defined by the compressed quadtree is the set of regions corresponding to the leaves of ; this subdivision is a decomposition of .
Our algorithm to efficiently compute the cliques in the clique-based contraction combines the hierarchical grids of Lemma 3 with skip quadtrees [15], as explained next.
Skip quadtrees, defined by Eppstein, Goodrich, and Sun [15] are defined as follows. Let be a set of points inside a given starting cell of a hierarchical grid . We start by sorting the points in in Z-order, as follows. First, order the points according to the quadrants from they fall in: put the points in the nw-quadrant first, then those in the ne-quadrant, then those in the sw-quadrant, and finally those in the se-quadrant. Next, recursively sort the points in each quadrant. Let be the resulting sorted list of points; see Figure 2(iii). We now create a sequence , where is obtained from by deleting every other element (starting with the first element) and . From the sequence we construct a sequence of compressed-quadtree subdivisions , each based on the same starting cell . The sequence has the following properties, as illustrated in Figure 3:
-
is equal to the square .
-
is a refinement of for all , that is, each region in is contained in a unique region in . Moreover, each region in contains regions from .
-
Each region in contains at most one point from .
We can view as the levels of a tree , where a node at level corresponds to a region of the subdivision . In particular, the root of corresponds to the starting square and the leaves of correspond to the regions in (which is the compressed-quadtree subdivision for the whole point set with root ). We call this tree structure444The skip quadtree defined by Eppstein, Goodrich, and Sun is slightly more complicated, as it stores more information than just the compressed-quadtree subdivisions. Since we do not need our structure to be dynamic, the simple hierarchy described above suffices. a skip quadtree for with root . It can be constructed in time [15].
Without loss of generality, we will assume henceforth that all the disks of are fully contained in the unit square . Let be the collection of three hierarchical grids given by Lemma 3. Each disk of is -aligned with some hierarchical grid , and we can find such a hierarchical grid for in constant time.
Now consider a hierarchical grid from the collection . Let be the set of disks that are 6-aligned with , where we put a disk that is 6-aligned with multiple grids into an arbitrary one of the corresponding sets . We create a set of cliques, as follows.
-
1.
Construct a skip quadtree on the set of centers of the disks in , where the starting square of the skip quadtree is a cell of that contains all the disks in .
-
2.
For each disk , follow a path in consisting of nodes whose region contains the center of , until a node is reached such that intersects or a leaf is reached. Assign to that node or leaf.
-
3.
Let be the set of disks assigned to an (internal or leaf) node in . For each node , partition into a set of cliques, as follows. If is a leaf and contains a disk β note that a leaf can contain at most one disk β then we create a singleton clique for that disk. Now suppose is an internal node. First, suppose is a square region. Because the disks in are 6-aligned with , we know that for all intersecting . Hence, we can create a set of points such that each disk is stabbed by at least one of them, which we use to create . If is a donut we proceed similarly, where we treat the disks intersecting the boundary of the hole of the donut β this hole can be much smaller than the donut β separately from the disks that only intersect the outer boundary of the donut. Finally, set .
Each clique that is generated by our algorithm is a so-called stabbed clique, that is, for each clique there is a point stabbing all disks in . We refer to the union of all the disks in as a flower, which we denote by , and we let be the set of flowers corresponding to the cliques in . Define , the ply of a set of objects in the plane, to be the maximum, over all points , of the number of objects in containing . The following lemma states a property of our algorithm that will be crucial to efficiently compute the edges in the clique-based contraction.
Lemma 4.
The algorithm above constructs in time a partition of into a set of stabbed cliques such that .
Proof.
Step 1 of the algorithm, constructing the skip quadtree on the set of the centers of the at most disks in , can be done in time [15]. The depth of the skip quadtree is , and so Step 2 takes time per disk and time in total. Step 3 takes time, which is because each disk is assigned to exactly one node. Hence, the total time for the algorithm is .
To bound , consider an arbitrary point . Recall that for each node in we created stabbed cliques and, hence, flowers. Thus, it suffices to prove the following claim: at each level of the skip quadtree there are only nodes such that for some disk assigned to . To prove this claim, follow the search path of in , that is, the path consisting of nodes such that . Let be a disk that contains , let be the node to which is assigned, and let be the parent of . Then must lie on the search path of . Indeed, is fully contained in β otherwise would have been assigned to β and so . Since any node in a skip quadtree has children, this implies the claim.
Β Remark (relation to the spanner construction of Chan and Huang).
In their algorithm for constructing a 3-hop spanner for , Chan and Huang [7] create a collection of cliques in a similar way as we create our cliques. As they are only concerned with the size of the spanner, however, they do not analyze the time needed to construct it. The differences between our approach and theirs mainly stem from the necessity to construct the clique-based contraction in time, as discussed next.
A first difference is that Chan and Huang use a centroid decomposition of a compressed quadtree instead of a skip quadtree. This is not a crucial difference β possibly we could have used a centroid decomposition as well, although working with a skip quadtree is more convenient. Another difference is that they work with a collection of hierarchical grids β they call them shifted quadtrees β such that, for each pair , there is at least one hierarchical grid such that both and are aligned with . This allows them to construct their spanner by applying the following procedure to each quadtree defined by the hierarchical grid : (i) take a centroid node in a compressed quadtree and partition the set of disks intersecting into cliques, (ii) for each clique , add a star graph on that clique to the spanner, (iii) for each disk and each clique intersected by , add an edge to the spanner, where is an arbitrary disk intersected by , and (iv) recursively construct 3-hop spanners for the disks inside and outside . The crucial difference lies in step (iii), where they add an edge from every disk to a neighboring disk in each clique (if such a neighboring disk exists). It seems difficult to do this in time in total over all recursive calls. We therefore proceed differently: we first recursively construct cliques on the disks not intersecting , and then we only add a single edge between two cliques if the corresponding flowers intersect. Such an approach would increase the spanning ratio if we were to use it to construct a spanner, but this is of no concern to us. The advantage of being more conservative is that we can compute the edges in our clique-based contraction in time, as explained next.
Computing the edges in the clique-based contraction.
Let be the set of cliques generated by applying the procedure above to each hierarchical grid in the collection given by Lemma 3. Let be the corresponding flower set. Note that by Lemma 3. To construct the edge set of the clique-based contraction , we must find all pairs that intersect. Next we show how to do this in time.
Consider a flower defined by some clique . The boundary of is comprised of maximal pieces of the boundaries of the disks in that show up on . We call these pieces boundary arcs and we denote the set of boundary arcs of a flower by . For a set of flowers, we define to be the set of boundary arcs of the flowers in .
Lemma 5.
Let be a set of flowers that consist of disks in total. Then the number of intersections between the boundary arcs in is .
Proof.
First, observe that , where is the number of disks defining a flower , since the union of a set of disks has linear complexity. Hence, .
Now consider a boundary arc of some flower . We assume for simplicity that the angle spanned by the circular arc is at most ; if this is not the case we can split into at most four sub-arcs, and work with the sub-arcs instead. Let be the disk that contributes the arc , let be the center of , and let and be the segments that connect to the endpoints of . Together with , these two segments bound a (convex) circular sector. Let be the set of such circular sectors created for the arcs in ; see Figure 4(i).
We say that two sectors are non-overlapping if their interiors are disjoint.
Claim 0.
The sectors in the set are pairwise non-overlapping.
Proof.
Consider two sectors . Let be the disks whose boundaries define and , respectively, and let and be their centers. If then obviously and do not overlap, so assume that . Since a sector in cannot be fully contained in another sector in by construction, the sectors can only overlap if there is a proper intersection between their boundaries. Such an intersection can only happen between a segment connecting to an endpoint of some boundary arc and a segment connecting to an endpoint of some boundary arc . But then, by the triangular inequality, either or β see Figure 4(ii) for an illustration β contradicting that and are both points on . Now consider a circular sector , defined by some arc . Let be the apex of (which coincides with the center of the disk contributing ). If the angle at apex is large enough then is fat, but if the angle is very small then this is not the case. We therefore proceed as follows: we move the apex towards the midpoint of until the angle at is slightly larger than ; see Figure 4(iii). It is easy to see that the modified region (which is no longer a circular sector) is fat and convex. Moreover, no two modified regions share an apex anymore. With a slight abuse of notation, from now on we use to denote the set of modified regions created for a flower .
Let . Note that and that ; the latter is true since the regions created for a single flower are pairwise disjoint except at shared endpoints of boundary arcs. For each arc , there is a region such that . Hence, the number of intersections between the arcs in is upper bounded by the number of intersections between the regions in .
Claim 0.
The number of intersections between the regions in is .
Proof.
The proof is standard, but we sketch it for completeness. We charge the intersection between two regions to the smaller of the two regions, and claim that each region is charged times. To see this, consider a region and let be the smallest enclosing disk of . Let be the disk with the same center as such that . Due to the fatness of the regions in , any region that intersects and is at least as large as , will cover a constant fraction of the area of . Hence, there can be at most such regions . This finishes the proof. Observe that two flowers intersect iff the following holds: a boundary arc of intersects a boundary arc of , or , or . Thus we can find all intersecting pairs of flowers β and, hence, all edges of the clique-based contraction β as follows. (The algorithm below may report a pair of intersecting flowers multiple times, but this is not a problem.)
First, we construct the arrangement induced by the flower set . Next, for each vertex of that is the intersection of the boundaries of some pair of flowers , we report that pair. Finally, we need to find the pairs of flowers such that . To this end, we traverse the dual graph of , maintaining a list of flowers containing the face we are currently in. Whenever we enter a flower for the first time, we report the pairs for the faces that are currently in the list .
We obtain the following lemma.
Lemma 6.
Let be a set of disks in the plane. Then we can compute a clique-based contraction for in expected time.
Proof.
Computing the collection of cliques takes time by Lemma 3. It remains to analyze the time needed to compute the edge set of the clique-based contraction.
For each clique , we can compute the corresponding flower in time using a simple divide-and-conquer algorithm. Since each disk is part of only clique, this implies that the flower set can be computed in time. Moreover, the total number of boundary arcs of the flowers is because the complexity of a single flower is linear. Hence, we can construct the arrangement in expected555We cannot use the deterministic algorithm for line-segment intersection by Chazelle and Edelsbrunner [10] because it does not work for curves. The deterministic algorithm for line-segment intersection by Balaban [3] also works for curves, but that algorithm does not seem to give enough information to construct the arrangement. time, where is the number of intersections between the boundary arcs, using a randomized incremental algorithm by Mulmuley [23]. Since by Lemmas 3 and 3, constructing the arrangement thus takes expected time. The traversal of the dual graph, including the maintenance of takes time. Since the size of the list is at any time β this is because the ply of the flower set is β we report at most pairs in total during the traversal. Thus, the total time to compute is .
Putting it all together.
Lemma 3 gives us the first ingredient we need to apply Theorem 1. The second ingredient is an algorithm that solves Bichromatic Intersection Testing for disks. As observed in previous papers [9, 21] this can be done in time, as follows. First, compute the additively weighted Voronoi diagram on the centers of the set of red disks, where the weight of a center is equal to the radius of its corresponding disk. Next, query with the center of each blue disk in to find the red disk closest to . Now intersects , the union of the red disks, iff intersects . Since can be computed in time [17], after which it can be preprocessed for logarithmic-time point location in time [13], we can solve Bichromatic Intersection Testing in time. We thus obtain our main result.
Theorem 7.
Let be a set of disks in the plane. Then we can compute a shortest-path tree in for a given source disk in expected time.
4 Extension to fat triangles
A triangle is called -fat if its minimum angle is at least . Let be a set of -fat triangles, where is some fixed absolute constant. From now on, we simply refer to the triangles in as fat triangles and we refer to as the fatness constant.
Constructing the clique-based contraction.
Our approach to construct a clique-based contraction for fat triangles is similar to the algorithm for disks. We now go over the various ingredients and explain how to adapt them, if necessary.
We first observe that Lemma 3.2 from Chanβs paper [5] actually holds for any type of objects. Hence, our Lemma 3 also holds for any type of objects. To construct the skip quadtree, the set of disk centers is replaced by a set that contains an arbitrary point in each object. Constructing the cliques can therefore be done in exactly the same way as before. Indeed, the crucial property was as follows: any set of disks intersecting the boundary of a region and whose size is at least , can be stabbed by points. This property also holds for fat objects.
Now let be a stabbed clique of fat triangles. We refer to the union of the triangles in as a spiky flower, and we denote it by . As before, we let denote the set of cliques created by our algorithm, and we define to be the corresponding set of spiky flowers. Then Lemma 3 also holds for fat triangles β we can follow the proof verbatim, only replacing occurrences of βdiskβ by βfat triangle.β
It remains to prove the equivalent of Lemma 3 for fat triangles. To keep the terminology similar to the case of disks, we will refer to the edges of a spiky flower as boundary segments, and we denote the set of boundary segments of a flower by . Furthermore, we let denote the set of spiky flowers created by our algorithm, and we define .
Lemma 8.
Let be a set of spiky flowers that consist of fat triangles in total. Then the number of intersections between the boundary segments in is .
Proof.
We apply the same proof technique as in the proof of Lemma 3: we cover the boundary segments of each spiky flower by a set of non-overlapping fat βsectorsβ contained in the flower, as explained below, from which the lemma follows.
The number of boundary segments of a spiky flower is , where is the number of triangles defining [1, Section 3.2]. We create the set for a spiky flower as follows. For each boundary segment of , we create an isosceles triangle whose angles at the endpoints of are , where is the fatness constant of the triangles; see Figure 5.
With a slight abuse of terminology, we refer to these isosceles triangles as sectors.
Claim 0.
The sectors in the set are pairwise non-overlapping.
Proof.
Each sector has one edge that corresponds to a boundary segment of ; we call this the external edge of . The two other edges, which make an angle with the external edge, are called internal edges.
Now assume for a contradiction that two sectors overlap. Since the external edge of any sector cannot properly intersect an (external or internal) edge of any other sector, there must be a crossing between an internal edge of and an internal edge of . Let be this crossing, and let and be the external edges of and , respectively; see Figure 5(ii). Assume without loss of generality that the distance from to is at least the distance from to . Let be the point on nearest to , and let be the disk centered at and touching . Then is contained in . Moreover, is contained in the triangle contributing to the boundary of the spiky flower . Indeed, if we were to expand the sector by making the angles at the endpoints of equal to then , and this expanded sector is contained in . Thus, , which contradicts that lies on an external edge. As in the proof of Lemma 3, it now follows that the number of intersections between the sectors in is , which proves the lemma. As before, we have the following corollary. Its proof is the same as the proof of Lemma 3; the only difference is that we can now use the algorithm by Chazelle and Edelsbrunner [10] to construct the arrangement defined by the flowers, thus avoiding the use of randomization.
Corollary 9.
Let be a set of fat triangles in the plane. Then we can compute a clique-based contraction for in time.
Bichromatic Intersection Testing for fat triangles.
The final ingredient that we need is an efficient algorithm for Bichromatic Intersection Testing for a set of blue triangles and a set of red triangles, where all triangles in are fat. Such an algorithm can be developed using standard machinery, as described next.
Let be a set of canonical directions, where is the fatness constant of the triangles. Define a canonical segment to be a segment whose direction is canonical, and define a canonical chord of a fat triangle to be a canonical segment that connects a vertex of to its opposite side; see Figure 6(i).
Note that each vertex of admits a canonical chord. Let be a set of three canonical chords of , one per vertex of , and let be the endpoints of these chords (including the vertices of ).
Observation 10.
If a fat triangle intersects a fat triangle then at least one of the following conditions holds:
-
(i)
contains a vertex of ;
-
(ii)
a point from lies inside ;
-
(iii)
a canonical chord from intersects a canonical chord from .
Proof.
Suppose that condition (ii) does not hold. Then there is a canonical chord that intersects two edges of , or all canonical chords in are disjoint from . In the former case, separates a vertex of from its opposite side, which implies that intersects the canonical chord of ; see Figure 6(ii). Thus, condition (iii) holds in this case. In the latter case, must have a vertex inside and condition (i) holds; see Figure 6(iii). Observation 4 implies the following lemma.
Lemma 11.
Let be a set of fat triangles. There exists a data structure of size such that we can decide in time if a fat query triangle intersects any triangle in and, if so, report a witness triangle. The data structure can be built in time.
Proof.
The data structure consists of three separate data structures, each handling one of the conditions in Observation 4.
For condition (i) we need a data structure for range searching with fat triangles in a set of points, namely the vertices of the triangles in . As observed by Gray [18, page 14], such queries can be answered in time with a structure of size that can be built in time.
For condition (ii) we use a union tree on the triangles in . This is a binary tree whose leaves correspond to the triangles in , and whose internal nodes store the union of the triangles in their subtree, preprocessed for point-location queries. Checking if a query point is contained in any triangle in can be done in by performing a point location at the root of . If this is the case, then we can find a witness triangle in time by walking down , always proceeding to a child whose union contains . Since the union complexity of fat triangles is [2], the total amount of storage is . Note that the union at a node can be computed in time from the unions of its two children by a simple plane-sweep algorithm, where is the number of triangles in the subtree of . Hence, the total preprocessing time is .
To handle condition (iii) we proceed as follows. Let be the set of canonical chords of the triangles in . We will build different data structures on , one for each of the possible directions of the query chord. To construct a data structure for a fixed direction of the query chord, we partition into classes, one for each canonical direction in , and we build a separate substructure for each class . Assume wlog that the query chord is vertical and that the chords in are horizontal. Then we can use an interval tree [12, Section 10.1] to answer queries in , using space and preprocessing. (Using a point-location structure on the vertical decomposition of the chords in is another option.) Thus the total amount of storage is , the total preprocessing is , and the total query time is .
Since all data structure work within the claimed bounds, the lemma follows. We can now solve Bichromatic Intersection Testing for fat triangles in time, by querying with each triangle in the data structure provided by Lemma 4. This leads to the following theorem.
Theorem 12.
Let be a set of fat triangles in the plane. Then we can compute a shortest-path tree in for a given source triangle in time.
In the full version [11] we provide a better data structure for the range-query problem considered in Lemma 4: its construction time is and each query is then answered in time. Using this data structure, we obtain an algorithm to compute shortest-path trees on the intersection graph of fat triangles.
5 Concluding remarks
We presented the first algorithm for the SSSP problem in disk graphs that runs in (expected) time. We extended the algorithm to intersection graphs of fat triangles, where we obtain a worst-case running time of . In the full version [11] we provide a deterministic algorithm for the SSSP problem in disk graphs and improve the running time for intersection graphs of fat triangles to .
A natural question is whether the algorithm for fat triangles can be further improved. Another natural question is whether an algorithm is possible for intersection graphs of non-fat objects such as line segments. This is unlikely, however, because Hopcroftβs problem β given a set of lines and a set of points, decide if any of the points lies on any of the lines β can be reduced to the SSSP problem for segments, and Hopcroftβs problem has an lower bound [16] in a somewhat restricted model of computation.
References
- [1] Pankaj K. Agarwal, Matthew J. Katz, and Micha Sharir. Computing depth orders for fat objects and related problems. Comput. Geom., 5:187β206, 1995. doi:10.1016/0925-7721(95)00005-8.
- [2] Boris Aronov, Mark de Berg, Esther Ezra, and Micha Sharir. Improved bounds for the union of locally fat objects in the plane. SIAM J. Comput., 43(2):543β572, 2014. doi:10.1137/120891241.
- [3] Ivan J. Balaban. An optimal algorithm for finding segments intersections. In Proc. 11th Symposium on Computational Geometry (SoCG), pages 211β219, 1995. doi:10.1145/220279.220302.
- [4] Sergio Cabello and Miha JejΔiΔ. Shortest paths in intersection graphs of unit disks. Comput. Geom., 48(4):360β367, 2015. doi:10.1016/j.comgeo.2014.12.003.
- [5] Timothy M. Chan. Polynomial-time approximation schemes for packing and piercing fat objects. J. Algorithms, 46(2):178β189, 2003. doi:10.1016/S0196-6774(02)00294-8.
- [6] Timothy M. Chan. A dynamic data structure for 3-d convex hulls and 2-d nearest neighbor queries. J. ACM, 57(3):16:1β16:15, 2010. doi:10.1145/1706591.1706596.
- [7] Timothy M. Chan and Zhengcheng Huang. Constant-hop spanners for more geometric intersection graphs, with even smaller size. In Proc. 39th International Symposium on Computational Geometry (SoCG), volume 258 of LIPIcs, pages 23:1β23:16, 2023. doi:10.4230/LIPICS.SoCG.2023.23.
- [8] Timothy M. Chan and Dimitrios Skrepetos. All-pairs shortest paths in unit-disk graphs in slightly subquadratic time. In Seok-Hee Hong, editor, Proc. 27th International Symposium on Algorithms and Computation (ISAAC), volume 64 of LIPIcs, pages 24:1β24:13, 2016. doi:10.4230/LIPICS.ISAAC.2016.24.
- [9] Timothy M. Chan and Dimitrios Skrepetos. All-pairs shortest paths in geometric intersection graphs. J. Comput. Geom., 10(1):27β41, 2019. doi:10.20382/JOCG.V10I1A2.
- [10] Bernard Chazelle and Herbert Edelsbrunner. An optimal algorithm for intersecting line segments in the plane. J. ACM, 39(1):1β54, 1992. doi:10.1145/147508.147511.
- [11] Mark de Berg and Sergio Cabello. An algorithm for single-source shortest paths in disk graphs, 2025. doi:10.48550/arXiv.2506.07571.
- [12] Mark de Berg, Otfried Cheong, Marc J. van Kreveld, and Mark H. Overmars. Computational Geometry: Algorithms and Applications (3rd Edition). Springer, 2008. doi:10.1007/978-3-540-77974-2.
- [13] Herbert Edelsbrunner, Leonidas J. Guibas, and Jorge Stolfi. Optimal point location in a monotone subdivision. SIAM J. Comput., 15(2):317β340, 1986. doi:10.1137/0215023.
- [14] Alon Efrat, Alon Itai, and Matthew J. Katz. Geometry helps in bottleneck matching and related problems. Algorithmica, 31(1):1β28, 2001. doi:10.1007/S00453-001-0016-8.
- [15] David Eppstein, Michael T. Goodrich, and Jonathan Z. Sun. Skip quadtrees: Dynamic data structures for multidimensional point sets. Int. J. Comput. Geom. Appl., 18:131β160, 2008. doi:10.1142/S0218195908002568.
- [16] Jeff Erickson. New lower bounds for Hopcroftβs problem. Discret. Comput. Geom., 16(4):389β418, 1996. doi:10.1007/BF02712875.
- [17] Steven Fortune. A sweepline algorithm for Voronoi diagrams. Algorithmica, 2:153β174, 1987. doi:10.1007/BF01840357.
- [18] Chris Gray. Algorithms for Fat Objects: Decompositions and Applications. PhD thesis, TU Eindhoven, 2008. URL: https://pure.tue.nl/ws/portalfiles/portal/3256691/200811208.pdf.
- [19] Sariel Har-Peled. Geometric approximation algorithms, volume 173 of Mathematical Surveys and Monographs. American Mathematical Society, 2011. doi:10.1090/surv/173.
- [20] Haim Kaplan, Wolfgang Mulzer, Liam Roditty, Paul Seiferth, and Micha Sharir. Dynamic planar Voronoi diagrams for general distance functions and their algorithmic applications. Discret. Comput. Geom., 64(3):838β904, 2020. doi:10.1007/S00454-020-00243-7.
- [21] Katharina Klost. An algorithmic framework for the single source shortest path problem with applications to disk graphs. Comput. Geom., 111:101979, 2023. doi:10.1016/j.comgeo.2022.101979.
- [22] Chih-Hung Liu. Nearly optimal planar nearest neighbors queries under general distance functions. SIAM Journal on Computing, 51(3):723β765, 2022. doi:10.1137/20M1388371.
- [23] Ketan Mulmuley. A fast planar partition algorithm, II. J. ACM, 38(1):74β103, 1991. doi:10.1145/102782.102785.
- [24] Liam Roditty and Michael Segal. On bounded leg shortest paths problems. Algorithmica, 59(4):583β600, 2011. doi:10.1007/S00453-009-9322-3.
