I cannot figure out how to create a subgraph off an existing graph without creating duplicate edges. For instance:
G = GV.AGraph(strict=False,directed=True)
G.add_edge('a','b')
G.add_edge('a','c')
G.add_edge('c','a')
G.to_string()
G.subgraph('a','b'),rank='same')
print G.to_string()
digraph {
{
graph [rank=same];
a -> b;
}
a -> b;
a -> c;
c -> a;
}
Which graphviz draws as:
![](https://lh4.googleusercontent.com/-IOxy2_iyJoQ/U0iAylxRmLI/AAAAAAAAAU0/zyWq4e3SBFw/s1600/subgraph.png)
Whereas I intended it to wind up with something which looks like this:
![](https://lh5.googleusercontent.com/-bzoSetSi3V0/U0iA3XWXWiI/AAAAAAAAAU8/s7ZR4LyBWfI/s1600/subgraph2.png)
This can be done if instead the output were:
digraph {
{
graph [rank=same];
a;b;
}
a -> b;
a -> c;
c -> a;
}