onlyPlanar -- removes non-planar graphs from a list

Synopsis

• Usage:
P = onlyPlanar L
P = onlyPlanar(L, non)
• Inputs:
• L, a list, containing graphs in various formats
• non, , whether to return non-planar graphs
• Outputs:
• P, a list, containing the planar graphs of $L$ in Graph6 or Sparse6 format

Description

A graph is planar if the graph can be embedded in the plane, i.e., the vertices can be arranged such that no edges cross except at vertices.

The only non-planar graph on five vertices is the complete graph.

 i1 : R = QQ[a..e]; i2 : K5 = completeGraph R; i3 : P = onlyPlanar(generateGraphs 5, true) o3 = {D~{} o3 : List i4 : areIsomorphic(first P, K5) o4 = true

This method uses the program planarg. The code was written by Paulette Lieby for the Magma project and used with permission in the software nauty.