Skip to main content
Log in

How to Walk Your Dog in the Mountains with No Magic Leash

  • Published:
Discrete & Computational Geometry Aims and scope Submit manuscript

Abstract

We describe a \(O(\log n )\)-approximation algorithm for computing the homotopic Fréchet distance between two polygonal curves that lie on the boundary of a triangulated topological disk. Prior to this work, algorithms were known only for curves on the Euclidean plane with polygonal obstacles. A key technical ingredient in our analysis is a \(O(\log n)\)-approximation algorithm for computing the minimum height of a homotopy between two curves. No algorithms were previously known for approximating this parameter. Surprisingly, it is not even known if computing either the homotopic Fréchet distance, or the minimum height of a homotopy, is in NP.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

Notes

  1. However, all of these algorithms should work verbatim even if the surface is not embedded in 3d, assuming it is an oriented and has the topology of a disk. Nevertheless, we keep this assumption to make the discussion more concrete and hopefully more intuitive.

  2. The discrete Fréchet distance defined here is different than the more standard definition, which is usually defined over sequences of points.

  3. Note that the corridors were used only in generating this partition, and are an artifact that is not necessarily sent to the recursive subproblems. In particular, one can describe this partition scheme without using the corridors, but it seems somewhat messier and less intuitive.

  4. Strictly speaking this case is not possible because of the corridor diagonals. Nevertheless, it provides a good warm-up exercise for the followup cases which are more involved.

  5. Formally, for two points \(p, q\in \mathcal {D}\), their geodesic distance is the length of the shortest path inside \(\mathcal {D}\) connecting \(p\) with \(q\).

  6. The existence of such a tree edge separator is folklore—its proof is provided by Lewis et al. [30].

  7. Thus, a strip might look like a dissected butterfly. Sad indeed.

  8. We use the same notation to argue about the discrete and continuous problems.

