
29 Mar
2011
29 Mar
'11
12:46 p.m.
I think the original intent of algorithm objects for BGL is inversion of control flow: instead of something like BFS calling visitor methods at event points, you have a BFS object that suspends itself where it would have called the visitor, and then is continued by surrounding code. This makes it easier to do things like interleave two BFS runs at the same time, which you can't do with the existing model (without threads or coroutines).
Exactly. The Origin library provides range-like BFS and DFS. The state of the algorithm is exposed between each discovery of a vertex. Personally, I like this approach because it opens up the algorithm to user modifications while hiding library code.