Skip to main content

Recognizing Weakly Simple Polygons


We present an \(O(n\log n)\)-time algorithm that determines whether a given n-gon in the plane is weakly simple. This improves upon an \(O(n^2\log n)\)-time algorithm by Chang et al. (Proceedings of the 26th ACM-SIAM symposium on discrete algorithm, SIAM, 2015). Weakly simple polygons are required as input for several geometric algorithms. As such, recognizing simple or weakly simple polygons is a fundamental problem.

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

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Fig. 19
Fig. 20
Fig. 21
Fig. 22
Fig. 23
Fig. 24
Fig. 25
Fig. 26
Fig. 27
Fig. 28


  1. We adopt terminology from [5].


  1. Abel, Z., Demaine, E.D., Demaine, M.L., Eppstein, D., Lubiw, A., Uehara, R.: Flat foldings of plane graphs with prescribed angles and edge lengths. In: Möhring, R., Raman, R. (eds.) Graph Drawing (GD’14). Lecture Notes in Computer Science, vol. 8871, pp. 272–283. Springer, Heidelberg (2014)

  2. Arkin, E.M., Bender, M.A., Demaine, E.D., Demaine, M.L., Mitchell, J.S.B., Sethia, S., Skiena, S.S.: When can you fold a map? Comput. Geom. 29(1), 23–46 (2004)

    Article  MATH  MathSciNet  Google Scholar 

  3. Bender, M.A., Cole, R., Demaine, E.D., Farach-Colton, M., Zito, J.: Two simplified algorithms for maintaining order in a list. In: Duncan, C., Symvonis, A. (eds.) Algorithms—ESA 2002. Lecture Notes in Computer Science, vol. 2461, pp. 152–164. Springer, Berlin (2002)

  4. Bern, M., Hayes, B.: The complexity of flat origami. In: Proceedings of the the 7th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 175–183. ACM, New York (1996)

  5. Chang, H.-C., Erickson, J., Xu, C.: Detecting weakly simple polygons. In: Proceedings of the 26th Annual ACM-SIAM Symposium on Discrete Algorithms, pp. 1655–1670. SIAM, Philadelphia (2015)

  6. Chazelle, B.: Triangulating a simple polygon in linear time. Discrete Comput. Geom. 6(5), 485–524 (1991)

    Article  MATH  MathSciNet  Google Scholar 

  7. Cole, R., Hariharan, R.: Dynamic LCA queries on trees. SIAM J. Comput. 34(4), 894–923 (2005)

    Article  MATH  MathSciNet  Google Scholar 

  8. Connelly, R., Demaine, E.D., Rote, G.: Infinitesimally locked self-touching linkages with applications to locked trees. In: Physical Knots: Knotting, Linking, and Folding of Geometric Objects in \(\mathbb{R}^3\). Contemporary Mathematics, vol. 304, pp. 287–311. American Mathematical Society, Providence (2002)

  9. Cortese, P.F., Di Battista, G., Patrignani, M., Pizzonia, M.: On embedding a cycle in a plane graph. Discrete Math. 309(7), 1856–1869 (2009)

    Article  MATH  MathSciNet  Google Scholar 

  10. de Berg, M., Cheong, O., van Kreveld, M., Overmars, M.: Computational Geometry: Algorithms and Applications. 3rd edn. Springer, Berlin (2008)

  11. Dietz, P.F., Sleator, D.D.: Two algorithms for maintaining order in a list. In: Proceedings of the 19th Annual ACM Symposium on Theory of Computing (STOC’87), pp. 365–372. ACM, New York (1987). Full version in Tech. Rep. CMU-CS-88-113, Carnegie Mellon University, Pittsburgh (1988)

  12. Francke, A., Tóth, Cs.D.: A census of plane graphs with polyline edges. SIAM J. Discrete Math. 31(2), 1174–1195 (2017)

  13. Fulek, R.: Embedding graphs into embedded graphs. arXiv:1608.02087 (2016)

  14. Fulek, R., Kynč, J.: Hanani-Tutte for approximating maps of graphs. arXiv:1705.05243 (2017)

  15. Grünbaum, B.: Polygons: Meister was right and Poinsot was wrong but prevailed. Beitr. Algebra Geom. 53(1), 57–71 (2012)

    Article  MATH  MathSciNet  Google Scholar 

  16. Minc, P.: Embedding of simplicial arcs into the plane. Topol. Proc. 22, 305–340 (1997)

    MATH  MathSciNet  Google Scholar 

  17. Mor, A.R.: Realization and Counting Problems for Planar Structures: Trees and Linkages, Polytopes and Polyominoes, Ph.D. thesis, Freie Universität Berlin, Berlin (2006)

  18. Shamos, M.I., Hoey, D.: Geometric intersection problems. In: Proceedings of the 17th Annual Symposium on Foundations of Computer Science (FOCS’76), pp. 208–215. IEEE (1976)

  19. Skopenkov, M.: On approximability by embeddings of cycles in the plane. Topol. Appl. 134(1), 1–22 (2003)

    Article  MATH  MathSciNet  Google Scholar 

Download references


Research by Akitaya, Aloupis, and Tóth was supported in part by the NSF awards CCF-1422311 and CCF-1423615. Akitaya was supported by the Science Without Borders program. Research by Erickson was supported in part by the NSF award CCF-1408763. We thank Anika Rounds and Diane Souvaine for many helpful conversations that contributed to the completion of this project. We thank the anonymous referees for many useful comments and suggestions.

Author information

Authors and Affiliations


Corresponding author

Correspondence to Hugo A. Akitaya.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Akitaya, H.A., Aloupis, G., Erickson, J. et al. Recognizing Weakly Simple Polygons. Discrete Comput Geom 58, 785–821 (2017).

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI:


  • Simple polygon
  • Combinatorial embedding
  • Perturbation

Mathematics Subject Classification

  • 05C10
  • 05C38
  • 52C45
  • 68R10