In graph theory, a branch of mathematics, the left-right planarity testor de Fraysseix–Rosenstiehl planarity criterion[1] is a characterization of planar graphs based on the properties of the depth-first search trees, published by [2] [3] and used by them with Patrice Ossona de Mendez to develop a linear time planarity testing algorithm.[4] [5] In a 2003 experimental comparison of six planarity testing algorithms, this was one of the fastest algorithms tested.[6]
For any depth-first search of a graph G, the edgesencountered when discovering a vertex for the first time define a depth-first search tree T of G. This is a Trémaux tree, meaning that the remaining edges (the cotree) each connect a pair of vertices that are related to each other as an ancestor and descendant in T. Three types of patterns can be used to define two relations between pairs of cotree edges, named the T-alike and T-opposite relations.
In the following figures, simple circle nodes represent vertices, double circle nodes represent subtrees, twisted segments represent tree paths, and curved arcs represent cotree edges. The root of each tree is shown at the bottom of the figure. In the first figure, the edges labeled
\alpha
\beta
Let G be a graph and let T be a Trémaux tree of G. The graph G is planar if and only if there exists a partition of the cotree edges of G into two classes so that any two edges belong to a same class if they are T-alike and any two edges belong to different classes if they are T-opposite.
This characterization immediately leads to an (inefficient) planarity test: determine for all pairs of edges whether they are T-alike or T-opposite, form an auxiliary graph that has a vertex for eachconnected component of T-alike edges and an edge for each pair of T-opposite edges, and check whether this auxiliary graph is bipartite. Making this algorithm efficient involves finding a subset of the T-alike and T-opposite pairs that is sufficient to carry out this method without determining the relation between all edge pairs in the input graph.