Topologically Trivial Closed Walks in Directed Surface Graphs

Authors Jeff Erickson , Yipu Wang

Thumbnail PDF


  • Filesize: 1.81 MB
  • 17 pages

Document Identifiers

Author Details

Jeff Erickson
  • University of Illinois at Urbana-Champaign, Urbana, IL, USA
Yipu Wang
  • University of Illinois at Urbana-Champaign, Urbana, IL, USA


The first author would like to thank Tillmann Miltzow for asking an annoying question that led to this work, and to apologize for still being unable to answer it.

Cite AsGet BibTex

Jeff Erickson and Yipu Wang. Topologically Trivial Closed Walks in Directed Surface Graphs. In 35th International Symposium on Computational Geometry (SoCG 2019). Leibniz International Proceedings in Informatics (LIPIcs), Volume 129, pp. 34:1-34:17, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2019)


Let G be a directed graph with n vertices and m edges, embedded on a surface S, possibly with boundary, with first Betti number beta. We consider the complexity of finding closed directed walks in G that are either contractible (trivial in homotopy) or bounding (trivial in integer homology) in S. Specifically, we describe algorithms to determine whether G contains a simple contractible cycle in O(n+m) time, or a contractible closed walk in O(n+m) time, or a bounding closed walk in O(beta (n+m)) time. Our algorithms rely on subtle relationships between strong connectivity in G and in the dual graph G^*; our contractible-closed-walk algorithm also relies on a seminal topological result of Hass and Scott. We also prove that detecting simple bounding cycles is NP-hard. We also describe three polynomial-time algorithms to compute shortest contractible closed walks, depending on whether the fundamental group of the surface is free, abelian, or hyperbolic. A key step in our algorithm for hyperbolic surfaces is the construction of a context-free grammar with O(g^2L^2) non-terminals that generates all contractible closed walks of length at most L, and only contractible closed walks, in a system of quads of genus g >= 2. Finally, we show that computing shortest simple contractible cycles, shortest simple bounding cycles, and shortest bounding closed walks are all NP-hard.

Subject Classification

