19 template<
typename GraphType,
typename OutputIter>
21 const typename GraphType::vertex_type& start,
25 typedef typename GraphType::vertex_type vertex_type;
29 std::queue<vertex_type> frontier;
34 while(!frontier.empty()) {
35 vertex_type inspect = frontier.front();
37 visited[inspect] =
true;
42 for(
auto it = G.avbegin(inspect); it != G.avend(inspect); it++)
49 template<
typename GraphType,
typename OutputIter>
51 const typename GraphType::vertex_type& start,
57 template<
typename GraphType,
typename OutputIter>
58 OutputIter
bfs(
const GraphType& G,
59 const typename GraphType::vertex_type& start,
69 for(
auto it = G.vbegin(); it != G.vend(); it++)
77 template<
typename GraphType,
typename OutputIter>
78 OutputIter
bfs(
const GraphType& G, OutputIter dest) {
79 return bfs(G, *G.vbegin(), dest);
Definition: graph_property.h:20
OutputIter single_bfs(const GraphType &G, const typename GraphType::vertex_type &start, OutputIter dest)
Definition: bfs.h:50
OutputIter bfs(const GraphType &G, const typename GraphType::vertex_type &start, OutputIter dest)
Definition: bfs.h:58
OutputIter _single_bfs(const GraphType &G, const typename GraphType::vertex_type &start, vertex_property< GraphType, bool > &visited, OutputIter dest)
Definition: bfs.h:20