bcds.phison.alg
Class ConnectedComponents<V,E>

java.lang.Object
  extended by bcds.phison.alg.ConnectedComponents<V,E>

public class ConnectedComponents<V,E>
extends java.lang.Object

Identifies the stronly connected components of a given SimGraph.

This is a transcription of the algorithm given in Wikipedia: Strongly Connected Components algorithm

Author:
Juan Segovia S.

Constructor Summary
ConnectedComponents(SimGraph<V,E> g)
          Instantiates a new object.
 
Method Summary
static
<V,E> ConnectedComponents<V,E>
make(SimGraph<V,E> g)
          A convenience constructor.
 java.util.List<java.util.Set<V>> stronglyConnectedComponents()
          Returns the list of the strongly connected components in the graph.
 java.util.List<java.util.Set<V>> stronglyConnectedComponents(V v)
          Returns the connected component to which the node v belongs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectedComponents

public ConnectedComponents(SimGraph<V,E> g)
Instantiates a new object.

Method Detail

make

public static <V,E> ConnectedComponents<V,E> make(SimGraph<V,E> g)
A convenience constructor.


stronglyConnectedComponents

public java.util.List<java.util.Set<V>> stronglyConnectedComponents()
Returns the list of the strongly connected components in the graph. Each connected component is a set of nodes.


stronglyConnectedComponents

public java.util.List<java.util.Set<V>> stronglyConnectedComponents(V v)
Returns the connected component to which the node v belongs.