Ask Your Question
1

How to create random cubic planar graphs?

asked 2016-05-13 10:25:08 -0500

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 11:43:44 -0500

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 05:19:06 -0500 )edit
FrédéricC gravatar imageFrédéricC ( 2016-05-15 07:13:12 -0500 )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 11:57:42 -0500 )edit

I mean:

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

stefanutti gravatar imagestefanutti ( 2016-06-10 12:00:32 -0500 )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 12:08:46 -0500 )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 10:25:08 -0500

Seen: 113 times

Last updated: May 13 '16