Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
Class JohnsonShortestPaths.JohnsonSingleSourcePaths
java.lang.Object
org.jgrapht.alg.shortestpath.JohnsonShortestPaths.JohnsonSingleSourcePaths
- All Implemented Interfaces:
ShortestPathAlgorithm.SingleSourcePaths<V,
E>
- Enclosing class:
JohnsonShortestPaths<V,
E>
class JohnsonShortestPaths.JohnsonSingleSourcePaths
extends Object
implements ShortestPathAlgorithm.SingleSourcePaths<V,E>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGraph()
Returns the graph over which this set of paths is defined.Return the path from the source vertex to the sink vertex.Returns the single source vertex.double
Return the weight of the path from the source vertex to the sink vertex.
-
Field Details
-
source
-
-
Constructor Details
-
JohnsonSingleSourcePaths
-
-
Method Details
-
getGraph
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Returns the graph over which this set of paths is defined.- Specified by:
getGraph
in interfaceShortestPathAlgorithm.SingleSourcePaths<V,
E> - Returns:
- the graph
-
getSourceVertex
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Returns the single source vertex.- Specified by:
getSourceVertex
in interfaceShortestPathAlgorithm.SingleSourcePaths<V,
E> - Returns:
- the single source vertex
-
getWeight
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Return the weight of the path from the source vertex to the sink vertex. If no such path exists,Double.POSITIVE_INFINITY
is returned. The weight of the path between a vertex and itself is always zero.- Specified by:
getWeight
in interfaceShortestPathAlgorithm.SingleSourcePaths<V,
E> - Parameters:
sink
- the sink vertex- Returns:
- the weight of the path between source and sink vertices or
Double.POSITIVE_INFINITY
in case no such path exists
-
getPath
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Return the path from the source vertex to the sink vertex.- Specified by:
getPath
in interfaceShortestPathAlgorithm.SingleSourcePaths<V,
E> - Parameters:
sink
- the sink vertex- Returns:
- the path from the source vertex to the sink vertex or null if no such path exists
-