|
Algorithm Development Kit 1.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectalgs.model.network.EdgeInfo
public class EdgeInfo
This class is used to model the edges of the graph which contains a network flow problem.
Public data members are not a problem since this information is finalized once created, and the 'flow' value can only be read externally; it can be written only by the algs.model.network package.
Note that the 'cost' attribute is needed in only a few of the network flow algorithms but it has been provided here to simplify the modeling of the various problems being solved by Ford-Fulkerson as well as the Maximum Flow, Minimum Cost problem.
Field Summary | |
---|---|
int |
capacity
Capacity over the edge. |
int |
cost
Shipping cost for this edge. |
int |
end
End of edge. |
int |
start
Start of edge. |
Constructor Summary | |
---|---|
EdgeInfo(int start,
int end,
int cap)
Construct EdgeInfo from (start,end) vertices with given capacity. |
|
EdgeInfo(int start,
int end,
int cap,
int cost)
Construct EdgeInfo from (start,end) vertices with given capacity. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
Support default equals protocol. |
int |
getFlow()
Return the flow computed by the algorithm. |
int |
hashCode()
Support hashCode protocol. |
java.lang.String |
toString()
Reasonable toString. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final int start
public final int end
public final int capacity
public final int cost
Constructor Detail |
---|
public EdgeInfo(int start, int end, int cap)
start
- start vertexend
- end vertexcap
- existing capacitypublic EdgeInfo(int start, int end, int cap, int cost)
start
- start vertexend
- end vertexcap
- existing capacitycost
- shipping cost for this edgeMethod Detail |
---|
public int getFlow()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
Algorithm Development Kit 1.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |