GraphTheory
IsPlanar
test if graph is planar
Calling Sequence
Parameters
Description
Examples
IsPlanar(G)
IsPlanar(G, faces)
G
-
graph
faces
(optional) name
The IsPlanar command returns true if the graph is planar and false otherwise. If a name such as faces is specified, then this name is assigned the set of lists of the vertices of each face of the graph. The strategy is to use an algorithm by Demoucron, etc. (see Algorithmic Graph Theory by Alan Gibbons).
with⁡GraphTheory:
with⁡SpecialGraphs:
K4≔CompleteGraph⁡4
K4≔Graph 1: an undirected graph with 4 vertices and 6 edge(s)
IsPlanar⁡K4,F
true
F
3,1,2,2,1,4,3,2,4,4,1,3
DrawGraph⁡K4
NumberOfVertices⁡K4−NumberOfEdges⁡K4+nops⁡F−nops⁡ConnectedComponents⁡K4−1
0
P≔PetersenGraph⁡
P≔Graph 2: an undirected graph with 10 vertices and 15 edge(s)
IsPlanar⁡P
false
DrawGraph⁡P
See Also
Contract
DrawGraph
Download Help Document