18 for (
verti v = 0; v < g.
V(); ++v)
23 res += (dir < 0) ? (*it < v) :
24 (dir > 0) ? (*it > v) : (*it == v);
34 std::queue<verti> queue;
36 for (
verti root = 0; root < graph.
V(); ++root)
41 while (!queue.empty())
43 verti v = queue.front();
57 assert(new_v == graph.
V());
64 std::stack<std::pair<verti, StaticGraph::const_iterator> > stack;
66 for (
verti root = 0; root < graph.
V(); ++root)
70 stack.push(std::make_pair(root, graph.
succ_begin(root)));
71 while (!stack.empty())
73 verti v = stack.top().first;
85 stack.push(std::make_pair(w, graph.
succ_begin(w)));
90 assert(new_v == graph.
V());
void get_dfs_order(const StaticGraph &graph, std::vector< verti > &perm)
edgei count_ordered_edges(const StaticGraph &g, int dir)
void get_bfs_order(const StaticGraph &graph, std::vector< verti > &perm)
Functions to analyze vertex order in a static graph.
std::size_t edgei
type used to number edges
std::size_t verti
type used to number vertices
const_iterator succ_end(verti v) const
const_iterator succ_begin(verti v) const
const verti * const_iterator