# How to create random cubic planar graphs?

Hi,

I need to create random cubic planar graphs.

Do you know how can I do that?

Or alternatively, do you know a can create the dual of a random planar triangulation?

I saw that I can create triangulation using:

G = graphs.RandomTriangulation(n)

Bye and thanks

edit retag close merge delete

Sort by » oldest newest most voted

Use the flip graph of the random two sphere.

Something like:

simplicial_complexes.RandomTwoSphere(66).flip_graph()

more

I haven't found the RandomTwoSphere into the simplicial_complexes. Is it something new?

AttributeError: 'module' object has no attribute 'RandomTwoSphere'

I tried with import but that does't work either.

( 2016-05-15 12:19:06 +0200 )edit
( 2016-05-15 14:13:12 +0200 )edit

G = simplicial_complexes.RandomTwoSphere(5).flip_graph() Using G.edges() it returns this: [((0, 1, 2), (0, 1, 'b'), None), ((0, 1, 2), (0, 2, 'a'), None), ((0, 1, 2), (1, 2, 'a'), None), ((0, 1, 'b'), (0, 'a', 'b'), None), ((0, 1, 'b'), (1, 'a', 'b'), None), ((0, 2, 'a'), (0, 'a', 'b'), None), ((0, 2, 'a'), (1, 2, 'a'), None), ((0, 'a', 'b'), (1, 'a', 'b'), None), ((1, 2, 'a'), (1, 'a', 'b'), None)]) But normally if I create the Graph manually (another Graph) it returns this: [(1, 2, '1-2'), (1, 5, '5-1'), (1, 6, '1-6'), (2, 3, '2-3'), (2, 10, '2-10'), (3, 4, '3-4'), (3, 12, '3-12'), (4, 5, '4-5'), (4, 11, '4-11'), (5, 7, '5-7'), (6, 7, '6-7'), (6, 8, '6-8'), (7, 9, '7-9'), (8, 9, '8-9'), (8, 10, '8-10'), (9, 11, '9-11'), (10, 12, '10-12'), (11, 12, '12-11')])

Do you know why it is diff?

( 2016-06-10 18:57:42 +0200 )edit

I mean:

The first is: [ ( (),(), None), (),(), None), ...) ] The second is: [ (), (), ... ]

( 2016-06-10 19:00:32 +0200 )edit

You can relabel the graph if you are not happy with the vertices being triangles.

( 2016-06-10 19:08:46 +0200 )edit