public class Network<V extends Node,E extends Arc> extends SimpleGraph<V,E>
Arc
s have a weight
and a flow value.
checkFlowConservationCondition()
.SimpleGraph
Constructor and Description |
---|
Network(FlowType type,
V source,
V sink)
Creates a new network.
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkFlowConservationCondition()
Checks if the flow conservation condition of the current state of the network is fulfilled.
|
void |
determineExcesses()
Determines the excess of all nodes of the network.
|
float |
getFlowStrength()
Gets the strength of the flow.
|
FlowType |
getFlowType()
Gets the type of the flow in the network.
|
ResidualNetwork |
getResidualNetwork()
Gets the residual network of the current state of the network.
|
V |
getSink()
Gets the sink node of the network.
|
V |
getSource()
Gets the source node of the network.
|
protected boolean |
isRemovable(V v)
Indicates if the given vertex may be removed.
|
containsEdge, isEdgeAllowed
add, add, afterEdgeAdded, afterEdgeRemoved, afterVertexAdded, afterVertexRemoved, beforeEdgeAdded, beforeVertexAdded, contains, contains, containsVertex, equals, equals, getEdge, getEdge, getEdge, getEdgeByID, getEdgeByIDSet, getEdges, getEdges, getEdgeSet, getOrder, getSize, getType, getVertex, getVertexByCaption, getVertexByID, getVertexByIDSet, getVertexSet, isRemovable, isVertexAllowed, remove, remove, removeAll, toString
public Network(FlowType type, V source, V sink) throws java.lang.IllegalArgumentException
Graph.add(Vertex)
.type
- the type of the flow in the networksource
- the source nodesink
- the sink nodejava.lang.IllegalArgumentException
- public final FlowType getFlowType()
public final V getSource()
public final V getSink()
public void determineExcesses()
Node.determineExcess(Node)
public boolean checkFlowConservationCondition()
FlowType
is FlowType.FLOW
:FlowType
is FlowType.PREFLOW
it means:true
if the flow conservation condition is fulfilled otherwise false
public ResidualNetwork getResidualNetwork()
public float getFlowStrength()