is_planar#
- is_planar(G)[source]#
Returns True if and only if
G
is planar.A graph is planar iff it can be drawn in a plane without any edge intersections.
- Parameters:
- GNetworkX graph
- Returns:
- bool
Whether the graph is planar.
See also
check_planarity
Check if graph is planar and return a
PlanarEmbedding
instance if True.
Examples
>>> G = nx.Graph([(0, 1), (0, 2)]) >>> nx.is_planar(G) True >>> nx.is_planar(nx.complete_graph(5)) False