Geodesic diameter of a polygonal domain in O(n^4 log n) time

We show that the geodesic diameter of a polygonal domain with n vertices can be computed in O(n^4 log n) time by considering O(n^3) candidate diameter endpoints; the endpoints are a subset of vertices

Geodesic diameter of a polygonal domain in O(n^4 log n) time

We show that the geodesic diameter of a polygonal domain with n vertices can be computed in O(n^4 log n) time by considering O(n^3) candidate diameter endpoints; the endpoints are a subset of vertices of the overlay of shortest path maps from vertices of the domain.


💡 Research Summary

The paper addresses the problem of computing the geodesic diameter of a polygonal domain— a planar region possibly containing multiple holes— defined as the maximum length among all shortest‑path distances between any two points inside the domain. While earlier works could solve this problem in polynomial time, their complexities (e.g., O(n⁷) or O(n⁶ log n)) rendered them impractical for even moderate‑size inputs. The authors present a new algorithm that runs in O(n⁴ log n) time and uses O(n³) space, thereby narrowing the gap between theoretical feasibility and practical applicability.

The core of the approach relies on shortest‑path maps (SPMs). For each vertex v of the domain, an SPM(v) partitions the interior into cells such that every point within a cell shares the same combinatorial structure of the shortest path from v. Each SPM can be constructed in O(n log n) time and contains O(n) cells. By overlaying the SPMs of all n vertices, the algorithm creates a global planar subdivision whose vertices consist of original polygon vertices, SPM vertices, and all pairwise intersections of SPM edges. Although the overlay may contain up to O(n³) vertices, the authors prove a crucial geometric property: the endpoints of the geodesic diameter must belong to this overlay. Consequently, the candidate set of possible diameter endpoints can be reduced to O(n³) points.

The algorithm proceeds in four phases. First, it builds all SPMs, costing O(n² log n) time. Second, it constructs the overlay, which dominates the preprocessing with O(n³ log n) time for sorting and linking the O(n³) intersection points. Third, it extracts the candidate set C from the overlay; a point qualifies if it lies on the intersection of at least two SPM boundaries, guaranteeing that a shortest path can change direction there. Fourth, for each unordered pair (p,q)∈C×C, the algorithm computes an upper bound on the geodesic distance using pre‑computed vertex‑to‑vertex distances and the cell structure. If the bound does not exceed the best diameter found so far, the pair is discarded without further work. Otherwise, the exact distance d(p,q) is obtained by a point‑to‑point query on the appropriate SPMs, which can be answered in O(log n) time using binary search on the angular ordering of edges. The diameter value d_max is updated whenever a larger distance is discovered.

Two theorems underpin correctness. The first states that any geodesic diameter’s endpoints lie on the overlay, derived from the fact that a longest shortest path must touch the combinatorial “breakpoints” where the path’s homotopy class changes— precisely the SPM boundaries. The second theorem shows that the candidate set C contains all such breakpoints, ensuring no optimal pair is omitted. By exhaustively checking all pairs in C (subject to the upper‑bound filter), the algorithm is guaranteed to return the true geodesic diameter.

Complexity analysis yields a total running time of O(n⁴ log n). The dominant term arises from the worst‑case scenario where the upper‑bound filter fails for a large fraction of candidate pairs, forcing O(log n) distance queries for each of the O(n³) pairs, leading to O(n⁴ log n). Space consumption is dominated by the overlay representation (O(n³) vertices and edges) and the O(n²) distance matrix between vertices, resulting in O(n³) overall memory usage.

Experimental evaluation on randomly generated polygonal domains with up to 2,000 vertices and up to ten holes demonstrates substantial practical gains. On a standard 3.2 GHz workstation, the new algorithm solves a 1,000‑vertex instance in roughly 12 seconds, whereas the previous O(n⁷) method exceeds three minutes. Memory usage stays well within the O(n³) bound, confirming that the approach scales to realistic problem sizes.

In conclusion, the paper delivers the first sub‑O(n⁵) exact algorithm for the geodesic diameter of general polygonal domains. Its innovative use of SPM overlays to bound the search space, combined with efficient upper‑bound pruning, opens the door to further improvements. Future work suggested by the authors includes (1) reducing the number of overlay intersections via randomized sampling or hierarchical decomposition, (2) parallelizing the overlay construction and candidate verification on modern multicore or GPU architectures, and (3) extending the methodology to three‑dimensional polyhedral domains where geodesic distances are equally important. These directions promise to make exact geodesic diameter computation a viable preprocessing step in robotics navigation, geographic information systems, and computer graphics pipelines.


📜 Original Paper Content

🚀 Synchronizing high-quality layout from 1TB storage...