public interface FlowAlgorithm extends Algorithm
Modifier and Type | Method and Description |
---|---|
double |
getCapacity(org.graphstream.graph.Node u,
org.graphstream.graph.Node v)
Get capacity of edge (u,v).
|
java.lang.String |
getCapacityAttribute()
Get the key attribute from which capacities are loaded.
|
double |
getFlow(org.graphstream.graph.Node u,
org.graphstream.graph.Node v)
Get flow value of edge (u,v).
|
java.lang.String |
getFlowSinkId()
Get id of the sink.
|
java.lang.String |
getFlowSourceId()
Get id of the source.
|
double |
getMaximumFlow()
Get maximum flow compute by
Algorithm.compute() . |
void |
init(org.graphstream.graph.Graph g,
java.lang.String sourceId,
java.lang.String sinkId)
Init the algorithm.
|
void |
setCapacity(org.graphstream.graph.Node u,
org.graphstream.graph.Node v,
double capacity)
Set capacity of (u,v).
|
void |
setCapacityAttribute(java.lang.String attribute)
Set the key of the attribute from which capacities will be loaded.
|
void |
setFlow(org.graphstream.graph.Node u,
org.graphstream.graph.Node v,
double flow)
Set flow of edge (u,v).
|
double getFlow(org.graphstream.graph.Node u, org.graphstream.graph.Node v)
u
- source nodev
- target nodevoid setFlow(org.graphstream.graph.Node u, org.graphstream.graph.Node v, double flow)
u
- source nodev
- target nodeflow
- new flowdouble getCapacity(org.graphstream.graph.Node u, org.graphstream.graph.Node v)
u
- source nodev
- target nodevoid setCapacity(org.graphstream.graph.Node u, org.graphstream.graph.Node v, double capacity)
init(Graph, String, String)
and Algorithm.compute()
.u
- source nodev
- target nodecapacity
- new capacity of (u,v)void setCapacityAttribute(java.lang.String attribute)
Algorithm.compute()
.attribute
- attribute namejava.lang.String getCapacityAttribute()
setCapacityAttribute(String)
double getMaximumFlow()
Algorithm.compute()
.java.lang.String getFlowSourceId()
java.lang.String getFlowSinkId()
void init(org.graphstream.graph.Graph g, java.lang.String sourceId, java.lang.String sinkId)
Algorithm.init(Graph)
method
of Algorithm so users just have to call this new method.g
- graph that should be used by the algorithmsourceId
- id of the source of the flowsinkId
- id of the sink of the flow