public class DynamicOneToAllShortestPath extends NetworkSimplex
NetworkSimplex.ArcStatus, NetworkSimplex.PricingStrategy, NetworkSimplex.SolutionStatus
PREFIX
Constructor and Description |
---|
DynamicOneToAllShortestPath(java.lang.String costName) |
Modifier and Type | Method and Description |
---|---|
org.graphstream.graph.Path |
getPath(org.graphstream.graph.Node target)
Returns the shortest path from the source node to a given target node.
|
<T extends org.graphstream.graph.Edge> |
getPathEdges(org.graphstream.graph.Node target)
An iterable view of the edges on the shortest path from the source node
to a given target node.
|
<T extends org.graphstream.graph.Edge> |
getPathEdgesIterator(org.graphstream.graph.Node target)
This iterator traverses the edges on the shortest path from the source
node to a given target node.
|
long |
getPathLength(org.graphstream.graph.Node node) |
<T extends org.graphstream.graph.Node> |
getPathNodes(org.graphstream.graph.Node target)
An iterable view of the nodes on the shortest path from the source node
to a given target node.
|
<T extends org.graphstream.graph.Node> |
getPathNodesIterator(org.graphstream.graph.Node target)
This iterator traverses the nodes on the shortest path from the source
node to a given target node.
|
java.lang.String |
getSource() |
void |
init(org.graphstream.graph.Graph graph)
Initialization of the algorithm.
|
void |
nodeAdded(java.lang.String sourceId,
long timeId,
java.lang.String nodeId) |
void |
nodeRemoved(java.lang.String sourceId,
long timeId,
java.lang.String nodeId) |
void |
setSource(java.lang.String sourceId) |
compute, edgeAdded, edgeAttributeAdded, edgeAttributeChanged, edgeAttributeRemoved, edgeRemoved, getCapacityName, getCostName, getEdgeFromParent, getFlow, getFlow, getGraph, getInfeasibility, getNetworkBalance, getParent, getPricingStrategy, getSolutionCost, getSolutionInfeasibility, getSolutionStatus, getStatus, getStatus, getSupplyName, graphCleared, nodeAttributeAdded, nodeAttributeChanged, nodeAttributeRemoved, printBFS, setAnimationDelay, setLogFrequency, setLogStream, setPricingStrategy, setUIClasses, terminate
public DynamicOneToAllShortestPath(java.lang.String costName)
public java.lang.String getSource()
public void setSource(java.lang.String sourceId)
public void init(org.graphstream.graph.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(java.lang.String sourceId, long timeId, java.lang.String nodeId)
nodeAdded
in interface org.graphstream.stream.ElementSink
nodeAdded
in class NetworkSimplex
public void nodeRemoved(java.lang.String sourceId, long timeId, java.lang.String nodeId)
nodeRemoved
in interface org.graphstream.stream.ElementSink
nodeRemoved
in class NetworkSimplex
public long getPathLength(org.graphstream.graph.Node node)
public <T extends org.graphstream.graph.Node> java.util.Iterator<org.graphstream.graph.Node> getPathNodesIterator(org.graphstream.graph.Node target)
Iterator.remove()
.target
- a nodegetPathNodes(Node)
Iterator.next()
of this
iterator takes O(1) timepublic <T extends org.graphstream.graph.Node> java.lang.Iterable<org.graphstream.graph.Node> getPathNodes(org.graphstream.graph.Node target)
getPathNodesIterator(Node)
.target
- a nodegetPathNodesIterator(Node)
public <T extends org.graphstream.graph.Edge> java.util.Iterator<org.graphstream.graph.Edge> getPathEdgesIterator(org.graphstream.graph.Node target)
Iterator.remove()
.target
- a nodegetPathEdges(Node)
Iterator.next()
of this
iterator takes O(1) timepublic <T extends org.graphstream.graph.Edge> java.lang.Iterable<org.graphstream.graph.Edge> getPathEdges(org.graphstream.graph.Node target)
getPathEdgesIterator(Node)
.target
- a nodegetPathEdgesIterator(Node)
public org.graphstream.graph.Path getPath(org.graphstream.graph.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 node