|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.constraints.netflow.simplex.NetworkSimplex
public class NetworkSimplex
| Field Summary | |
|---|---|
java.util.List<Arc> |
allArcs
|
Arc |
blocking
|
static boolean |
DEBUG
|
static boolean |
DEBUG_ALL
|
static int |
DELETED_ARC
|
java.util.Set<Node> |
infeasibleNodes
|
static int |
LARGE_COST
|
Arc[] |
lower
|
Node[] |
nodes
|
int |
numArcs
|
Node |
root
|
static int |
TREE_ARC
|
| Constructor Summary | |
|---|---|
NetworkSimplex(java.util.List<Node> nodes,
java.util.List<Arc> arcs)
|
|
| Method Summary | |
|---|---|
void |
addArcWithFlow(Arc arc)
|
int |
augmentFlow(Node from,
Node to,
int delta)
Augments the flow between two nodes by the maximum amount along the unique tree path that connects these nodes. |
long |
cost(long cutoff)
|
boolean |
dualPivot(Arc leaving)
|
int |
networkSimplex(int maxPivots)
|
int |
parametricStep(Node source,
Node sink,
int balance,
int maxPivots)
Given an optimal flow that satisfies all feasibility constraints except mass balance on two nodes, the parametric simplex algorithm tries to achieve feasibility while keeping the solution optimal. |
void |
primalStep(Arc entering)
Performs a primal pivot. |
void |
print()
Debug |
void |
removeArc(Arc arc)
|
void |
treeSwap(Node a,
Node b,
Node c)
TODO prove (or disprove) correctness TODO can be 'inlined' in updateTree (but that would decrease readability) Changes the parent of a node and updates the thread data structure (This operation invalidates the depth values in the subtree) Runs in O(T2) amortized time over all treeSwaps performed by an updateTree operation where T2 is the size of the subtree that is being reversed. |
void |
updateTree(Arc leaving,
Arc entering)
TODO prove (or disprove) correctness (and efficiency) Both arcs must form a cycle in the tree and point in the same direction on that cycle. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean DEBUG
public static final boolean DEBUG_ALL
public static final int LARGE_COST
public static final int TREE_ARC
public static final int DELETED_ARC
public final Node root
public final Node[] nodes
public final Arc[] lower
public int numArcs
public Arc blocking
public final java.util.Set<Node> infeasibleNodes
public final java.util.List<Arc> allArcs
| Constructor Detail |
|---|
public NetworkSimplex(java.util.List<Node> nodes,
java.util.List<Arc> arcs)
| Method Detail |
|---|
public void addArcWithFlow(Arc arc)
public void removeArc(Arc arc)
public int networkSimplex(int maxPivots)
maxPivots -
public void primalStep(Arc entering)
entering - a non-tree arc that violates optimality
public int augmentFlow(Node from,
Node to,
int delta)
from - the source of the flowto - the sink of the flowdelta - an upper limit on the flow to send
public void updateTree(Arc leaving,
Arc entering)
leaving - the tree arc that leaves the treeentering - the non-tree arc that enters the tree
public void treeSwap(Node a,
Node b,
Node c)
a - the old parent of ab - the child nodec - the new parent of a
public int parametricStep(Node source,
Node sink,
int balance,
int maxPivots)
source - sink - balance - the flow to send from the source to the sinkmaxPivots - limits the number of dual pivots
public boolean dualPivot(Arc leaving)
public long cost(long cutoff)
public void print()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||