Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
Class EppsteinShortestPathIterator.EppsteinGraphPath
- java.lang.Object
-
- org.jgrapht.alg.shortestpath.EppsteinShortestPathIterator.EppsteinGraphPath
-
- All Implemented Interfaces:
java.lang.Comparable<EppsteinShortestPathIterator.EppsteinGraphPath>
,GraphPath<V,E>
- Enclosing class:
- EppsteinShortestPathIterator<V,E>
private class EppsteinShortestPathIterator.EppsteinGraphPath extends java.lang.Object implements GraphPath<V,E>, java.lang.Comparable<EppsteinShortestPathIterator.EppsteinGraphPath>
Represents a path that is generated during the computations.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<V,Pair<java.lang.Double,E>>
distanceAndPredecessorMap
Shortest paths tree in the edge reversed graphgraph
rooted atsink
.private Graph<V,E>
graph
The graph.private java.util.List<EppsteinShortestPathIterator.PathsGraphVertex>
pathsGraphVertices
Vertices of the paths graph this path corresponds to.private double
weight
Weight of tha path.
-
Constructor Summary
Constructors Constructor Description EppsteinGraphPath(Graph<V,E> graph, java.util.List<EppsteinShortestPathIterator.PathsGraphVertex> pathsGraphVertices, java.util.Map<V,Pair<java.lang.Double,E>> distanceAndPredecessorMap, double weight)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(EppsteinShortestPathIterator.EppsteinGraphPath o)
java.util.List<E>
getEdgeList()
Given the implicit representation of the path betweensource
andsink
constructs the edge list of the path.V
getEndVertex()
Returns the end vertex in the path.Graph<V,E>
getGraph()
Returns the graph over which this path is defined.private java.util.List<EppsteinShortestPathIterator.PathsGraphVertex>
getSidetracks(java.util.List<EppsteinShortestPathIterator.PathsGraphVertex> vertices)
Builds sequence of sidetracks in thegraph
this path corresponds to.V
getStartVertex()
Returns the start vertex in the path.double
getWeight()
Returns the weight assigned to the path.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jgrapht.GraphPath
getLength, getVertexList
-
-
-
-
Field Detail
-
pathsGraphVertices
private java.util.List<EppsteinShortestPathIterator.PathsGraphVertex> pathsGraphVertices
Vertices of the paths graph this path corresponds to.
-
distanceAndPredecessorMap
private java.util.Map<V,Pair<java.lang.Double,E>> distanceAndPredecessorMap
Shortest paths tree in the edge reversed graphgraph
rooted atsink
.
-
weight
private double weight
Weight of tha path.
-
-
Method Detail
-
getGraph
public Graph<V,E> getGraph()
Description copied from interface:GraphPath
Returns the graph over which this path is defined. The path may also be valid with respect to other graphs.
-
getStartVertex
public V getStartVertex()
Description copied from interface:GraphPath
Returns the start vertex in the path.- Specified by:
getStartVertex
in interfaceGraphPath<V,E>
- Returns:
- the start vertex
-
getEndVertex
public V getEndVertex()
Description copied from interface:GraphPath
Returns the end vertex in the path.- Specified by:
getEndVertex
in interfaceGraphPath<V,E>
- Returns:
- the end vertex
-
getWeight
public double getWeight()
Description copied from interface:GraphPath
Returns the weight assigned to the path. Typically, this will be the sum of the weights of the edge list entries (as defined by the containing graph), but some path implementations may use other definitions.
-
getEdgeList
public java.util.List<E> getEdgeList()
Given the implicit representation of the path betweensource
andsink
constructs the edge list of the path.- Specified by:
getEdgeList
in interfaceGraphPath<V,E>
- Returns:
- edge list of the path
-
getSidetracks
private java.util.List<EppsteinShortestPathIterator.PathsGraphVertex> getSidetracks(java.util.List<EppsteinShortestPathIterator.PathsGraphVertex> vertices)
Builds sequence of sidetracks in thegraph
this path corresponds to.- Parameters:
vertices
- vertices of the paths graph- Returns:
- list of sidetracks
-
compareTo
public int compareTo(EppsteinShortestPathIterator.EppsteinGraphPath o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<EppsteinShortestPathIterator.EppsteinGraphPath>
-
-