How get an edge of nodes

Hello, I use graphviz as a C-library in my project.

So, how can I get an edge, which are linked two nodes? Nodes has a type Agnode_t and I want to return edge of Agedge_t.

Thank you!

If you have one node, you can

If you have one node, you can use the functions

extern Agedge_t *agfstin(Agraph_t * g, Agnode_t * n);
extern Agedge_t *agnxtin(Agraph_t * g, Agedge_t * e);
extern Agedge_t *agfstout(Agraph_t * g, Agnode_t * n);
extern Agedge_t *agnxtout(Agraph_t * g, Agedge_t * e);
extern Agedge_t *agfstedge(Agraph_t * g, Agnode_t * n);
extern Agedge_t *agnxtedge(Agraph_t * g, Agedge_t * e, Agnode_t * n);

to find an edge.

If you have both nodes, you can use the agedge function to create or find an edge.

You can find more information in http://www.graphviz.org/pdf/Agraph.pdf

Recent comments