Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
Class IntVertexDijkstraShortestPath.ArrayBasedSingleSourcePathsImpl
- java.lang.Object
-
- org.jgrapht.alg.shortestpath.IntVertexDijkstraShortestPath.ArrayBasedSingleSourcePathsImpl
-
- All Implemented Interfaces:
java.io.Serializable
,ShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>
- Enclosing class:
- IntVertexDijkstraShortestPath<E>
private class IntVertexDijkstraShortestPath.ArrayBasedSingleSourcePathsImpl extends java.lang.Object implements ShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>, java.io.Serializable
-
-
Field Summary
Fields Modifier and Type Field Description private double[]
dist
private IntVertexDijkstraShortestPath.IdentifierMap
idMap
private E[]
pred
private static long
serialVersionUID
private java.lang.Integer
source
-
Constructor Summary
Constructors Constructor Description ArrayBasedSingleSourcePathsImpl(java.lang.Integer source, double[] dist, E[] pred, IntVertexDijkstraShortestPath.IdentifierMap idMap)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Graph<java.lang.Integer,E>
getGraph()
Returns the graph over which this set of paths is defined.GraphPath<java.lang.Integer,E>
getPath(java.lang.Integer targetVertex)
Return the path from the source vertex to the sink vertex.java.lang.Integer
getSourceVertex()
Returns the single source vertex.double
getWeight(java.lang.Integer targetVertex)
Return the weight of the path from the source vertex to the sink vertex.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
source
private java.lang.Integer source
-
dist
private double[] dist
-
pred
private E[] pred
-
idMap
private IntVertexDijkstraShortestPath.IdentifierMap idMap
-
-
Constructor Detail
-
ArrayBasedSingleSourcePathsImpl
public ArrayBasedSingleSourcePathsImpl(java.lang.Integer source, double[] dist, E[] pred, IntVertexDijkstraShortestPath.IdentifierMap idMap)
-
-
Method Detail
-
getGraph
public Graph<java.lang.Integer,E> getGraph()
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Returns the graph over which this set of paths is defined.- Specified by:
getGraph
in interfaceShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>
- Returns:
- the graph
-
getSourceVertex
public java.lang.Integer getSourceVertex()
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Returns the single source vertex.- Specified by:
getSourceVertex
in interfaceShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>
- Returns:
- the single source vertex
-
getWeight
public double getWeight(java.lang.Integer targetVertex)
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<java.lang.Integer,E>
- Parameters:
targetVertex
- 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
public GraphPath<java.lang.Integer,E> getPath(java.lang.Integer targetVertex)
Description copied from interface:ShortestPathAlgorithm.SingleSourcePaths
Return the path from the source vertex to the sink vertex.- Specified by:
getPath
in interfaceShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>
- Parameters:
targetVertex
- the sink vertex- Returns:
- the path from the source vertex to the sink vertex or null if no such path exists
-
-