
On Thu, 1 Apr 2010, Trevor Harmon wrote:
On Apr 1, 2010, at 5:31 AM, Gábor Szuromi wrote:
The edge_index internal property map is not created by default, so you have to define it explicitly:
Any particular reason why vertex indices are created (and updated) by default but edge indices are not? Perhaps it was just decided that the former is often needed while the latter not so often...
Vertex indices are an accident of using a vector as the vertex container -- see another email I posted today about that.
typedef adjacency_list
> MyGraph; typedef property_map ::type MyEdgeIndexMap; ... // Retrieve the edge index map associated with the graph MyEdgeIndexMap emap = get(edge_index, g); ... // Convert the edge descriptor to an integer value cout << index[ get(emap, e, g) ] << endl; Thanks for the tip. However, I think that last line is wrong. It should be:
cout << index[ get(emap, e) ] << endl;
Yes, you can do either get(emap, e) or get(edge_index, g, e). -- Jeremiah Willcock