Discrete & Computational Geometry

, Volume 42, Issue 4, pp 542–569 | Cite as

Untangling a Planar Graph

  • Xavier Goaoc
  • Jan Kratochvíl
  • Yoshio Okamoto
  • Chan-Su Shin
  • Andreas Spillner
  • Alexander Wolff
Open Access


A straight-line drawing δ of a planar graph G need not be plane but can be made so by untangling it, that is, by moving some of the vertices of G. Let shift(G,δ) denote the minimum number of vertices that need to be moved to untangle δ. We show that shift(G,δ) is NP-hard to compute and to approximate. Our hardness results extend to a version of 1BendPointSetEmbeddability, a well-known graph-drawing problem.

Further we define fix(G,δ)=n−shift(G,δ) to be the maximum number of vertices of a planar n-vertex graph G that can be fixed when untangling δ. We give an algorithm that fixes at least \(\sqrt{((\log n)-1)/\log\log n}\) vertices when untangling a drawing of an n-vertex graph G. If G is outerplanar, the same algorithm fixes at least \(\sqrt{n/2}\) vertices. On the other hand, we construct, for arbitrarily large n, an n-vertex planar graph G and a drawing δ G of G with \(\ensuremath {\mathrm {fix}}(G,\delta_{G})\leq \sqrt{n-2}+1\) and an n-vertex outerplanar graph H and a drawing δ H of H with \(\ensuremath {\mathrm {fix}}(H,\delta_{H})\leq2\sqrt{n-1}+1\) . Thus our algorithm is asymptotically worst-case optimal for outerplanar graphs.


