C++ Boost

ucs_visitor<EventVisitorList>

This class is an adapter that converts a list of EventVisitor's (constructed using std::pair) into a UniformCostVisitor.

Example

This is an excerpt from examples/dijkstra.cpp where the predecessor_recorder single-event visitor is used to record the shortest-paths search-tree calculated by Dijkstra's algorithm.
  std::vector<Vertex> p(num_vertices(G));
  std::vector<int> d(num_vertices(G));

  Vertex s = *(vertices(G).first);
  
  dijkstra_shortest_paths(G, s, d.begin(), 
    make_ucs_visitor(record_predecessors(p.begin(), on_edge_relaxed())));

Model of

UniformCostVisitor

Template Parameters

ParameterDescriptionDefault
EventVisitorList A list of EventVisitor's created with std::pair. null_visitor

Where Defined

boost/graph/uniform_cost_search.hpp

Member Functions

This class implements all of the member functions required by UniformCostVisitor. In each function the appropriate event is dispatched to the EventVisitor's in the EventVisitorList.

Non-Member Functions

FunctionDescription
template <class EventVisitorList>
ucs_visitor<EventVisitorList>
make_ucs_visitor(EventVisitorList ev_list);
Returns the event visitor list adapted to be a UCS visitor.

See Also

Visitor concepts

The following are event visitors: predecessor_recorder, distance_recorder time_stamper, and property_writer.


Copyright © 2000 Jeremy Siek, Univ.of Notre Dame (jsiek@lsc.nd.edu)
Lie-Quan Lee, Univ.of Notre Dame (llee1@lsc.nd.edu)
Andrew Lumsdaine, Univ.of Notre Dame (lums@lsc.nd.edu)