dot() is a function to output a graph which suppords adj() that writes
out a .dot file for graph visualisation
Definition at line 5 of file dot.py.
5 def dot(G, fn, nodesToHighlight=[]):
6 """dot() is a function to output a graph which suppords adj() that writes
7 out a .dot file for graph visualisation"""
11 "layout=twopi ranksep=3 ratio=auto\n"]
16 line =
'%d -> %d;' % (v, w)
19 for v
in nodesToHighlight:
21 lines.append(
'%d [color=red, style=filled];' % v)
25 text =
'\n'.
join(lines)
27 with open(fn,
'w')
as fh: