Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-09-08 14:48:32


Several of the reviews mentioned various problems with the
visitors of GGCL:

1. They only handle graph search algorithms, what about the others?
2. They are presented as general purpose... but the interface
 as is does not apply to all graph algorithms.
3. The difference between the Visitor and UserVisitor concepts
 is confusing.

To address these problems I'm thinking about generalizing the visitor
idea in the following way:

The visitor argument to each algorithm is replaced by a list of
(functor,tag) pairs. The tags coorespond to "event points", and the
functor says what to do at the event point. Each algorithm defines
which tags can be used, and what they mean.

This approach has the advantage that the same functor, say
predecessor_recorder, could be used with different algorithms
at different event points.

dijkstra_shortest_paths(...,
  make_pair(make_pair(record_predecessors(p), explore_edge_tag()),
            null_visitor())
  );

bellman_ford_shortest_paths(...,
  make_pair(make_pair(record_predecessors(p), relax_tag()),
            null_visitor())
  );

Opinions?

Cheers,

Jeremy


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk