PlanarGraphQ

PlanarGraphQ[g]

yields True if g is a planar graph and False otherwise.

Details

  • A graph is planar if it can be drawn in the plane without edge crossings.

Examples

open allclose all

Basic Examples  (2)

Test whether a graph is planar:

Not all graphs are planar:

Scope  (6)

PlanarGraphQ works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed graphs:

PlanarGraphQ gives False for expressions that are not graphs:

PlanarGraphQ works with large graphs:

Applications  (2)

Four colors can be used to color a map with no two adjacent countries having the same color:

A color scheme:

Check whether non-overlapping utility lines can be used to distribute gas, water, and electricity:

Properties & Relations  (3)

Use GraphData for an extensive collection of planar graphs:

Non-planar graphs:

Use GraphLayout->"PlanarLayout" to lay out a planar graph:

For connected planar graphs with vertices and edges, with the number of faces:

Introduced in 2012
 (9.0)