
11 Jun
2011
11 Jun
'11
3:10 p.m.
I found one way to get edge weights: typedef boost::property_map<Graph, boost::edge_weight_t>::type EdgeWeightMap; EdgeWeightMap edgeWeightMap = get(boost::edge_weight, g); std::pair<Graph::edge_descriptor, bool> edgePair = boost::edge(v0, v1, g); Graph::edge_descriptor edge = edgePair.first; That seems like a lot of work though. It looks like there is a operator[](edge_descriptor), but I don't understand how to use it: I tried: g[edge]->edge_weight but there are compiler errors. The whole demonstration is here: http://programmingexamples.net/index.php?title=CPP/Boost/BGL/Directed/Weight... Any suggestions? Or is the first way the only/best way? Thanks, David