Vcsn  2.3
Be Rational
vcsn::detail::scc_impl< Aut, tarjan_recursive_tag > Class Template Reference

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

#include <scc.hh>

Collaboration diagram for vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >:

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_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<Automaton Aut>
class vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >

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 411 of file scc.hh.

Member Typedef Documentation

template<Automaton Aut>
using vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::component_t = detail::component_t<Aut>

Definition at line 415 of file scc.hh.

template<Automaton Aut>
using vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::components_t = detail::components_t<Aut>

Definition at line 416 of file scc.hh.

template<Automaton Aut>
using vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::state_t = state_t_of<Aut>

Definition at line 414 of file scc.hh.

Constructor & Destructor Documentation

template<Automaton Aut>
vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::scc_impl ( const Aut &  aut)
inline

Definition at line 418 of file scc.hh.

Member Function Documentation

template<Automaton Aut>
const components_t& vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::components ( ) const
inline

Definition at line 426 of file scc.hh.

template<Automaton Aut>
void vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::dfs ( state_t  s)
inlineprivate

Definition at line 432 of file scc.hh.

References vcsn::has(), vcsn::min, and vcsn::detail::out().

Here is the call graph for this function:

Member Data Documentation

template<Automaton Aut>
Aut vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::aut_
private

Input automaton.

Definition at line 469 of file scc.hh.

template<Automaton Aut>
components_t vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::components_
private

All components.

Definition at line 474 of file scc.hh.

template<Automaton Aut>
std::size_t vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::curr_state_num_ = 0
private

The current visited state.

It used to preorder number counter.

Definition at line 472 of file scc.hh.

template<Automaton Aut>
std::unordered_map<state_t, std::size_t> vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::low_
private

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

Definition at line 479 of file scc.hh.

template<Automaton Aut>
std::unordered_set<state_t> vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::marked_
private

Visited states.

Definition at line 476 of file scc.hh.

template<Automaton Aut>
std::vector<state_t> vcsn::detail::scc_impl< Aut, tarjan_recursive_tag >::stack_
private

List of states in the same the component.

Definition at line 481 of file scc.hh.


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