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[]distprivate IntVertexDijkstraShortestPath.IdentifierMapidMapprivate E[]predprivate static longserialVersionUIDprivate java.lang.Integersource
-
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.IntegergetSourceVertex()Returns the single source vertex.doublegetWeight(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.SingleSourcePathsReturns the graph over which this set of paths is defined.- Specified by:
getGraphin interfaceShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>- Returns:
- the graph
-
getSourceVertex
public java.lang.Integer getSourceVertex()
Description copied from interface:ShortestPathAlgorithm.SingleSourcePathsReturns the single source vertex.- Specified by:
getSourceVertexin interfaceShortestPathAlgorithm.SingleSourcePaths<java.lang.Integer,E>- Returns:
- the single source vertex
-
getWeight
public double getWeight(java.lang.Integer targetVertex)
Description copied from interface:ShortestPathAlgorithm.SingleSourcePathsReturn 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 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_INFINITYin case no such path exists
-
getPath
public GraphPath<java.lang.Integer,E> getPath(java.lang.Integer targetVertex)
Description copied from interface:ShortestPathAlgorithm.SingleSourcePathsReturn the path from the source vertex to the sink vertex.- Specified by:
getPathin 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
-
-