On Thursday, 27. January 2011 14:23:45 David Doria wrote:
I have two questions:
1) I am trying to iterate through the edges of a graph and output their edge weights. I am confused though. I know how to output the "edges", but they are actually just a (vertex, vertex) pair which defines the edge. So do I index *edgePair.first into the EdgeWeightMap to get the weight of the edge starting from vertex *edgePair.first? Or how else would I get the weight associated with a particular edge?
Code snippet: http://stackoverflow.com/questions/4810589/output-bgl-edge-weights
2) I have created a struct, and used it as a template parameter to adjacency_list. However, when I try to add_edge(vertex1, vertex2, property, graph) , the compiler complains "no matching function call". Can anyone see where I've gone wrong?
Code snippet: http://stackoverflow.com/questions/4810235/bgl-bundled-properties-add-edge- no-matching-function
Any suggestions on either of these?
You need to specify the vertex properties as empty (something like
"no_property" IIRC). You did specify the edge weight as the parameter of the
VertexProperties, but it should look like this:
adjacency_list
Thanks,
David _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Best, Cedric