Planarity testing

From Wikipedia, the free encyclopedia

In graph theory, the planarity testing problem asks whether, given a graph, that graph is a planar graph (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.

Contents

[edit] Simple algorithms and planarity characterizations

By Fáry's theorem we can assume the edges in the graph drawing, if any, are straight line segments. Given such a drawing for the graph, we can verify that there are no crossings using well-known line segment intersection algorithms that operate in O(n log n) time. However, this is not a particularly good solution, for several reasons:

  • There's no obvious way to find a drawing, a problem which is considerably more difficult than planarity testing;
  • Line segment intersection algorithms are more expensive than good planarity testing algorithms;
  • It does not extend to verifying nonplanarity, since there is no obvious way of enumerating all possible drawings.

For these reasons, planarity testing algorithms take advantage of theorems in graph theory that characterize the set of planar graphs in terms that are independent of graph drawings. One of these is Kuratowski's theorem, which states that:

A finite graph is planar if and only if it does not contain a subgraph that is a subdivision of K5 (the complete graph on five vertices) or K3,3 (complete bipartite graph on six vertices, three of which connect to each of the other three).

A graph can be demonstrated to be nonplanar by exhibiting a subgraph matching the above description, and this can be easily verified, which places the problem in co-NP. However, this also doesn't by itself produce a good algorithm, since there are a large number of subgraphs to consider (K5 and K3,3 are fixed in size, but subdivisions of them can be of any size).

A simple theorem allows graphs with too many edges to be quickly determined to be nonplanar, but cannot be used to establish planarity. If v is the number of vertices (at least 3) and e is the number of edges, then the following imply nonplanarity:

e > 3v − 6 or;
There are no cycles of length 3 and e > 2v − 4.

For this reason n can be taken to be either the number of vertices or edges when using big O notation with planar graphs, since they differ by at most a constant multiple.

[edit] Path addition method

The classic path addition method of Hopcroft and Tarjan[1] was the first published linear-time planarity testing algorithm in 1974.

[edit] PQ tree vertex addition method

The vertex addition method began with an inefficient O(n2) method conceived by Lempel, Even and Cederbaum in 1967.[2] It was improved by Even and Tarjan, who found a linear-time solution for the s,t-numbering step,[3] and by Booth and Lueker, who developed the PQ tree data structure. With these improvements it is linear-time and outcompetes the path addition method in practice.[4] This method was also extended to allow a planar embedding (drawing) to be efficiently computed for a planar graph.[5]

[edit] PC tree vertex addition method

In 1999, Shih and Hsu developed a planarity testing algorithm that was significantly simpler than classical methods based on a new type of data structure called the PC tree and a postorder traversal of the depth-first search tree of the vertices.[6]

[edit] References

  1. ^ J. Hopcroft and R. Tarjan. Efficient planarity testing. Journal of the Association for Computing Machinery, vol.21, no.4, pp.549–568. 1974.
  2. ^ A. Lempel, S. Even, and I. Cederbaum. An algorithm for planarity testing of graphs. In P. Rosenstiehl, editor, Theory of Graphs, pages 215–232, New York, 1967. Gordon and Breach.
  3. ^ S. Even and R. E. Tarjan. Computing an st-numbering. Theoretical Computer Science, 2: pp.339–344. 1976.
  4. ^ Boyer and Myrvold, pg.243, "Its implementation in LEDA is slower than LEDA implementations of many other O(n)-time planarity algorithms."
  5. ^ N. Chiba, T. Nishizeki, A. Abe, and T. Ozawa. A linear algorithm for embedding planar graphs using PQ–trees. Journal of Computer and Systems Sciences, 30:pp.54–76. 1985.
  6. ^ W. K. Shih and W. L. Hsu. A new planarity test. Theoretical Computer Science, 223:pp.179–191. 1999.
  • John M. Boyer and Wendy J. Myrvold. Simplified Planarity. Journal of Graph Algorithms and Applications, vol.8, no.3, pp.241–273. 2004.