edu.umd.cs.findbugs.graph

Class StronglyConnectedComponents<GraphType,EdgeType,VertexType>

public class StronglyConnectedComponents<GraphType extends Graph<EdgeType,VertexType>,EdgeType extends GraphEdge<EdgeType,VertexType>,VertexType extends GraphVertex<VertexType>> extends Object

Algorithm to find strongly connected components in a graph. Based on algorithm in Cormen et. al., Introduction to Algorithms, p. 489.
Constructor Summary
StronglyConnectedComponents()
Constructor.
Method Summary
voidfindStronglyConnectedComponents(GraphType g, GraphToolkit<GraphType,EdgeType,VertexType> toolkit)
Find the strongly connected components in given graph.
Iterator<SearchTree<VertexType>>searchTreeIterator()
Returns an iterator over the search trees containing the vertices of each strongly connected component.
Iterator<Set<VertexType>>setIterator()
Returns an iterator over the sets of vertices of each strongly connected component.
voidsetVertexChooser(VertexChooser<VertexType> vertexChooser)
Specify a VertexChooser object to restrict which vertices are considered.

Constructor Detail

StronglyConnectedComponents

public StronglyConnectedComponents()
Constructor.

Method Detail

findStronglyConnectedComponents

public void findStronglyConnectedComponents(GraphType g, GraphToolkit<GraphType,EdgeType,VertexType> toolkit)
Find the strongly connected components in given graph.

Parameters: g the graph toolkit a GraphToolkit, used to create temporary graphs used by the algorithm

searchTreeIterator

public Iterator<SearchTree<VertexType>> searchTreeIterator()
Returns an iterator over the search trees containing the vertices of each strongly connected component.

Returns: an Iterator over a sequence of SearchTree objects

setIterator

public Iterator<Set<VertexType>> setIterator()
Returns an iterator over the sets of vertices of each strongly connected component.

Returns: an Iterator over a sequence of Set objects

setVertexChooser

public void setVertexChooser(VertexChooser<VertexType> vertexChooser)
Specify a VertexChooser object to restrict which vertices are considered. This is useful if you only want to find strongly connected components among a particular category of vertices.
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.