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:
Serializable
,ShortestPathAlgorithm.SingleSourcePaths<V,
E>
- Enclosing class:
YenShortestPathIterator<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
FieldsModifier and TypeFieldDescriptionEdges which are masked in theg
.Vertices which are masked in theg
.Fields inherited from class org.jgrapht.alg.shortestpath.TreeSingleSourcePathsImpl
g, map, source
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
Updates the distance of relevant predecessors of the input vertex.(package private) void
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
-
Field Details
-
maskedVertices
Vertices which are masked in theg
. -
maskedEdges
Edges which are masked in theg
.
-
-
Constructor Details
-
YenShortestPathsTree
YenShortestPathsTree(Graph<V, E> maskSubgraph, Set<V> maskedVertices, Set<E> maskedEdges, Map<V, Pair<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 Details
-
recoverVertex
Restores vertexv
in theg
.- Parameters:
v
- vertex to be recovered
-
recoverEdge
Restores edgee
in theg
.- Parameters:
e
- edge to be recovered
-
correctDistanceForward
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
Updates the distance of relevant predecessors of the input vertex.- Parameters:
v
- vertex which distance should be updated
-