Boost logo

Boost Users :

Subject: [Boost-users] [BGL] Change order of edge iterator
From: John Robertson (jrobertson7711_at_[hidden])
Date: 2010-08-23 01:04:28

I want to be able to iterate through the edges in any given order,
not just the order specified by tie(edge_iter, edges_end) = edges(g);.

Is it possible to do something like the following.

typename graph_traits<Graph>::edge_iterator edge_iter1, edges_end1, edge_iter2,
edge_iter3, edges_end3;

tie(edge_iter1, edges_end1) = edges(g); sort(edge_iter1, edges_end1,

tie(edge_iter2, edges_end2) = edges(g); sort(edge_iter2, edges_end2,

tie(edge_iter3, edges_end3) = edges(g); sort(edge_iter3, edges_end3,

(ordering_x() specified by some struct)

Then I would have 3 different orderings of the edges available.

Would this work or should I use an iterator adapter,
or create a map and (if its possible) obtain an iterator from the mapping,
or something else.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at