# Generating plane triangilation

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

Generating plane triangilation

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

add a comment

3

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
```

Asked: **
2013-12-21 07:22:30 -0500
**

Seen: **261 times**

Last updated: **Dec 21 '13**

embed planar graph with prescribed outer face

How to create random cubic planar graphs?

Combinatorial data for planar graph

Drawing a planar multigraph with loops

Check SDR in a bipartite graph by Hall's theorem.

How do I write function to test if a graph is apex?

How to list all the connected graphs with 9 vertices?

How to make pygraphviz and sage compatible?

set external_face layout_planar

Edges associated to the variables in G.kirchhoff_symanzik_polynomial()

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.