
When I run my program the output gives an id to each edge and vertex like so. <edge id="e262" source="n46" target="n43"> This must be the index. So how can I access this index? When I put the following in my code it fails to compile. error: ‘index_map’ was not declared in this scope for (tie(edge_iter, edges_end) = edges(g); edge_iter != edges_end; ++edge_iter) { get(index_map, *edge_iter, g); } Do I need "get_property(index_map) or something? My Graph declaration is as follows. typedef adjacency_list < listS, vecS, directedS >::edge_descriptor edge_t; typedef adjacency_list < listS, vecS, directedS >::vertex_descriptor vertex_t; typedef adjacency_list < listS, vecS, directedS, property< vertex_predecessor_t, vertex_t, vertex_properties >, property< edge_reverse_t, edge_t, edge_properties > > graph_t; Thanks

On Sun, 14 Jun 2009, caligulaemperorofrome@yahoo.com wrote:
When I run my program the output gives an id to each edge and vertex like so.
<edge id="e262" source="n46" target="n43">
This must be the index. So how can I access this index? When I put the following in my code it fails to compile. error: ‘index_map’ was not declared in this scope
for (tie(edge_iter, edges_end) = edges(g); edge_iter != edges_end; ++edge_iter) {
?? get(index_map, *edge_iter, g);
}
Do I need "get_property(index_map) or something? My Graph declaration is as follows.
typedef adjacency_list < listS, vecS, directedS >::edge_descriptor edge_t;
typedef adjacency_list < listS, vecS, directedS >::vertex_descriptor vertex_t;
The two properties are named "vertex_index" and "edge_index". I do not know if you have one or both of those; I think the settings you gave produce a vertex_index and not an edge_index, but I'm not sure. If the edge_index property map does not exist, I suspect the index that is being output is just the distance from edges(g).beign() to the current edge iterator. -- Jeremiah Willcock
participants (2)
-
caligulaemperorofrome@yahoo.com
-
Jeremiah Willcock