rustworkx.is_planar#

is_planar(graph, /)#

Check if an undirected graph is planar.

A graph is planar iff it can be drawn in a plane without any edge intersections. The planarity check algorithm is based on the Left-Right Planarity Test [Brandes].

Parameters:

graph (PyGraph) – The graph to be used.

Returns:

Whether the provided graph is planar.

Return type:

bool

[Brandes]

Ulrik Brandes: The Left-Right Planarity Test 2009 http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.217.9208