Vcsn  2.1
Be Rational
vcsn::detail::scc_tarjan_recursive_impl< Aut > Class Template Reference

Tarjan's algorithm to find all strongly connected components: recursive implementation. More...

#include <scc.hh>

Collaboration diagram for vcsn::detail::scc_tarjan_recursive_impl< Aut >:

Public Types

using state_t = state_t_of< Aut >
 
using component_t = detail::component_t< Aut >
 
using components_t = detail::components_t< Aut >
 

Public Member Functions

 scc_tarjan_recursive_impl (const Aut &aut)
 
const components_tcomponents () const
 

Private Member Functions

void dfs (state_t s)
 

Private Attributes

Aut aut_
 Input automaton. More...
 
std::size_t curr_state_num_ = 0
 The current visited state. More...
 
components_t components_
 All components. More...
 
std::unordered_set< state_tmarked_
 Visited states. More...
 
std::unordered_map< state_t, std::size_t > low_
 low_[s] is minimum of low_{X}, with X is all states on output transitions of s. More...
 
std::vector< state_tstack_
 List of states in the same the component. More...
 

Detailed Description

template<typename Aut>
class vcsn::detail::scc_tarjan_recursive_impl< Aut >

Tarjan's algorithm to find all strongly connected components: recursive implementation.

Often slightly faster than the iterative implementation, but may overflow the stack.

Definition at line 384 of file scc.hh.

Member Typedef Documentation

template<typename Aut >
using vcsn::detail::scc_tarjan_recursive_impl< Aut >::component_t = detail::component_t<Aut>

Definition at line 388 of file scc.hh.

template<typename Aut >
using vcsn::detail::scc_tarjan_recursive_impl< Aut >::components_t = detail::components_t<Aut>

Definition at line 389 of file scc.hh.

template<typename Aut >
using vcsn::detail::scc_tarjan_recursive_impl< Aut >::state_t = state_t_of<Aut>

Definition at line 387 of file scc.hh.

Constructor & Destructor Documentation

template<typename Aut >
vcsn::detail::scc_tarjan_recursive_impl< Aut >::scc_tarjan_recursive_impl ( const Aut &  aut)
inline

Definition at line 391 of file scc.hh.

Member Function Documentation

template<typename Aut >
const components_t& vcsn::detail::scc_tarjan_recursive_impl< Aut >::components ( ) const
inline
template<typename Aut >
void vcsn::detail::scc_tarjan_recursive_impl< Aut >::dfs ( state_t  s)
inlineprivate

Definition at line 405 of file scc.hh.

References vcsn::has(), and vcsn::detail::scc_tarjan_recursive_impl< Aut >::marked_.

Here is the call graph for this function:

Member Data Documentation

template<typename Aut >
Aut vcsn::detail::scc_tarjan_recursive_impl< Aut >::aut_
private

Input automaton.

Definition at line 442 of file scc.hh.

template<typename Aut >
components_t vcsn::detail::scc_tarjan_recursive_impl< Aut >::components_
private

All components.

Definition at line 447 of file scc.hh.

Referenced by vcsn::detail::scc_tarjan_recursive_impl< Aut >::components().

template<typename Aut >
std::size_t vcsn::detail::scc_tarjan_recursive_impl< Aut >::curr_state_num_ = 0
private

The current visited state.

It used to preorder number counter.

Definition at line 445 of file scc.hh.

template<typename Aut >
std::unordered_map<state_t, std::size_t> vcsn::detail::scc_tarjan_recursive_impl< Aut >::low_
private

low_[s] is minimum of low_{X}, with X is all states on output transitions of s.

Definition at line 452 of file scc.hh.

template<typename Aut >
std::unordered_set<state_t> vcsn::detail::scc_tarjan_recursive_impl< Aut >::marked_
private

Visited states.

Definition at line 449 of file scc.hh.

Referenced by vcsn::detail::scc_tarjan_recursive_impl< Aut >::dfs().

template<typename Aut >
std::vector<state_t> vcsn::detail::scc_tarjan_recursive_impl< Aut >::stack_
private

List of states in the same the component.

Definition at line 454 of file scc.hh.


The documentation for this class was generated from the following file: