30 #ifndef __CLAW_GRAPH_ALGORITHM_HPP__ 31 #define __CLAW_GRAPH_ALGORITHM_HPP__ 42 template <
class Graph>
46 typedef typename Graph::vertex_type vertex_type;
49 void init(
const Graph& g)
51 void start_vertex(
const vertex_type& v)
53 void visit_edge(
const vertex_type& v1,
const vertex_type& v2)
55 void end_vertex(
const vertex_type& v)
65 template <
class Graph,
class Events = scan_events<Graph> >
69 typedef typename Graph::vertex_type vertex_type;
70 typedef typename Graph::vertex_iterator vertex_iterator;
77 typedef std::map<vertex_type, int, typename Graph::vertex_compare>
81 breadth_scan(
const Graph& g,
const vertex_type& source, Events& events);
87 const vertex_type& m_source;
97 template <
class Graph,
class Events =
typename Graph::scan_events>
101 typedef typename Graph::vertex_type vertex_type;
102 typedef typename Graph::vertex_iterator vertex_iterator;
109 typedef std::map<vertex_type, int, typename Graph::vertex_compare>
118 void recursive_scan(
const vertex_type& s,
coloration& seen_vertices);
135 template <
class Graph>
139 typedef typename scan_events<Graph>::vertex_type vertex_type;
140 typedef std::vector<vertex_type> result_type;
141 typedef typename result_type::const_iterator const_iterator;
145 void init(
const Graph& g);
146 void end_vertex(
const vertex_type& s);
148 void operator()(
const Graph& g);
149 const vertex_type& operator[](
unsigned int index)
const;
151 const_iterator begin()
const;
152 const_iterator end()
const;
156 result_type m_result;
163 #include <claw/graph_algorithm.tpp> 165 #endif // __CLAW_GRAPH_ALGORITHM_HPP__ This class performs a depth scan of a graph. All nodes are proceeded.
std::map< vertex_type, int, typename Graph::vertex_compare > coloration
Colors are :
std::map< vertex_type, int, typename Graph::vertex_compare > coloration
Colors are :
This class performs a depth scan of a graph. Only reachables vertices from a given vertex are proceed...
Pass this class as the "Envents" template parameter of the depth scan class to sort the vertices of a...
This is the main namespace.
Different stages of graph scanning.