References

  1. Agarwal, P.K., Aronov, B., O’Rourke, J., Schevon, C.A.: Star unfolding of a polytope with applications. SIAM J. Comput. 26, 1679–1713 (1997)

    MathSciNet  Google Scholar 

  2. Alt, H., Buchin, M.: Semi-computability of the Fréchet distance between surfaces. In: Proceedings of the 21st European Workshop on Computational Geometry, pp. 45–48 (2005)

  3. Alt, H., Godau, M.: Computing the Fréchet distance between two polygonal curves. Int. J. Comput. Geom. Appl. 5, 75–91 (1995)

    Article  MATH  MathSciNet  Google Scholar 

  4. Bennis, C., Vézien, J.-M., Iglésias, G., Gagalowicz, A.: Piecewise surface flattening for non-distorted texture mapping. In: Sederberg, T.W. (ed). Proceedings of SIGGRAPH ’91, vol. 25, pp. 237–246. ACM, New York (1991)

  5. Brakatsoulas, S., Pfoser, D., Salas, R., Wenk, C.: On map-matching vehicle tracking data. In: Proceedings of 31st VLDB Conference, VLDB Endowment, pp. 853–864. Norwegian University of Science & Technology, Trondheim (2005)

  6. Brightwell, G.A., Winkler, P.: Submodular percolation. SIAM J. Discrete Math. 23(3), 1149–1178 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  7. Buchin, K., Buchin, M., Gudmundsson, J.: Detecting single file movement. In: Proceedings of 16th ACM SIGSPATIAL International Conference on Advances in Geographic Information Systems (ACM GIS), pp. 288–297. ACM, New York (2008)

  8. Buchin, K., Buchin, M., Gudmundsson, J., Maarten, L., Luo, J.: Detecting commuting patterns by clustering subtrajectories. In: Proceedings of the 19th International Symposium on Algorithms and Computation (ISAAC), pp. 644–655. Springer, Heidelberg (2008)

  9. Buchin, M., Driemel, A., Speckmann, B.: Computing the Fréchet distance with shortcuts is NP-hard. In: Proceedings of the 30th Annual Symposium on Computational Geometry SOCG’14 (Kyoto, Japan), pp. 367–376. ACM, New York, NY (2014)

  10. Chambers, E.W., Letscher, D.: On the height of a homotopy. In: Proceedings of the 21st Canadian Conference on Computational Geometry (CCCG), pp. 14. University of British Columbia, Vancouver (2009)

  11. Chambers, E.W., Letscher, D.: Erratum for on the height of a homotopy. http://mathcs.slu.edu/~chambers/papers/hherratum.pdf (2010)

  12. Chambers, G.R., Rotman, R.: Contracting loops on a Riemannian 2-surface (2013). arXiv:1311.2995

  13. Chambers, E.W., Wang, Y.: Measuring similarity between curves on 2-manifolds via homotopy area. In: Proceedings of the 29th Annual Symposium on Computational Geometry (SoCG), pp. 425–434. ACM, New York (2013)

  14. Chambers, E.W., Colin de Verdière, E., Erickson, J., Lazard, S., Lazarus, F., Thite, S.: Homotopic Fréchet distance between curves or, walking your dog in the woods in polynomial time. Comput. Geom. Theory Appl. 43(3), 295–311 (2010)

    Article  MATH  Google Scholar 

  15. Chambers, E.W., Letscher, D., Ju, T., Liu, L.: Isotopic Fréchet distance. In: Proceedings of the 23rd Canadian Conference on Computational Geometry (CCCG), pp. 229–234. CCCG, Toronto (2011)

  16. Cook, A.F., Wenk, C.: Geodesic Fréchet distance inside a simple polygon. ACM Trans. Algorithms 7, 9:1–9:19 (2010)

    MathSciNet  Google Scholar 

  17. Cook, A.F., Wenk, C.: Shortest path problems on a polyhedral surface. Algorithmica 69(1), 58–77 (2014)

    Article  MATH  MathSciNet  Google Scholar 

  18. Cook, A.F., Driemel, A., Har-Peled, S., Sherette, J., Wenk, C.: Computing the Fréchet distance between folded polygons. In: Proceedings of the 12th Workshop Algorithms Data Structure (WADS), pp. 267–278. Springer, Berlin (2011)

  19. Driemel, A., Har-Peled, S., Wenk, C.: Approximating the Fréchet distance for realistic curves in near linear time. Discrete Comput. Geom. 48, 94–127 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  20. Efrat, A., Guibas, L.J., Har-Peled, S., Mitchell, J.S.B., Murali, T.M.: New similarity measures between polylines with applications to morphing and polygon sweeping. Discrete Comput. Geom. 28, 535–569 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  21. Eiter, T., Mannila, H.: Computing discrete Fréchet distance. Technical Report CD-TR 94/64, Christian Doppler Laboratory for Expert Systems, TU, Vienna (1994)

  22. Floater, M.S.: Parameterization and smooth approximation of surface triangulations. Comput. Aided Geom. Des. 14(4), 231–250 (1997)

    Article  MATH  Google Scholar 

  23. Frechét, M.: Sur la distance de deux surfaces. Ann. Soc. Polonaise Math. 3, 4–19 (1924)

    Google Scholar 

  24. Godau, M.: On the complexity of measuring the similarity between geometric objects in higher dimensions. PhD Thesis, Free University of Berlin (1999)

  25. Har-Peled, S., Raichel, B.: The Fréchet distance revisited and extended. In: Proceedings of the 27th Annual Symposium on Computational Geometry (SoCG), pp. 448–457. ACM Press, New York (2011)

  26. Har-Peled, S., Nayyeri, A., Salavatipour, M., Sidiropoulos, A.: How to walk your dog in the mountains with no magic leash. In: Proceedings of the 28th Annual ACM Symposium on Computational Geometry (SoCG), pp. 121–130. ACM, New York (2012)

  27. Henzinger, M.R., Klein, P., Rao, S., Subramanian, S.: Faster shortest-path algorithms for planar graphs. J. Comput. Syst. Sci. 55, 3–23 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  28. Keogh, E.J., Pazzani, M.J.: Scaling up dynamic time warping to massive dataset. In: Proceedings of the Third European Conference on Principles of Data Mining and Knowledge Discovery, pp. 1–11. Springer, Prague (1999)

  29. Kim, M.S., Kim, S.W., Shin, M.: Optimization of subsequence matching under time warping in time-series databases. In: Proceedings of the ACM Symposium on Applied Computing, pp. 581–586. ACM, New York (2005)

  30. Lewis, P.M., II, Stearns, R.E., Hartmanis, J.: Memory bounds for recognition of context-free and context-sensitive languages. In: Proceedings of the 6th Annual IEEE Symposium on Foundations of Computer Science (FOCS), pp. 191–202. ACM, New York (1965)

  31. Lipton, R.J., Tarjan, R.E.: A separator theorem for planar graphs. SIAM J. Appl. Math. 36, 177–189 (1979)

    Article  MATH  MathSciNet  Google Scholar 

  32. Mascret, A., Devogele, T., Le Berre, I., Hénaff, A.: Coastline matching process based on the discrete Fréchet distance. In: Proceedings of the 12th International Symposium on Spatial Data Handling, pp. 383–400. Springer, Berlin (2006)

  33. Mitchell, J.S.B., Mount, D.M., Papadimitriou, C.H.: The discrete geodesic problem. SIAM J. Comput. 16, 647–668 (1987)

    Article  MATH  MathSciNet  Google Scholar 

  34. Papasoglu, P.: Contracting thin disks (2013). arXiv:1309.2967

  35. Piponi, D., Borshukov, G.: Seamless texture mapping of subdivision surfaces by model pelting and texture blending. In: Proceedings of the SIGGRAPH 2000, pp. 471–478. ACM, New York (2000)

  36. Serrà, J., Gómez, E., Herrera, P., Serra, X.: Chroma binary similarity and local alignment applied to cover song identification. IEEE Trans. Audio Speech Lang. Process. 16(6), 1138–1151 (2008)

    Article  Google Scholar 

  37. Sheffer, A., de Sturler, E.: Surface parameterization for meshing by triangulation flattening. In: Proceedings of the 9th International Meshing Roundtable, pp. 161–172. Springer, Berlin (2000)

  38. Sherette, J., Wenk, C.: Simple curve embedding. CoRR (2013). arXiv:1303.0821

  39. Wenk, C., Salas, R., Pfoser, D.: Addressing the need for map-matching speed: Localizing global curve-matching algorithms. In: Proceedings of the 18th Conference on Scientific and Statistical Database Management, pp. 879–888. Springer, Berlin (2006)

