Hello all,
I am trying to iterate through a list of edges in the boost graph library, but i would like to advance more than one at a time or be able to use random access to an edge in the set. For example:
Currently, to find the edge at index in the edge set I have to iterate through all the edges:
Edge e;
int count = 0;
for (edge_range_t er = edges(graph); er.first != er.second; er.first++)
{
e = (*er.first);
if (count == index)
break;
count++;
}
return e;
I would like something like:
Edge e;
edge_range_t er = edges(graph);
e = (*er[index].first);
return e;
Is there a way to index with iterators?
Regards