src/main/java/de/dfki/lt/loot/fsa/FiniteAutomaton.java
public void removeDeadStates() {
    final BitSet visited = new BitSet();
    dfs(_initialState, new GraphVisitorAdapter<EdgeInfo>() {
      @Override
      public void discoverVertex(int v, Graph<EdgeInfo> g){
        visited.set(v);
      }
    });
    deleteIneffective(visited);
    DiGraph<EdgeInfo> converse = converseLazy();
    visited.clear();
    for (int fin : getFinalStates()) {
      converse.dfsConverse(fin, new GraphVisitorAdapter<EdgeInfo>() {
        @Override
        public void discoverVertex(int v, Graph<EdgeInfo> g){
          visited.set(v);
        }
      });
    }
    deleteIneffective(visited);
  }
/** Find all states that are effective in this FSA. Those have to be a)
   *  reachable from the start state and b) some final state must be reachable
   *  from them.
   *
   *  To compute this, do a forward DFS from the start state. All non-visited
   *  states are ineffective and can be deleted.
   *  Then, do a backwards DFS from all the end states. All non-visited states
   *  are ineffective.
   */
Find all states that are effective in this FSA. Those have to be a)
reachable from the start state and b) some final state must be reachable
from them.

To compute this, do a forward DFS from the start state. All non-visited
states are ineffective and can be deleted.
Then, do a backwards DFS from all the end states. All non-visited states
are ineffective.
Find all states that are effective in this FSA . Those have to be a ) reachable from the start state and b ) some final state must be reachable from them . To compute this do a forward DFS from the start state . All non - visited states are ineffective and can be deleted . Then do a backwards DFS from all the end states . All non - visited states are ineffective .
public void removeDeadStates() {
    final BitSet visited = new BitSet();
    dfs(_initialState, new GraphVisitorAdapter<EdgeInfo>() {
      @Override
      public void discoverVertex(int v, Graph<EdgeInfo> g){
        visited.set(v);
      }
    });
    deleteIneffective(visited);
    DiGraph<EdgeInfo> converse = converseLazy();
    visited.clear();
    for (int fin : getFinalStates()) {
      converse.dfsConverse(fin, new GraphVisitorAdapter<EdgeInfo>() {
        @Override
        public void discoverVertex(int v, Graph<EdgeInfo> g){
          visited.set(v);
        }
      });
    }
    deleteIneffective(visited);
  }
public void removeDeadStates ( ) { final BitSet visited = new BitSet ( ) ; dfs ( _initialState , new GraphVisitorAdapter < EdgeInfo > ( ) { @ Override public void discoverVertex ( int v , Graph < EdgeInfo > g ) { visited . set ( v ) ; } } ) ; deleteIneffective ( visited ) ; DiGraph < EdgeInfo > converse = converseLazy ( ) ; visited . clear ( ) ; for ( int fin : getFinalStates ( ) ) { converse . dfsConverse ( fin , new GraphVisitorAdapter < EdgeInfo > ( ) { @ Override public void discoverVertex ( int v , Graph < EdgeInfo > g ) { visited . set ( v ) ; } } ) ; } deleteIneffective ( visited ) ; }
Find all states that are effective in this FSA.
Find all states that are effective in this FSA .