Download references

Acknowledgments

The authors thank Jeff Erickson and Gary Miller for their comments and suggestions. The authors also thank the anonymous referees for their detailed and insightful reviews. S. Har-Peled was partially supported by NSF AF awards CCF-0915984, CCF-1421231, and CCF-1217462. M. Salavatipour was supported by NSERC and Alberta Innovates and also the part of this work was done while visiting Toyota Technological Institute at Chicago. A. Sidiropoulos was supported in part by the NSF grants CCF 1423230 and CAREER 1453472.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Anastasios Sidiropoulos.

Additional information

Editor in Charge: János Pach

A preliminary version of this paper appeared in SoCG 2012 [26].

Appendix: Sweeping a Convex Polytope, Star Unfolding, and Banana Peels

Appendix: Sweeping a Convex Polytope, Star Unfolding, and Banana Peels

Consider a convex polytope \(\mathcal {P}\) in three dimensions, a base point \(b\) on its boundary, and the problem of finding the minimum length leash needed for a guard that walks on the polytope such that the leash sweeps over all the points on the surface of the polytope. Specifically, at any point in time, the guard maintains a connection to the base point \(b\) via a path (i.e., the leash) connecting it to the base point, and the leash has to move continuously as the guard moves around.

For a point \(p\) on the boundary of \(\mathcal {P}\), let \(d_{\mathcal {P}}\left( {p}\right) \) be the geodesic distance from \(b\) to \(p\) (i.e., the length shortest path \(\zeta \) that lies on the boundary of \(\mathcal {P}\) connecting \(b\) to \(p\)). Let \(M\) be the medial axis of this distance—formally, a point \(p\) is on the medial axis if there are two distinct shortest paths \(\zeta \) and \(\psi \) from \(b\) to \(p\), such that \( \Vert \zeta \Vert = \Vert \psi \Vert = d_{\mathcal {P}}\left( {p}\right) . \) It is known that \(M\) is a tree in this case [1].

