I've added a bunch of nodes and vertices to my directed graph, created with settings typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, Node, Edge> graph;
Node
has a string for the node's name, and Edge
has an int for its score. I am trying to loop over all the edges and output the source and target names, as well as the score for that edge.
You can get an iterator over the edges with my_graph.m_edges.begin()
, which can be dereferenced to get m_source
and m_target
.
How do I get the names assigned to the source and target nodes, as well as the score on that edge?