## Abstract

Let *P* be a closed simple polygon with *n* vertices. For any two points in *P*, the geodesic distance between them is the length of the shortest path that connects them among all paths contained in *P*. The geodesic center of *P* is the unique point in *P* that minimizes the largest geodesic distance to all other points of *P*. In 1989, Pollack et al. (Discrete Comput Geom 4(1): 611–626, 1989) showed an \(O(n\log n)\)-time algorithm that computes the geodesic center of *P*. Since then, a longstanding question has been whether this running time can be improved. In this paper we affirmatively answer this question and present a deterministic linear-time algorithm to solve this problem.

This is a preview of subscription content, access via your institution.

## References

- 1.
Aronov, B.: On the geodesic Voronoi diagram of point sites in a simple polygon. Algorithmica

**4**(1–4), 109–140 (1989) - 2.
Aronov, B., Fortune, S., Wilfong, G.: The furthest-site geodesic Voronoi diagram. Discrete Comput. Geom.

**9**(1), 217–255 (1993) - 3.
Asano, T., Toussaint, G.: Computing the geodesic center of a simple polygon. Technical Report SOCS-85.32, McGill University (1985)

- 4.
Bae, S.W., Korman, M., Mitchell, J.S.B., Okamoto, Y., Polishchuk, V., Wang, H.: Computing the L1 geodesic diameter and center of a polygonal domain. In: Ollinger, N., Vollmer, H. (eds) 33rd Symposium on Theoretical Aspects of Computer Science (STACS 2016). Leibniz International Proceedings in Informatics (LIPIcs), vol. 47, pp. 14:1–14:14. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl (2016). ISBN 978-3-95977-001-9

- 5.
Bae, S.W., Korman, M., Okamoto, Y.: The geodesic diameter of polygonal domains. Discrete Comput. Geom.

**50**(2), 306–329 (2013) - 6.
Bae, S.W., Korman, M., Okamoto, Y.: Computing the geodesic centers of a polygonal domain. In: Computational Geometry: Theory and Applications. Special issue of selected papers from the 26th Canadian Conference on Computational Geometry (CCCG’14) (2015) (in press)

- 7.
Bae, S.W., Korman, M., Okamoto, Y., Wang, H.: Computing the \({L}_1\) geodesic diameter and center of a simple polygon in linear time. Comput. Geom.

**48**(6), 495–505 (2015) - 8.
Chazelle B.: A theorem on polygon cutting with applications. In: Proceedings of FOCS, pp. 339–349 (1982)

- 9.
Chazelle, B.: Triangulating a simple polygon in linear time. Discrete Comput. Geom.

**6**(1), 485–524 (1991) - 10.
Djidjev, H., Lingas, A., Sack, J.-R.: An \(O(n\log n)\) algorithm for computing the link center of a simple polygon. Discrete Comput. Geom.

**8**, 131–152 (1992) - 11.
Edelsbrunner, H., Mücke, E.P.: Simulation of simplicity: A technique to cope with degenerate cases in geometric algorithms. ACM Trans. Graph.

**9**(1), 66–104 (1990) - 12.
Guibas, L., Hershberger, J., Leven, D., Sharir, M., Tarjan, R.E.: Linear-time algorithms for visibility and shortest path problems inside triangulated simple polygons. Algorithmica

**2**(1–4), 209–233 (1987) - 13.
Harborth, H., Möller, M.: The Esther-Klein-problem in the projective plane. Inst. Mathematik, TU Braunschweig (1993)

- 14.
Harel, D., Tarjan, R.E.: Fast algorithms for finding nearest common ancestors. SIAM J. Comput.

**13**(2), 338–355 (1984) - 15.
Hershberger, J., Suri, S.: Matrix searching with the shortest-path metric. SIAM J. Comput.

**26**(6), 1612–1634 (1997) - 16.
Ke, Y.: An efficient algorithm for link-distance problems. In: Proceedings of the Fifth Annual Symposium on Computational Geometry, pp. 69–78. ACM, Saarbrücken (1989)

- 17.
Lee, D.-T., Preparata, F.P.: Euclidean shortest paths in the presence of rectilinear barriers. Networks

**14**(3), 393–410 (1984) - 18.
Matoušek, J.: Approximations and optimal geometric divide-and-conquer. In: Proceedings of the Twenty-Third Annual ACM Symposium on Theory of Computing, pp. 505–511. ACM, New York (1991)

- 19.
Matoušek, J.: Approximations and optimal geometric divide-and-conquer. J. Comput. Syst. Sci.

