public class DynamicOneToAllShortestPath extends NetworkSimplex
Modifier and Type | Class and Description |
---|---|
protected class |
DynamicOneToAllShortestPath.EdgeIterator<T extends Edge> |
protected class |
DynamicOneToAllShortestPath.NodeIterator<T extends Node> |
NetworkSimplex.ArcStatus, NetworkSimplex.NSArc, NetworkSimplex.NSNode, NetworkSimplex.PricingStrategy, NetworkSimplex.SolutionStatus
Modifier and Type | Field and Description |
---|---|
protected String |
sourceId |
animationDelay, arcs, capacityName, costName, cycleFlowChange, enteringArc, first, fromSink, graph, INFINITE_CAPACITY, join, leavingArc, log, logFreq, newSubtreeRoot, nodes, nonBasicArcs, objectiveValue, oldSubtreeRoot, PREFIX, pricingStrategy, root, second, solutionStatus, supplyName, work1, work2
Constructor and Description |
---|
DynamicOneToAllShortestPath(String costName) |
Modifier and Type | Method and Description |
---|---|
protected void |
bfsFromDijkstra()
NS is much slower than Dijkstra when starting from a big graph.
|
protected void |
cloneGraph()
Creates copies of all graph arcs and edges.
|
Path |
getPath(Node target)
Returns the shortest path from the source node to a given target node.
|
<T extends Edge> |
getPathEdges(Node target)
An iterable view of the edges on the shortest path from the source node
to a given target node.
|
<T extends Edge> |
getPathEdgesIterator(Node target)
This iterator traverses the edges on the shortest path from the source
node to a given target node.
|
long |
getPathLength(Node node) |
<T extends Node> |
getPathNodes(Node target)
An iterable view of the nodes on the shortest path from the source node
to a given target node.
|
<T extends Node> |
getPathNodesIterator(Node target)
This iterator traverses the nodes on the shortest path from the source
node to a given target node.
|
String |
getSource() |
void |
init(Graph graph)
Initialization of the algorithm.
|
void |
nodeAdded(String sourceId,
long timeId,
String nodeId)
A node was inserted in the given graph.
|
void |
nodeRemoved(String sourceId,
long timeId,
String nodeId)
A node was removed from the graph.
|
void |
setSource(String sourceId) |
addArc, addNode, changeCapacity, changeCost, changeFlows, changeSupply, clearGraph, compute, createInitialBFS, edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, findJoinNode, getCapacityName, getCostName, getEdgeFromParent, getFlow, getFlow, getGraph, getInfeasibility, getNetworkBalance, getParent, getPricingStrategy, getSolutionCost, getSolutionInfeasibility, getSolutionStatus, getStatus, getStatus, getSupplyName, graphCleared, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, objectToDouble, pivot, printBFS, removeArc, removeNode, selectEnteringArc, selectEnteringArcFirstNegative, selectEnteringArcMostNegative, selectLeavingArc, setAnimationDelay, setLogFrequency, setLogStream, setPricingStrategy, setUIClasses, simplex, terminate, updateBFS
graphAttributeAdded, graphAttributeChanged, graphAttributeRemoved, stepBegins
public DynamicOneToAllShortestPath(String costName)
protected void cloneGraph()
NetworkSimplex
NetworkSimplex.nodes
and NetworkSimplex.arcs
.cloneGraph
in class NetworkSimplex
protected void bfsFromDijkstra()
NetworkSimplex.createInitialBFS()
.public void init(Graph graph)
Algorithm
Algorithm.compute()
method to initialize or reset the algorithm according
to the new given graph.init
in interface Algorithm
init
in class NetworkSimplex
graph
- The graph this algorithm is using.public void nodeAdded(String sourceId, long timeId, String nodeId)
ElementSink
nodeAdded
in interface ElementSink
nodeAdded
in class NetworkSimplex
sourceId
- Identifier of the graph where the node was added.nodeId
- Identifier of the added node.public void nodeRemoved(String sourceId, long timeId, String nodeId)
ElementSink
nodeRemoved
in interface ElementSink
nodeRemoved
in class NetworkSimplex
sourceId
- Identifier of the graph where the node will be removed.nodeId
- Identifier of the removed node.public long getPathLength(Node node)
public <T extends Node> Iterator<T> getPathNodesIterator(Node target)
Iterator.remove()
.target
- a nodegetPathNodes(Node)
public <T extends Node> Iterable<T> getPathNodes(Node target)
getPathNodesIterator(Node)
.target
- a nodegetPathNodesIterator(Node)
public <T extends Edge> Iterator<T> getPathEdgesIterator(Node target)
Iterator.remove()
.target
- a nodegetPathEdges(Node)
public <T extends Edge> Iterable<T> getPathEdges(Node target)
getPathEdgesIterator(Node)
.target
- a nodegetPathEdgesIterator(Node)
public Path getPath(Node target)
Path
object which
consumes heap memory proportional to the number of edges and nodes in the
path. When possible, prefer using getPathNodes(Node)
and
getPathEdges(Node)
which are more memory- and time-efficient.target
- a nodeWebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses