|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.mhhe.clrs2e.AdjacencyListGraph.Edge | +--com.mhhe.clrs2e.FlowNetwork.FlowNetworkEdge
Inner class for flow network edges in adjacency lists. Adjacency lists are singly linked.
Field Summary | |
private double |
capacity
The capacity c(u,v) of this edge (u,v). |
private double |
netFlow
The net flow f(u,v) for edge (u,v). |
private double |
residualCapacity
The residual capacity cHat(u,v) = c(u,v) - f(u,v) for edge (u,v). |
private FlowNetwork.FlowNetworkEdge |
reverseEdge
A reference to the reverse edge (v,u) for edge (u,v). |
Fields inherited from class com.mhhe.clrs2e.AdjacencyListGraph.Edge |
next, vertex |
Constructor Summary | |
FlowNetwork.FlowNetworkEdge(com.mhhe.clrs2e.Vertex v,
AdjacencyListGraph.Edge successor,
double cap)
Creates a new edge. |
Method Summary | |
double |
getCapacity()
Returns the capacity of this edge. |
double |
getNetFlow()
Returns the net flow for this edge. |
double |
getResidualCapacity()
Returns the residual capacity of this edge. |
void |
increaseNetFlow(double amount)
Increases the net flow on this edge by the given amount, decreases the net flow on the reverse edge by the same amount, and updates the residual capacities of this edge and the reverse edge. |
void |
setReverseEdge(FlowNetwork.FlowNetworkEdge e)
Sets the reference to the reverse edge. |
void |
zeroNetFlow()
Zeros out the net flow on this edge and its reverse and updates residual capacities on both edges. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final double capacity
private double netFlow
private double residualCapacity
private FlowNetwork.FlowNetworkEdge reverseEdge
Constructor Detail |
public FlowNetwork.FlowNetworkEdge(com.mhhe.clrs2e.Vertex v, AdjacencyListGraph.Edge successor, double cap)
reverseEdge
instance variable alone.
v
- The adjacent vertex.successor
- Successor edge to this one.cap
- The capacity of the new edge.Method Detail |
public double getCapacity()
public double getNetFlow()
public double getResidualCapacity()
public void setReverseEdge(FlowNetwork.FlowNetworkEdge e)
e
- The reverse edge.public void zeroNetFlow()
public void increaseNetFlow(double amount)
amount
- The amount by which this edge's flow is
increased and the reverse edge's flow is decreased.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |