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:

Whereas I intended it to wind up with something which looks like this:

This can be done if instead the output were:
digraph {
{
graph [rank=same];
a;b;
}
a -> b;
a -> c;
c -> a;
}