-
- typedef std::vector<typename GT::NodeType*> super;
- typedef typename super::iterator iterator;
- typedef typename super::const_iterator const_iterator;
- typedef typename super::reverse_iterator reverse_iterator;
- typedef typename super::const_reverse_iterator const_reverse_iterator;
-
- // HasLoop() -- Test if this SCC has a loop. If it has more than one
- // node, this is trivially true. If not, it may still contain a loop
- // if the node has an edge back to itself.
- bool HasLoop() const {
- if (size() > 1) return true;
- NodeType* N = front();
- for (ChildItTy CI=GT::child_begin(N), CE=GT::child_end(N); CI != CE; ++CI)
- if (*CI == N)
- return true;
- return false;
- }
-};
-
-//--------------------------------------------------------------------------
-// class TarjanSCC_iterator: Enumerate the SCCs of a directed graph, in
-// reverse topological order of the SCC DAG.
-//--------------------------------------------------------------------------
-
-namespace {
- Statistic<> NumSCCs("NumSCCs", "Number of Strongly Connected Components");
- Statistic<> MaxSCCSize("MaxSCCSize", "Size of largest Strongly Connected Component");
-}
-
-template<class GraphT, class GT = GraphTraits<GraphT> >
-class TarjanSCC_iterator : public forward_iterator<SCC<GraphT, GT>, ptrdiff_t>
-{
- typedef SCC<GraphT, GT> SccTy;
- typedef forward_iterator<SccTy, ptrdiff_t> super;
+ typedef std::vector<NodeType*> SccTy;
+ typedef std::iterator<std::forward_iterator_tag,
+ std::vector<typename GT::NodeType>, ptrdiff_t> super;