ACM Subject Classification
  • Theory of computation → Computational geometry
  • computational topology
  • surface-embedded graphs
  • homotopy
  • homology
  • strong connectivity
  • hyperbolic geometry
  • medial axes
  • context-free grammars


  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    PDF Downloads


  1. James W. Alexander. Topological invariants of knots and links. Trans. Amer. Math. Soc., 30(2):275-306, 1928. URL:
  2. Lars Arge, Laura Toma, and Norbert Zeh. I/O-efficient topological sorting of planar DAGs. In Proc. 15th Ann. ACM Symp. Parallel Algorithms Arch., pages 85-93, 2003. URL:
  3. Chris Barrett, Riko Jacob, and Madhav Marathe. Formal-language-constrained path problems. SIAM J. Comput., 30(3):809-837, 2000. URL:
  4. Phillip G. Bradford and David A. Thomas. Labeled shortest paths in digraphs with negative and positive edge weights. RAIRO-Theor. Inf. Appl., 43(3):567-583, 2009. URL:
  5. Jonathan W. Brandt. Convergence and continuity criteria for discrete approximations of the continuous planar skeletons. CVGIP: Image Understanding, 59(1):116-124, 1994. URL:
  6. Sergio Cabello. Finding shortest contractible and shortest separating cycles in embedded graphs. ACM Trans. Algorithms, 6(2):24:1-24:18, 2010. URL:
  7. Sergio Cabello, Erin W. Chambers, and Jeff Erickson. Multiple-Source Shortest Paths in Embedded Graphs. SIAM J. Comput., 42(4):1542-1571, 2013. URL:
  8. Sergio Cabello, Éric Colin de Verdière, and Francis Lazarus. Finding shortest non-trivial cycles in directed graphs on surfaces. In Proc. 26th Ann. Symp. Comput. Geom., pages 156-165, 2010. URL:
  9. Sergio Cabello, Éric Colin de Verdière, and Francis Lazarus. Finding cycles with topological properties in embedded graphs. SIAM J. Discrete Math., 25:1600-1614, 2011. URL:
  10. Sergio Cabello, Éric Colin de Verdière, and Francis Lazarus. Finding shortest non-trivial cycles in directed graphs on surfaces. J. Comput. Geom., 7(1):123-148, 2016. URL:
  11. Sergio Cabello, Matt DeVos, Jeff Erickson, and Bojan Mohar. Finding one tight cycle. ACM Trans. Algorithms, 6(4):article 61, 2010. URL:
  12. Sergio Cabello and Bojan Mohar. Finding Shortest Non-Separating and Non-Contractible Cycles for Topologically Embedded Graphs. Discrete Comput. Geom., 37(2):213-235, 2007. URL:
  13. Erin W. Chambers, Éric Colin de Verdière, Jeff Erickson, Francis Lazarus, and Kim Whittlesey. Splitting (complicated) surfaces is hard. Comput. Geom. Theory Appl., 41(1-2):94-110, 2008. URL:
  14. Erin W. Chambers, Jeff Erickson, and Amir Nayyeri. Minimum cuts and shortest homologous cycles. In Proc. 25th Ann. Symp. Comput. Geom., pages 377-385, 2009. URL:
  15. Hsien-Chih Chang, Jeff Erickson, and Chao Xu. Detecting weakly simple polygons. In Proc. 26th ACM-SIAM Symp. Discrete Algorithms, pages 1655-1670, 2015. URL:
  16. Victor Chepoi, Feodor Dragan, Bertrand Estellon, Michel Habib, and Yann Vaxès. Diameters, centers, and approximating trees of δ-hyperbolic geodesic spaces and graphs. In Proc. 24th Ann. Symp. Comput. Geom., pages 59-68, 2008. URL:
  17. Edith Cohen and Nimrod Megiddo. Strongly polynomial-time and NC algorithms for detecting cycles in periodic graphs. J. Assoc. Comput. Mach., 40(4):791-830, 1993. URL:
  18. Éric Colin de Verdière and Jeff Erickson. Tightening non-simple paths and cycles on surfaces. SIAM J. Comput., 39(8):3784-3813, 2010. URL:
  19. Max Dehn. Über unendliche diskontinuierliche Gruppen. Math. Ann., 71(1):116-144, 1911. URL:
  20. Max Dehn. Transformation der Kurven auf zweiseitigen Flächen. Math. Ann., 72(3):413-421, 1912. URL:
  21. Max Dehn. Papers on Group Theory and Topology. Springer, 1987. Translated by John Stillwell. URL:
  22. Tamal K. Dey and Sumanta Guha. Transforming Curves on Surfaces. J. Comput. System Sci., 58:297-325, 1999. URL:
  23. Herbert Edelsbrunner and John L. Harer. Computational Topology: An Introduction. Amer. Math. Soc., 2010. Google Scholar
  24. David Eppstein. Dynamic generators of topologically embedded graphs. In Proc. 14th Ann. ACM-SIAM Symp. Discrete Algorithms, pages 599-608, 2003. Google Scholar
  25. David B. A. Epstein. Curves on 2-manifolds and isotopies. Acta Mathematica, 115:83-107, 1966. URL:
  26. Jeff Erickson. Shortest Non-trivial Cycles in Directed Surface Graphs. In Proc. 27th Ann. Symp. Comput. Geom., pages 236-243, 2011. URL:
  27. Jeff Erickson, Kyle Fox, and Luvsandondov Lkhamsuren. Holiest minimum-cost paths and flows in surface graphs. In Proc. 50th Ann. ACM Symp. Theory Comput., pages 1319-1332, 2018. URL:
  28. Jeff Erickson and Sariel Har-Peled. Optimally cutting a surface into a disk. Discrete Comput. Geom., 31(1):37-59, 2004. URL:
  29. Jeff Erickson and Amir Nayyeri. Minimum cuts and shortest non-separating cycles via homology covers. In Proc. 22nd Ann. ACM-SIAM Symp. Discrete Algorithms, pages 1166-1176, 2011. URL:
  30. Jeff Erickson and Yipu Wang. Topologically Trivial Closed Walks in Directed Surface Graphs. Preprint, March 2019. URL:
  31. Jeff Erickson and Kim Whittlesey. Transforming Curves on Surfaces redux. In Proc. 24th Ann. ACM-SIAM Symp. Discrete Algorithms, pages 1646-1655, 2013. URL:
  32. William J. Floyd and Steven J. Plotnick. Growth functions on Fuchsian groups and the Euler characteristic. Invent. Math., 88(1):1-29, 1987. URL:
  33. Kyle Fox. Shortest Non-trivial Cycles in Directed and Undirected Surface Graphs. In Proc. 24th Ann. ACM-SIAM Symp. Discrete Algorithms, pages 352-364, 2013. URL:
  34. Steve M. Gersten and Hamish B. Short. Small cancellation theory and automatic groups. Invent. Math., 102:305-334, 1990. URL:
  35. Peter Giblin. Graphs, Surfaces and Homology. Cambridge Univ. Press, 3rd edition, 2010. Google Scholar
  36. Rostislav Grigorichuk and Pierre de la Harpe. On problems related to growth, entropy and spectrum in group theory. J. Dynam. Control Systems, 3(1):51-89, 1997. URL:
  37. Mikhail Gromov. Hyperbolic Groups. In Steve M. Gersten, editor, Essays in Group Theory, number 8 in Math. Sci. Res. Inst. Pub., pages 75-265. Springer-Verlag, 1987. Google Scholar
  38. Joel Hass and Peter Scott. Intersections of curves on surfaces. Israel J. Math., 51:90-120, 1985. URL:
  39. Allen Hatcher. Algebraic Topology. Cambridge Univ. Press, 2002. URL:
  40. Kazuo Iwano and Kenneth Steiglitz. A semiring on convex polygons and zero-sum cycle problems. SIAM J. Comput., 19(5):883-901, 1990. URL:
  41. Ming-Yang Kao. Linear-processor NC algorithms for planar directed graphs I: Strongly connected components. SIAM J. Comput., 22(3):431-459, 1993. URL:
  42. Ming-Yang Kao and Philip N. Klein. Toward overcoming the transitive-closure bottleneck: Efficient parallel algorithms for planar digraphs. J. Comput. Syst. Sci., 47(3):459-500, 1993. URL:
  43. Ming-Yang Kao and Gregory E. Shannon. Local reorientation, global order, and planar topology. In Proc. 21st Ann. ACM Symp. Theory Comput., pages 286-296, 1989. URL:
  44. Ming-Yang Kao and Gregory E. Shannon. Linear-processor NC algorithms for planar directed graphs II: Directed spanning trees. SIAM J. Comput., 22(3):460-481, 1993. URL:
  45. S. Rao Kosaraju and Gregory F. Sullivan. Detecting cycles in dynamic graphs in polynomial time (preliminary version). In Proc. 20th ACM Symp. Theory. Comput., pages 398-406, 1988. URL:
  46. Martin Kutz. Computing shortest non-trivial cycles on orientable surfaces of bounded genus in almost linear time. In Proc. 22nd Ann. Symp. Comput. Geom., pages 430-438, 2006. URL:
  47. Francis Lazarus and Julien Rivaud. On the homotopy test on surfaces. In Proc. 53rd Ann. IEEE Symp. Foundations Comput. Sci., pages 440-449, 2012. URL:
  48. John Milnor. A note on curvature and the fundamental group. J. Diff. Geom., 2(1):1-7, 1968. URL:
  49. Bojan Mohar and Carsten Thomassen. Graphs on Surfaces. Johns Hopkins Univ. Press, 2001. Google Scholar
  50. Shay Mozes, Kirill Nikolaev, Yahav Nussbaum, and Oren Weimann. Minimum Cut of Directed Planar Graphs in O(nlog log n) Time. In Proc. 29th Ann. ACM-SIAM Symp. Discrete Algorithms, pages 477-494, 2018. URL:
  51. David E. Muller and Paul E. Schupp. Groups, the theory of ends, and context-free languages. J. Comput. System Sci., 26(3):295-310, 1983. URL:
  52. August F. Möbius. Über der Bestimmung des Inhaltes eines Polyëders. Ber. Sächs. Akad. Wiss. Leipzig, Math.-Phys. Kl., 17:31-68, 1865. Gesammelte Werke 2:473-512, Liepzig, 1886. Google Scholar
  53. Vijaya Ramachandran and Honghua Yang. Finding the closed partition of a planar graph. Algorithmica, 11(5):443-468, 1994. URL:
  54. L. B. Smikun. Connection between context-free groups and groups with decidable problems of automata equivalence. Cybernetics, 12(5):687-691, 1976. Translated from Kibernetika (Kiev) (5):33-37, 1976. URL:
  55. Carsten Thomassen. Embeddings of graphs with no short noncontractible cycles. J. Comb. Theory Ser. B, 48(2):155-177, 1990. URL:
  56. Mihalis Yannakakis. Graph-theoretic methods in database theory. In Proc. 9th ACM SIGACT-SIGMOD-SIGART Symp. Principles Database Syst., pages 230-242, 1990. URL: