template <class IncidenceGraph, class P, class T, class R> void breadth_first_visit(IncidenceGraph& G, typename graph_traits<IncidenceGraph>::vertex_descriptor s, const bgl_named_params<P, T, R>& params); template <class IncidenceGraph, class Buffer, class BFSVisitor, class ColorMap> void breadth_first_visit (const IncidenceGraph& g, typename graph_traits<IncidenceGraph>::vertex_descriptor s, Buffer& Q, BFSVisitor vis, ColorMap color)
boost/graph/breadth_first_search.hpp
A directed or undirected graph. The graph type must be a model of Incidence Graph.IN: vertex_descriptors
Python: The parameter is named graph/tt>..
The source vertex where the search is started.
Python: The parameter is named root_vertex.
A visitor object that is invoked inside the algorithm at the event-points specified by the BFS Visitor concept. The visitor object is passed by value [1].UTIL/OUT: color_map(ColorMap color)
Default: bfs_visitor<null_visitor>
Python: The parameter should be an object that derives from the BFSVisitor type of the graph.
This is used by the algorithm to keep track of its progress through the graph. The type ColorMap must be a model of Read/Write Property Map and its key type must be the graph's vertex descriptor type and the value type of the color map must model ColorValue.UTIL: buffer(Buffer& Q)
Default: get(vertex_color, g)
Python: The color map must be a vertex_color_map for the graph.
The queue used to determine the order in which vertices will be discovered. If a FIFO queue is used, then the traversal will be according to the usual BFS ordering. Other types of queues can be used, but the traversal order will be different. For example Dijkstra's algorithm can be implemented using a priority queue. The type Buffer must be a model of Buffer.
Default: boost::queue
Python: The buffer must derive from the Buffer type for the graph.
The time complexity is O(E).
[1]
Since the visitor parameter is passed by value, if the visitor contains state
then any changes to the state during the algorithm will be made to a copy of the
visitor object, not the visitor object passed in. Therefore the user may want the
visitor to hold this state by pointer or reference.
CCopyright © 2000-2001 Jeremy Siek, Indiana University ([email protected]/A>)) |