Graph.is_planar

Graph.is_planar()[source]

Check if the graph is planar.

Parameters:
graphcompas.datastructures.Graph

A graph object.

Returns:
bool

True if the graph is planar. False otherwise.

Raises:
ImportError

If the networkx package is not installed.

Notes

A graph is planar if it can be drawn in the plane without crossing edges. If a graph is planar, it can be shown that an embedding of the graph in the plane exists, and, furthermore, that straight-line embedding in the plane exists.