Now, let \({\varPi }\) be the union of all the shortest paths from \(b\) to the vertices of \(\mathcal {P}\) (we assume that no vertex is on the medial axis, which holds under general position assumption). The set \({\varPi }\) is also a tree. Surprisingly, if you cut \(\partial {\mathcal {P}}\) along \({\varPi }\), then the resulting polygon can be flattened on the plane. Maybe even more surprisingly, this even holds if one cuts \(\partial {\mathcal {P}}\) along \(M\). This is known as star unfolding of a polytope, see Agarwal et al. [1] for details.

Consider cutting \(\partial {\mathcal {P}}\) along both \(M\) and \({\varPi }\). This breaks \(\mathcal {P}\) into a collection of polygons \(\mathcal {Q}\), where each polygon \({Q}\in \mathcal {Q}\), has no vertices of \(\mathcal {P}\) in its interior, and has \(b\) as a vertex. As such, one can unfold this \({Q}\) into the plane. Here, the two paths of \({\varPi }\) adjacent to \(b\) that belong to the boundary of \({Q}\) maps in this unfolding to two straight edges. The rest of the boundary \({Q}\) is a closed connected portion of \(M\). One can think about \({Q}\) as being a “leaf” in a decomposition of \(\partial {\mathcal {P}}\) (i.e., think about the sides of a banana peel). Here, shortest paths from \(b\) to any point on \(p\in \partial {\mathcal {P}}\) that belongs to \({Q}\) results in a straight segment in (the planar embedded version of) the polygon \({Q}\). As such, the polygons of \(\mathcal {Q}\) completely capture the structure of all the shortest paths on \(\partial {\mathcal {P}}\) to \(b\).

Back to the problem of sweeping \(\partial \mathcal {P}\). For the points of \(M_{Q}= M\cap \partial {Q}\), we can sweep the region of \(\partial {Q}\) that corresponds to \({Q}\), by walking along the curve \(M_{Q}\) (say counterclockwise), and the leash being the shortest path in \(\partial \mathcal {P}\) (that lies inside \({Q}\)). This completely sweeps over the region of \({Q}\). We then continue this sweeping in the next polygon of \(\mathcal {Q}\) adjacent to \({Q}\) around \(b\). We continue in this fashion till all the boundary of the polytope is swept over. Note that the leash is moving continuously, and during this motion, the maximum length of the leash is the distance to the furthest point on \(\partial \mathcal {P}\) from \(b\). We conclude that this is an optimal solution and using the known algorithms for computing shortest paths [1].

Let us recap the algorithm: We compute the medial axis \(M\) of \(b\) on \(\partial \mathcal {P}\), under the shortest path distance on the boundary of the polytope. Next, parameterize a point \(p(t)\) to move continuously around the tree \(M\) (i.e., traversing along each edge twice, in both direction). At each point in time, the leash is connected via the shortest path to the base point \(b\).

Lemma 17

Given a convex polytope \(\mathcal {P}\) in three dimensions, and a base point \(p\in \partial \mathcal {P}\), one can compute in polynomial time, a continuous motion of a point \(p(t)\), \(t \in [0,1]\), and an associated leash \(\ell \left( {t}\right) \) connecting \(p(t)\) with \(b\), such that (i) the leash sweeps over all the points of \(\partial \mathcal {P}\), (ii) the leash moves continuously, (iii) a point of \(\partial \mathcal {P}\) get swept over only once during this motion, and (iv) the maximum length of the leash is \(\max _{ p\in \partial \mathcal {P}} d_{\mathcal {P}}\left( {p}\right) \), which is optimal.

The above is in sharp contrast to our original problem of computing the homotopy height, as the two ends of the leash must move along two prespecified curves \(\mathsf {L}\) and \(\mathsf {R}\). Furthermore, because of that we no longer have the property that the leashes do not jump, as the leash head no longer moves along the medial axis, as the resulting paths might be too long (compared to the optimal morph). Nevertheless, the above captures our basic strategy of breaking the input disk into smaller slivers, induced by shortest paths, and solving the problem in each sliver separately, and gluing the solutions together.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Har-Peled, S., Nayyeri, A., Salavatipour, M. et al. How to Walk Your Dog in the Mountains with No Magic Leash. Discrete Comput Geom 55, 39–73 (2016). https://doi.org/10.1007/s00454-015-9737-3

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00454-015-9737-3

Keywords

Mathematics Subject Classification

Navigation