Vertex i,
Vertex j,
int maxLength )
{
Set workingSet = new HashSet();
workingSet.add( new PathImpl( i ) );
for ( int k = 0; k < maxLength; k++ )
{
Iterator workingPaths = workingSet.iterator();
if ( !workingPaths.hasNext() )
{
break;
}
Set newWorkingSet = new HashSet();
while ( workingPaths.hasNext() )
{
PathImpl workingPath = (PathImpl) workingPaths.next();
Iterator outbound = graph.getOutbound( workingPath.getEnd() ).iterator();
while ( outbound.hasNext() )
{
Edge obEdge = (Edge) outbound.next();
if ( apsp.hasPath( graph.getTarget( obEdge ), j ) )
{
PathImpl path = workingPath.append( graph.getTarget( obEdge ), obEdge );
newWorkingSet.add( path );
if ( path.getEnd() == j )
{
listener.notifyPath( path );
}
}
}