Graph drawing Straight-line drawing Planarity NP-hardness Hardness of approximation Moving vertices Untangling Point-set embeddability 


  1. 1.
    Avis, D.: Generating rooted triangulations without repetitions. Algorithmica 16, 618–632 (1996) MATHMathSciNetGoogle Scholar
  2. 2.
    Bose, P., Dujmović, V., Hurtado, F., Langerman, S., Morin, P., Wood, D.R.: A polynomial bound for untangling geometric planar graphs. In: P. Ossona de Mendez, D. Poulalhon, M. Pocchiola, J.L. Ramírez Alfonsín, G. Schaeffer (eds.) Proc. Internat. Conf. Topological Geom. Graph Theory (TGGT’08). Electr. Notes Discrete Math., pp. 205–210 (2008). Long version available at http://arxiv.org/abs/0710.1641
  3. 3.
    Canny, J.: Some algebraic and geometric computations in PSPACE. In: Proc. of the 20th ACM Sympos. Theory Comput. (STOC’88), pp. 460–469 (1988) Google Scholar
  4. 4.
    Cibulka, J.: Untangling polygons and graphs. In: P. Ossona de Mendez, D. Poulalhon, M. Pocchiola, J.L. Ramírez Alfonsín, G. Schaeffer (eds.) Proc. of Internat. Conf. Topological Geom. Graph Theory (TGGT’08), Electr. Notes Discrete Math. pp. 200–204 (2008). Long version available at http://arxiv.org/abs/0802.1312
  5. 5.
    Erdős, P., Szekeres, G.: A combinatorial problem in geometry. Compos. Math. 2, 463–470 (1935) Google Scholar
  6. 6.
    Fáry, I.: On straight-line representation of planar graphs. Acta Sci. Math. (Szeged) 11, 229–233 (1948) Google Scholar
  7. 7.
    Goaoc, X., Kratochvíl, J., Okamoto, Y., Shin, Ch.-S., Wolff, A.: Moving vertices to make drawings plane. In: Proc. of the 15th International Symposium on Graph Drawing (GD’07). Lecture Notes in Computer Science, vol. 4875, pp. 101–112. Springer, Berlin (2008) Google Scholar
  8. 8.
    Hong, S.-H., Nagamochi, H.: Convex drawing of graphs with non-convex boundary. Discrete Appl. Math. 156, 2368–2380 (2008) MATHCrossRefMathSciNetGoogle Scholar
  9. 9.
    Hopcroft, J., Tarjan, R.E.: Efficient planarity testing. J. ACM 21, 549–568 (1974) MATHCrossRefMathSciNetGoogle Scholar
  10. 10.
    Kang, M., Pikhurko, O., Ravsky, A., Schacht, M., Verbitsky, O.: Obfuscated drawings of planar graphs. ArXiv report (March 2008). Available at http://arxiv.org/abs/0803.0858
  11. 11.
    Kaufmann, M., Wiese, R.: Embedding vertices at points: Few bends suffice for planar graphs. J. Graph Algorithms Appl. 6(1), 115–129 (2002) MATHMathSciNetGoogle Scholar
  12. 12.
    Knuth, D.E., Raghunathan, A.: The problem of compatible representatives. SIAM J. Discrete Math. 5(3), 422–427 (1992) MATHCrossRefMathSciNetGoogle Scholar
  13. 13.
    Kratochvíl, J., Matoušek, J.: Intersection graphs of segments. J. Combin. Theory Ser. B 62, 289–315 (1994) MATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Lichtenstein, D.: Planar formulae and their uses. SIAM J. Comput. 11(2), 329–343 (1982) MATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    Liske, N.: Planarity game. http://www.creativecouple.de/en/Projects/Planarity.html (accessed 8 September 2008)
  16. 16.
    Lubiw, A., Petrick, M., Spriggs, M.: Morphing orthogonal planar graph drawings. In: Proc. of the 17th Annu. ACM-SIAM Symposium on Discrete Algorithms (SODA’06), pp. 222–230 (2006) Google Scholar
  17. 17.
    Misue, K., Eades, P., Lai, W., Sugiyama, K.: Layout adjustment and the mental map. J. Visual Lang. Comput. 6(2), 183–210 (1995) CrossRefGoogle Scholar
  18. 18.
    Pach, J., Tardos, G.: Untangling a polygon. Discrete Comput. Geom. 28(4), 585–592 (2002) MATHMathSciNetGoogle Scholar
  19. 19.
    Pach, J., Wenger, R.: Embedding planar graphs at fixed vertex locations. Graphs Comb. 17(4), 717–728 (2001) MATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Ravsky, A., Verbitsky, O.: On collinear sets in straight line drawings. ArXiv report (June–July 2008). Available at http://arxiv.org/abs/0806.0253
  21. 21.
    Renegar, J.: On the computational complexity and geometry of the first-order theory of the reals, part I: Introduction. Preliminaries. The geometry of semi-algebraic sets. The decision problem for the existential theory of the reals. J. Symb. Comput. 13(3), 255–300 (1992) MATHMathSciNetCrossRefGoogle Scholar
  22. 22.
    Schensted, C.: Longest increasing and decreasing subsequences. Can. J. Math. 13, 179–191 (1961) MATHMathSciNetGoogle Scholar
  23. 23.
    Schnyder, W.: Planar graphs and poset dimension. Order 5(4), 323–343 (1989) MATHCrossRefMathSciNetGoogle Scholar
  24. 24.
    Spillner, A., Wolff, A.: Untangling a planar graph. In: Proc. of the 34th International Conference on Current Trends in Theory and Practice of Computer Science (SOFSEM’08). Lecture Notes in Computer Science, vol. 4910, pp. 473–484. Springer, Berlin (2008) Google Scholar
  25. 25.
    Stein, S.K.: Convex maps. Proc. Am. Math. Soc. 2, 464–466 (1951) MATHCrossRefGoogle Scholar
  26. 26.
    Tantalo, J.: Planarity. Web site at http://planarity.net/ (accessed 21 May 2007)
  27. 27.
    Verbitsky, O.: On the obfuscation complexity of planar graphs. Theor. Comput. Sci. 396(1–3), 294–300 (2008) (first published at http://arxiv.org/abs/0705.3748) MATHCrossRefMathSciNetGoogle Scholar
  28. 28.
    Wagner, K.: Bemerkungen zum Vierfarbenproblem. Jahresbericht Deutsch. Math. Verein. 46, 26–32 (1936) Google Scholar
  29. 29.
    Watanabe, M.: Open problem. In: 5th Czech–Slovak Symposium on Combinatorics (1998) Google Scholar

Copyright information

© The Author(s) 2009

Authors and Affiliations

  • Xavier Goaoc
    • 1
  • Jan Kratochvíl
    • 2
  • Yoshio Okamoto
    • 3
  • Chan-Su Shin
    • 4
  • Andreas Spillner
    • 5
  • Alexander Wolff
    • 6
  1. 1.LORIA–INRIA Grand EstNancyFrance
  2. 2.Department of Applied Mathematics and Institute of Theoretical Computer ScienceCharles UniversityPragueCzech Republic
  3. 3.Graduate School of Information Science and EngineeringTokyo Institute of TechnologyTokyoJapan
  4. 4.School of Electronics and Information EngineeringHankuk University of Foreign StudiesYonginKorea
  5. 5.School of Computing SciencesUniversity of East AngliaNorwichUK
  6. 6.Faculteit Wiskunde en InformaticaTechnische Universiteit EindhovenEindhovenThe Netherlands

Personalised recommendations