Ask Your Question
1

How to create random cubic planar graphs?

asked 2016-05-13 17:25:08 +0200

stefanutti gravatar image

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 flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-05-13 18:43:44 +0200

FrédéricC gravatar image

Use the flip graph of the random two sphere.

Something like:

simplicial_complexes.RandomTwoSphere(66).flip_graph()
edit flag offensive delete link more

Comments

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.

stefanutti gravatar imagestefanutti ( 2016-05-15 12:19:06 +0200 )edit
FrédéricC gravatar imageFrédéricC ( 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?
stefanutti gravatar imagestefanutti ( 2016-06-10 18:57:42 +0200 )edit

I mean:

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

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

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

FrédéricC gravatar imageFrédéricC ( 2016-06-10 19:08:46 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-05-13 17:25:08 +0200

Seen: 572 times

Last updated: May 13 '16