**50**(2), 203–208 (1995) - 20.
Matoušek, J.: Lectures on Discrete Geometry, Graduate Texts in Math, vol. 212. Springer, New York (2002)

- 21.
Megiddo, N.: On the ball spanned by balls. Discrete Comput. Geom.

**4**(1), 605–610 (1989) - 22.
Mitchell, J.S.B.: Geometric shortest paths and network optimization. In: Sack, J.R., Urrutia, J. (eds.) Handbook of Computational Geometry, pp. 633–701. Elsevier, Amsterdam (2000)

- 23.
Nilsoon, B.J., Schuierer, S.: Computing the rectilinear link diameter of a polygon. In: Computational Geometry—Methods, Algorithms and Applications, pp. 203–215. Springer, Berlin (1991)

- 24.
Nilsoon, B.J., Schuierer, S.: An optimal algorithm for the rectilinear link center of a rectilinear polygon. Comput. Geom.

**6**, 169–194 (1996) - 25.
Pollack, R., Sharir, M., Rote, G.: Computing the geodesic center of a simple polygon. Discrete Comput. Geom.

**4**(1), 611–626 (1989) - 26.
Suri, S.: Minimum link paths in polygons and related problems. PhD Thesis, Johns Hopkins University (1987)

- 27.
Suri, S.: Computing geodesic furthest neighbors in simple polygons. J. Comput. Syst. Sci.

**39**(2), 220–235 (1989) - 28.
Turán, P.: On an extremal problem in graph theory. Matematikai és Fizikai Lapok

**48**(436–452), 137 (1941)

## Acknowledgments

H.-K. Ahn and E. Oh: Supported by the NRF Grant 2011-0030044 (SRC-GAIA) funded by the Korea government (MSIP). M. K. was supported in part by the ELC Project (MEXT KAKENHI Nos. 12H00855 and 15H02665).

## Author information

### Affiliations

### Corresponding author

## Additional information

Editor in Charge: János Pach

## Appendix: Bounding the VC Dimension

### Appendix: Bounding the VC Dimension

In this section we provide the proof of Lemma 6.3. That is, we want to prove that the set system \(({\mathcal C_R}, \varphi )\) has constant VC-dimension. Recall that \({\mathcal C_R}\) is a set of chords of *P* and \(\varphi \) is the set of all open 4-cells of *P*.

Let \(A \subseteq {\mathcal C_R}\) be a subset of chords. We say that *A* is *shattered* by \(\varphi \) if each of the subsets of *A* can be obtained as the intersection of some \(Z\in \varphi \) with *A*, i.e., if for each \(\sigma \subseteq A\), there exists \(Z\in \varphi \) such that \(\sigma = Z\cap A\). The *VC-dimension* of \(({\mathcal C_R}, \varphi )\) is the supremum of the sizes of all finite shattered subsets of \({\mathcal C_R}\).

Let \(\mathcal H = \{H : H\text { is a half-polygon of }P\}\). Because each 4-cell of *P* is the intersection of at most four half-polygons of *P*, the following result is a direct consequence of Proposition 10.3.3 of [19, Chap. 10].

### Lemma 9.1

If \(({\mathcal C_R}, \mathcal H)\) has VC-dimension *d*, then \(({\mathcal C_R}, \varphi )\) has VC-dimension *O*(*d*).

Let *A* be an arbitrary subset of \({\mathcal C_R}\) such that \(|A| = \kappa \) for some constant \(\kappa >6\) to be determined later. Recall that if no subset of \({\mathcal C_R}\) of size \(\kappa \) is shattered by \(\mathcal H\), then the VC-dimension of \(({\mathcal C_R}, \mathcal H)\) is at most \(\kappa -1\).

By Lemma 9.1, it suffices to show that *A* is not shattered by \(\mathcal H\) to bound the VC-dimension of \(({\mathcal C_R}, \mathcal H)\) and hence of \(({\mathcal C_R}, \varphi )\). We spend the remainder of this section proving that *A* is not shattered by \(\mathcal H\).

A 6-cell is *strict* if it is defined as the intersection of six half-polygons, none of them redundant, i.e., the removal of any of them modifies the 6-cell.

### Lemma 9.2

If there are six chords of *A* supporting six half-polygons whose intersection defines a strict 6-cell \(\sigma \), then *A* is not shattered by \(\mathcal H\).

### Proof

Let \(C_1, \ldots , C_6\) be the chords supporting the six half-polygons whose intersection defines \(\sigma \). Assume that \(C_1, \ldots , C_6\) appear in this order when walking clockwise along the boundary of \(\sigma \). Note that any half-polygon that intersects \(C_1, C_3\) and \(C_5\) must intersect either \(C_2, C_4\) or \(C_6\). Therefore, the set \(\{C_1, C_3, C_5\}\subseteq A\) cannot be obtained as the intersection of some half-polygon \(H\in \mathcal H\) with *A*. Consequently *A* is not shattered by \(\mathcal H\). \(\square \)

