Savarese Software Research

com.savarese.algorithms.graph
Interface SingleSourcePath<V,W>


public interface SingleSourcePath<V,W>

A SingleSourcePath represents a solution to a single source path finding problem, containing one path from a single source vertex to one or more destinations.

Author:
Daniel F. Savarese

Method Summary
 W getDistance(V destination)
          Returns the distance to the given destination.
 void getPath(V destination, java.util.List<V> path)
          Appends a list of vertices which form a path between the source and given destination.
 V getSource()
          Returns the source vertex for each path.
 

Method Detail

getSource

V getSource()
Returns the source vertex for each path.

Returns:
The source vertex for each path.

getDistance

W getDistance(V destination)
Returns the distance to the given destination.

Parameters:
destination - The destination vertex.
Returns:
The distance to the given destination. The returned value will be null if there is no path between the source and destination.

getPath

void getPath(V destination,
             java.util.List<V> path)
Appends a list of vertices which form a path between the source and given destination.

Parameters:
destination - The destination vertex.
path - The list to which the path will be appended. No vertices will be appended if there is no path between the source and destination.

Savarese Software Research

Copyright © 2004-2005 Savarese Software Research and Daniel F. Savarese. All Rights Reserved.