1 | initial version |
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
2 | No.2 Revision |
If you have plantri installed and somewhere in your PATH variable you can easily adapt the code of `graphs.nauty_geng' 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