How do I create the following graph with the graphviz c-library:
digraph G {
{rank=same; n1, n2}
n1 -> n2 -> n3;
}
The following lines are clear:
g = agopen("G", AGFLAG_DIRECTED);
agnode(g, "n1");
agnode(g, "n2");
agnode(g, "n3");
agedge(g, "n1", "n2");
agedge(g, "n2", "n3");
How do I rank n1 and n2?
I’ve found a solution. The braces gave me the hint.
It must be a subgraph. So the following lines will do the trick: