I have stored a set of graphs into a digraph obj. Now, I want to iterate over the edges and nodes. Also, want to know how can I get the edges src and target. But I tried a couple of ways and couldn’t do it e.g.,
for tail, head in graph.iteredges():
or,
graph.edges()
or,
graph.iteredges()
I am on ubuntu,
Python library (graphviz.__version__
) is 0.19.1
and graphviz version is,
$ dot -v
dot - graphviz version 2.40.1 (20161225.0304)
libdir = "/usr/lib/x86_64-linux-gnu/graphviz"
Activated plugin library: libgvplugin_dot_layout.so.6
Using layout: dot:dot_layout
Activated plugin library: libgvplugin_core.so.6
Using render: dot:core
Using device: dot:dot:core
The plugin configuration file:
/usr/lib/x86_64-linux-gnu/graphviz/config6a
was successfully loaded.
render : cairo dot dot_json fig gd json json0 map mp pic pov ps svg tk vml vrml xdot xdot_json
layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi
textlayout : textlayout
device : canon cmap cmapx cmapx_np dot dot_json eps fig gd gd2 gif gv imap imap_np ismap jpe jpeg jpg json json0 mp pdf pic plain plain-ext png pov ps ps2 svg svgz tk vml vmlz vrml wbmp x11 xdot xdot1.2 xdot1.4 xdot_json xlib
loadimage : (lib) eps gd gd2 gif jpe jpeg jpg png ps svg xbm