I am looking to generate a random planar graph in python with around 20 vertices. I checked out this planar graph generator but two problems emerged:
With that said, is there a simpler way to randomly generate a relatively small planar graph in python?
Create required number of nodes
Assign random x,y locations to the nodes.
WHILE nodes with no connected edges
Select N a random node with no edge
LOOP select M a different node at random
IF edge N-M does NOT intersect previous edges
Add N-M edge to graph
BREAK out of LOOP