Planarity testing explained

In graph theory, the planarity testing problem is the algorithmic problem of testing whether a given graph is a planar graph (that is, whether it can be drawn in the plane without edge intersections). This is a well-studied problem in computer science for which many practical algorithms have emerged, many taking advantage of novel data structures. Most of these methods operate in O(n) time (linear time), where n is the number of edges (or vertices) in the graph, which is asymptotically optimal. Rather than just being a single Boolean value, the output of a planarity testing algorithm may be a planar graph embedding, if the graph is planar, or an obstacle to planarity such as a Kuratowski subgraph if it is not.

Planarity criteria

Planarity testing algorithms typically take advantage of theorems in graph theory that characterize the set of planar graphs in terms that are independent of graph drawings.These include

The Fraysseix–Rosenstiehl planarity criterion can be used directly as part of algorithms for planarity testing, while Kuratowski's and Wagner's theorems have indirect applications: if an algorithm can find a copy of K5 or K3,3 within a given graph, it can be sure that the input graph is not planar and return without additional computation.

Other planarity criteria, that characterize planar graphs mathematically but are less central to planarity testing algorithms, include:

Algorithms

Path addition method

The classic path addition method of Hopcroft and Tarjan[1] was the first published linear-time planarity testing algorithm in 1974. An implementation of Hopcroft and Tarjan's algorithm is provided in the Library of Efficient Data types and Algorithms by Mehlhorn, Mutzel and Näher. In 2012, Taylor[2] extended this algorithm to generate all permutations of cyclic edge-order for planar embeddings of biconnected components.

Vertex addition method

Vertex addition methods work by maintaining a data structure representing the possible embeddings of an induced subgraph of the given graph, and adding vertices one at a time to this data structure. These methods began with an inefficient O(n2) method conceived by Lempel, Even and Cederbaum in 1967.[3] It was improved by Even and Tarjan, who found a linear-time solution for the s,t-numbering step,[4] and by Booth and Lueker, who developed the PQ tree data structure. With these improvements it is linear-time and outperforms the path addition method in practice.[5] This method was also extended to allow a planar embedding (drawing) to be efficiently computed for a planar graph.[6] In 1999, Shih and Hsu simplified these methods using the PC tree (an unrooted variant of the PQ tree) and a postorder traversal of the depth-first search tree of the vertices.[7]

Edge addition method

In 2004, John Boyer and Wendy Myrvold[8] developed a simplified O(n) algorithm, originally inspired by the PQ tree method, which gets rid of the PQ tree and uses edge additions to compute a planar embedding, if possible. Otherwise, a Kuratowski subdivision (of either K5 or K3,3) is computed. This is one of the two current state-of-the-art algorithms today (the other one is the planarity testing algorithm of de Fraysseix, Ossona de Mendez and Rosenstiehl[9] [10]). See for an experimental comparison with a preliminary version of the Boyer and Myrvold planarity test. Furthermore, the Boyer–Myrvold test was extended to extract multiple Kuratowski subdivisions of a non-planar input graph in a running time linearly dependent on the output size.[11] The source code for the planarity test[12] [13] and the extraction of multiple Kuratowski subdivisions is publicly available. Algorithms that locate a Kuratowski subgraph in linear time in vertices were developed by Williamson in the 1980s.

Construction sequence method

A different method uses an inductive construction of 3-connected graphs to incrementally build planar embeddings of every 3-connected component of G (and hence a planar embedding of G itself). The construction starts with K4 and is defined in such a way that every intermediate graph on the way to the full component is again 3-connected. Since such graphs have a unique embedding (up to flipping and the choice of the external face), the next bigger graph, if still planar, must be a refinement of the former graph. This allows to reduce the planarity test to just testing for each step whether the next added edge has both ends in the external face of the current embedding. While this is conceptually very simple (and gives linear running time), the method itself suffers from the complexity of finding the construction sequence.

Dynamic algorithms

Planarity testing has been studied in the Dynamic Algorithms model, in which one maintains an answer to a problem (in this case planarity) as the graph undergoes local updates, typically in the form of insertion/deletion of edges. In the edge-arrival case, there is an asympotically tight inverse-Ackermann function update-time algorithm due to La Poutré, improving upon algorithms by Di Battista, Tamassia, and Westbrook. In the fully-dynamic case where edges are both inserted and deleted, there is a logarithmic update-time lower bound by Pătrașcu and Demaine, and a polylogarithmic update-time algorithm by Holm and Rotenberg,[14] improving on sub-linear update-time algorithms by Eppstein, Galil, Italiano, Sarnak, and Spencer.

Notes and References

  1. .
  2. Ph.D.. Taylor . Martyn G.. 2012. Planarity Testing by Path Addition. University of Kent. https://web.archive.org/web/20160305074643/http://ethos.bl.uk/OrderDetails.do?uin=uk.bl.ethos.580367. 2016-03-05. live. Alt URL
  3. .
  4. .
  5. , p. 243: “Its implementation in LEDA is slower than LEDA implementations of many other O(n)-time planarity algorithms.”
  6. .
  7. .
  8. .
  9. .
  10. .
  11. Book: Chimani . M. . Mutzel . P. . Petra Mutzel . Schmidt . J. M. . Efficient extraction of multiple Kuratowski subdivisions . Sydney, Australia . 159–170 . Springer-Verlag . Lecture Notes in Computer Science . Proc. 15th Int. Symp. Graph Drawing (GD'07) . 4875 . 2008. International Symposium on Graph Drawing . 10.1007/978-3-540-77537-9_17 . 978-3-540-77536-2 . .
  12. Web site: OGDF - Open Graph Drawing Framework: Start.
  13. Web site: Boost Graph Library: Boyer-Myrvold Planarity Testing/Embedding - 1.40.0.
  14. Holm . Jacob . Rotenberg . Eva . Makarychev . Konstantin . Makarychev . Yury . Tulsiani . Madhur . Kamath . Gautam . Chuzhoy . Julia . Julia Chuzhoy . 1911.03449 . Fully-dynamic planarity testing in polylogarithmic time . 10.1145/3357713.3384249 . 167–180 . Association for Computing Machinery . Proceedings of the 52nd Annual ACM SIGACT Symposium on Theory of Computing, STOC 2020, Chicago, IL, USA, June 22-26, 2020 . 2020.