Given two chords \(C_1\) and \(C_2\) of *A*, we say that \(C_1\) and \(C_2\) are *separated* if there exists a chord \(S\in A\) such that \(C_1\) and \(C_2\) lie on different open half-polygons supported by *S*. In this case, we say that *S*
*separates*
\(C_1\) from \(C_2\).

Note that if *A* contains two chords \(C_1\) and \(C_2\) that are separated by a chord *S*, then any half-polygon that intersects both \(C_1\) and \(C_2\) must also intersect *S*. In this case, the subset \(\{C_1, C_2\}\) cannot be obtained as the intersection of a half-polygon \(H\in \mathcal H\) with *A*, i.e., *A* is not shattered by \(\mathcal H\). Therefore, we assume from now on that no two chords of *A* are separated.

Let \(G_{A}\) be the intersection graph of *A*, i.e., the graph with vertex set *A* and an edge between two chords if they intersect. An Erdös-Szekeres type result from Harborth and Möller [23] shows that every arrangement of nine pseudo-lines determines a sub-arrangement with a hexagonal face. Thus, if \(G_{A}\) has a clique of size nine, then this subset of chords is a set of pseudo-lines. Therefore, it contains a subset of 6 chords that define a strict 6-cell. In this case, Lemma 9.2 implies that *A* is not shattered by \(\mathcal H\). Consequently, we assume from now on that \(G_{A}\) has no clique of size nine.

Turán’s Theorem [28] states that if \(G_{A}\) has no clique of size nine, then it has at most \((7/16)\kappa ^2\) edges. Let \(C_1\) be the chord in *A* with the smallest degree in \(G_{A}\). Notice that \(C_1\) has degree at most \(7 \kappa /8\). Therefore, there are at least \(\kappa /8\) chords of *A* that do not intersect \(C_1\). Consider the two half-polygons supported by \(C_1\) and note that one of them, say \(P'\), contains at least \( \kappa /16\) chords of *A* that do not intersect \(C_1\). Let \(A'\) be the set containing these chords.

Let \(G_{A}'\) be subgraph of \(G_{A}\) induced by \(A'\) and let \(C_2\) be the chord of \(A'\) with smallest degree in \(G_{A}'\). Because \(G_{A}'\) has no clique of size nine, we infer that \(C_2\) has degree at most \(7|A'|/8\). Repeating the same argument, there is a set \(A''\) of at least \(|A'| /8\) chords of \(A'\) that intersect neither \(C_2\) nor \(C_1\). Because we assumed that no two chords of *A* are separated, all chords in \(A''\) must be contained in the half-polygon supported by \(C_2\) that contains \(C_1\). Otherwise, \(C_1\) and some of these chords are separated by \(C_2\).

Let \(G_{A}''\) be the subgraph of \(G_{A}\) induced by \(A''\). Repeating the above procedure recursively on \(G_{A}''\) and \(A''\) four more times, we obtain a set \(C_1, \ldots , C_6\) of pairwise disjoint chords such that for each \(1\le i\le 6\), \(C_1, \ldots , C_{i-1}\) are contained in the same half-polygon supported by \(C_i\). Consequently, the set \(\{C_1, \ldots , C_6\}\) bounds a strict 6-cell.

The above process can be applied as long as

That is, as long as \(|A| \ge 65,536\) we can always find 6 such chords defining a strict 6-cell. In this case, Lemma 9.2 implies that *A* is not shattered by \(\mathcal H\). Consequently, no set of 65,536 chord is shattered, i.e., the set system \(({\mathcal C_R}, \mathcal H)\) has VC-dimension at most 65,535. By Lemma 9.1, we obtain the following result.

\(\blacktriangleright \mathbf {Lemma~6.3.}\)
*The set system*
\(({\mathcal C_R}, \varphi )\)
*has constant VC-dimension.*

## Rights and permissions

## About this article

### Cite this article

Ahn, HK., Barba, L., Bose, P. *et al.* A Linear-Time Algorithm for the Geodesic Center of a Simple Polygon.
*Discrete Comput Geom* **56, **836–859 (2016). https://doi.org/10.1007/s00454-016-9796-0

Received:

Revised:

Accepted:

Published:

Issue Date:

### Keywords

- Geodesic distance
- Facility location
- Simple polygons

### Mathematics Subject Classification

- 65D18