Module org.jgrapht.core
Package org.jgrapht.alg.shortestpath
Class YenShortestPathIterator.YenShortestPathsTree
- java.lang.Object
-
- org.jgrapht.alg.shortestpath.TreeSingleSourcePathsImpl<V,E>
-
- org.jgrapht.alg.shortestpath.YenShortestPathIterator.YenShortestPathsTree
-
- All Implemented Interfaces:
java.io.Serializable
,ShortestPathAlgorithm.SingleSourcePaths<V,E>
- Enclosing class:
- YenShortestPathIterator<V,E>
class YenShortestPathIterator.YenShortestPathsTree extends TreeSingleSourcePathsImpl<V,E>
Helper class which represents the shortest paths tree using which the spur parts are computed and appended to the candidate paths
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.Set<E>
maskedEdges
Edges which are masked in theg
.(package private) java.util.Set<V>
maskedVertices
Vertices which are masked in theg
.-
Fields inherited from class org.jgrapht.alg.shortestpath.TreeSingleSourcePathsImpl
g, map, source
-
-
Constructor Summary
Constructors Constructor Description YenShortestPathsTree(Graph<V,E> maskSubgraph, java.util.Set<V> maskedVertices, java.util.Set<E> maskedEdges, java.util.Map<V,Pair<java.lang.Double,E>> reversedTree, V treeSource)
Constructs an instance of the shortest paths tree for the givenmaskSubgraph
,maskedVertices
,maskedEdges
,reversedTree
,treeSource
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
correctDistanceBackward(V v)
Updates the distance of relevant predecessors of the input vertex.(package private) void
correctDistanceForward(V v)
Updates the distance of provided vertexv
in the shortest paths tree based on the current distances of its successors in theg
.(package private) void
recoverEdge(E e)
Restores edgee
in theg
.(package private) void
recoverVertex(V v)
Restores vertexv
in theg
.-
Methods inherited from class org.jgrapht.alg.shortestpath.TreeSingleSourcePathsImpl
getDistanceAndPredecessorMap, getGraph, getPath, getSourceVertex, getWeight
-
-
-
-
Constructor Detail
-
YenShortestPathsTree
YenShortestPathsTree(Graph<V,E> maskSubgraph, java.util.Set<V> maskedVertices, java.util.Set<E> maskedEdges, java.util.Map<V,Pair<java.lang.Double,E>> reversedTree, V treeSource)
Constructs an instance of the shortest paths tree for the givenmaskSubgraph
,maskedVertices
,maskedEdges
,reversedTree
,treeSource
.- Parameters:
maskSubgraph
- graph which has removed vertices and edgesmaskedVertices
- vertices removed form the graphmaskedEdges
- edges removed from the graphreversedTree
- shortest path tree in the edge reversedmaskSubgraph
starting attreeSource
.treeSource
- source vertex of thereversedTree
-
-
Method Detail
-
recoverVertex
void recoverVertex(V v)
Restores vertexv
in theg
.- Parameters:
v
- vertex to be recovered
-
recoverEdge
void recoverEdge(E e)
Restores edgee
in theg
.- Parameters:
e
- edge to be recovered
-
correctDistanceForward
void correctDistanceForward(V v)
Updates the distance of provided vertexv
in the shortest paths tree based on the current distances of its successors in theg
.- Parameters:
v
- vertex which should be updated
-
correctDistanceBackward
void correctDistanceBackward(V v)
Updates the distance of relevant predecessors of the input vertex.- Parameters:
v
- vertex which distance should be updated
-
-