Package org.jgrapht.alg.shortestpath
Class ListSingleSourcePathsImpl<V,E>
- java.lang.Object
- 
- org.jgrapht.alg.shortestpath.ListSingleSourcePathsImpl<V,E>
 
- 
- Type Parameters:
- V- the graph vertex type
- E- the graph edge type
 - All Implemented Interfaces:
- Serializable,- ShortestPathAlgorithm.SingleSourcePaths<V,E>
 
 public class ListSingleSourcePathsImpl<V,E> extends Object implements ShortestPathAlgorithm.SingleSourcePaths<V,E>, Serializable An implementation ofShortestPathAlgorithm.SingleSourcePathswhich stores one path per vertex.This is an explicit representation which stores all paths. For a more compact representation see TreeSingleSourcePathsImpl.- Author:
- Dimitrios Michail
- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Graph<V,E>getGraph()Returns the graph over which this set of paths is defined.GraphPath<V,E>getPath(V targetVertex)Return the path from the source vertex to the sink vertex.VgetSourceVertex()Returns the single source vertex.doublegetWeight(V targetVertex)Return the weight of the path from the source vertex to the sink vertex.
 
- 
- 
- 
Method Detail- 
getGraphpublic Graph<V,E> getGraph() Returns the graph over which this set of paths is defined.- Specified by:
- getGraphin interface- ShortestPathAlgorithm.SingleSourcePaths<V,E>
- Returns:
- the graph
 
 - 
getSourceVertexpublic V getSourceVertex() Returns the single source vertex.- Specified by:
- getSourceVertexin interface- ShortestPathAlgorithm.SingleSourcePaths<V,E>
- Returns:
- the single source vertex
 
 - 
getWeightpublic double getWeight(V targetVertex) Return the weight of the path from the source vertex to the sink vertex. If no such path exists,Double.POSITIVE_INFINITYis returned. The weight of the path between a vertex and itself is always zero.- Specified by:
- getWeightin interface- ShortestPathAlgorithm.SingleSourcePaths<V,E>
- Parameters:
- targetVertex- the sink vertex
- Returns:
- the weight of the path between source and sink vertices or
         Double.POSITIVE_INFINITYin case no such path exists
 
 - 
getPathpublic GraphPath<V,E> getPath(V targetVertex) Return the path from the source vertex to the sink vertex.- Specified by:
- getPathin interface- ShortestPathAlgorithm.SingleSourcePaths<V,E>
- Parameters:
- targetVertex- the sink vertex
- Returns:
- the path from the source vertex to the sink vertex or null if no such path exists
 
 
- 
 
-