Using the Boost Graph Library, is it possible to get the port identifiers for an edge?
Example: After calling read_graphviz, I can iterate through the edges of this graph and print their node_ids — I get “A -> B, A -> B”. How can I print something like “A:p0 -> B:p1, A:p0 -> B:p2”?
digraph G {
A [label="A|<p0>p0"];
B [label="B|<p1>p1|<p2>p2"];
A:p0 -> B:p1;
A:p0 -> B:p2;
}

From the
read_graphviz_new.hppsource:Where
node_and_portlooks like this:I think (but have not verified) that these results are available if you call the parser directly using:
in namespace
boost::read_graphviz_detail. It may also be available in thedynamic_property_mapif you useread_graphvizdirectly; it internally refers toread_graphviz_new.Note: In
graphviz.hpp, one of two graphviz parsers is selected, based on an#ifdef:If I am reading this correctly, then the non-spirit parser is the one you want; the spirit-based one looks like it disregards ports.
Anyway, this is just based on a quick look at the source for boost v. 1.44; for me code of interest lives in
/usr/include/boost/graph/detail/read_graphviz_new.hpp. I have not tested this, but it looks like all the plumbing is there.