Ask Your Question

hbm's profile - activity

2021-03-22 17:08:11 +0200 received badge  Famous Question (source)
2018-06-27 03:23:49 +0200 received badge  Notable Question (source)
2017-05-22 09:30:56 +0200 received badge  Famous Question (source)
2016-08-25 02:28:40 +0200 received badge  Popular Question (source)
2016-05-11 00:14:51 +0200 received badge  Popular Question (source)
2016-05-11 00:14:51 +0200 received badge  Notable Question (source)
2013-12-21 17:25:26 +0200 commented answer Generating plane triangulations

Would this work for all OS or just Unix/Linux system?

2013-12-21 17:18:02 +0200 commented answer Generating plane triangulations

Thank you very much.

2013-12-21 17:17:59 +0200 marked best answer Generating plane triangulations

If you have plantri installed and somewhere in your PATH variable you can easily adapt the code of graphs.nauty_geng to make it work with plantri. Something along the following lines might do the job:

def plantri(self, options=""):
   import subprocess
   sp = subprocess.Popen("plantri -g {0}".format(options), shell=True,
                              stdin=subprocess.PIPE, stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE, close_fds=True)
   gen = sp.stdout
   while True:
       try:
           s = gen.next()
       except StopIteration:
           raise StopIteration("Exhausted list of graphs from plantri")
       G = graph.Graph(s[:-1], format='graph6')
       yield G
2013-12-21 14:22:30 +0200 asked a question Generating plane triangulations

Does sage have a function that generates plane triangulations? Something like PLANTRI? If not, is it possible to use plantri from within sage and how?

Thank you

2013-12-19 21:45:08 +0200 received badge  Scholar (source)
2013-12-19 21:45:08 +0200 marked best answer Sage and planar graphs

About the faces of a planar graph, you can try using the trace_faces method for Graphs. For example:

sage: g=graphs.IcosahedralGraph()
sage: g.is_planar(set_embedding=True)
True
sage: g.trace_faces(g.get_embedding())
[[(10, 11), (11, 7), (7, 10)],
 [(6, 4), (4, 3), (3, 6)],
 [(5, 6), (6, 1), (1, 5)],
 [(2, 8), (8, 1), (1, 2)],
 [(9, 8), (8, 2), (2, 9)],
 [(8, 0), (0, 1), (1, 8)],
 [(3, 2), (2, 6), (6, 3)],
 [(0, 7), (7, 11), (11, 0)],
 [(2, 1), (1, 6), (6, 2)],
 [(8, 9), (9, 7), (7, 8)],
 [(4, 10), (10, 3), (3, 4)],
 [(5, 4), (4, 6), (6, 5)],
 [(11, 4), (4, 5), (5, 11)],
 [(10, 4), (4, 11), (11, 10)],
 [(9, 3), (3, 10), (10, 9)],
 [(7, 0), (0, 8), (8, 7)],
 [(11, 5), (5, 0), (0, 11)],
 [(10, 7), (7, 9), (9, 10)],
 [(2, 3), (3, 9), (9, 2)],
 [(5, 1), (1, 0), (0, 5)]]

As @Nathann mentions, there seems to be no code to get the dual. However there seems to be some code for this in trac, perhaps you can start from there.

2013-12-18 19:39:09 +0200 commented answer Sage and planar graphs

Thank you.

2013-12-18 15:30:46 +0200 received badge  Supporter (source)
2013-12-18 14:04:16 +0200 commented answer Sage and planar graphs

It would be probably best to modify is_planar to do it. Is the source for is_planar available? How can I get?

2013-12-18 12:36:22 +0200 received badge  Nice Question (source)
2013-12-17 21:38:08 +0200 received badge  Student (source)
2013-12-17 21:08:01 +0200 asked a question Sage and planar graphs

How can I compute the faces of a planar embedding of a planar graph? And how to compute the dual of a plane graph?