A graph is planar if the graph can be embedded in the plane, i.e., the vertices can be arranged such that no edges cross except at vertices.
i1 : isPlanar graph {{0,1}, {1,2}, {2,3}, {3,4}, {0,4}} o1 = true |
i2 : isPlanar graph flatten for i from 0 to 4 list for j from i+1 to 4 list {i,j} o2 = false |
This method uses the program planarg. The code was written by Paulette Lieby for the Magma project and used with permission in the software nauty.
The object isPlanar is a method function.