JaCoP.constraints.netflow
Class Network

java.lang.Object
  extended by JaCoP.constraints.netflow.simplex.NetworkSimplex
      extended by JaCoP.constraints.netflow.Network
All Implemented Interfaces:
MutableNetwork
Direct Known Subclasses:
Pruning

public class Network
extends NetworkSimplex
implements MutableNetwork

This class extends the minimum-cost flow network by providing operations and data structures for removal and modification of arcs.

Version:
3.1
Author:
Robin Steiger and Radoslaw Szymanek

Field Summary
 long costOffset
          Cost due to deleted arcs
 java.util.List<Arc> deletedArcs
          List of deleted arcs (contains no duplicates)
 TimeStamp<java.lang.Integer> deletedSize
          Number of deleted arcs at each level
 java.util.LinkedHashSet<ArcCompanion> lastModifiedArcs
          Set of arcs modified at current level
 java.util.List<ArcCompanion> modifiedArcs
          List of modified arcs (may contain duplicates)
 TimeStamp<java.lang.Integer> modifiedSize
          Number of modified arcs at each level
 Store store
          The store
 
Fields inherited from class JaCoP.constraints.netflow.simplex.NetworkSimplex
allArcs, blocking, DEBUG, DEBUG_ALL, DELETED_ARC, infeasibleNodes, LARGE_COST, lower, nodes, numArcs, root, TREE_ARC
 
Constructor Summary
Network(java.util.List<Node> nodes, java.util.List<Arc> arcs)
           
 
Method Summary
 void backtrack()
           
 void changeCostOffset(long delta)
          Changes the cost offset by some value.
 long cost(long cutoff)
           
 int getStoreLevel()
          Retrieves the current store level for domain pruning.
 void increaseLevel()
           
 void initialize(Store store)
           
 void modified(ArcCompanion companion)
          Tells the network that an arc has been modified.
 boolean needsUpdate(int maxCost)
           
 void remove(Arc arc)
          Removes an arc from the network.
 
Methods inherited from class JaCoP.constraints.netflow.simplex.NetworkSimplex
addArcWithFlow, augmentFlow, dualPivot, networkSimplex, parametricStep, primalStep, print, removeArc, treeSwap, updateTree
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

deletedArcs

public final java.util.List<Arc> deletedArcs
List of deleted arcs (contains no duplicates)


deletedSize

public TimeStamp<java.lang.Integer> deletedSize
Number of deleted arcs at each level


costOffset

public long costOffset
Cost due to deleted arcs


modifiedArcs

public final java.util.List<ArcCompanion> modifiedArcs
List of modified arcs (may contain duplicates)


modifiedSize

public TimeStamp<java.lang.Integer> modifiedSize
Number of modified arcs at each level


lastModifiedArcs

public final java.util.LinkedHashSet<ArcCompanion> lastModifiedArcs
Set of arcs modified at current level


store

public Store store
The store

Constructor Detail

Network

public Network(java.util.List<Node> nodes,
               java.util.List<Arc> arcs)
Method Detail

initialize

public void initialize(Store store)

remove

public void remove(Arc arc)
Description copied from interface: MutableNetwork
Removes an arc from the network. The arc must be at its lower or upper bound before it can be removed.

Specified by:
remove in interface MutableNetwork
Parameters:
arc - The arc to be removed

modified

public void modified(ArcCompanion companion)
Description copied from interface: MutableNetwork
Tells the network that an arc has been modified. The network will then restore the arc upon backtracking.

Specified by:
modified in interface MutableNetwork
Parameters:
companion - The arc that was modified

increaseLevel

public void increaseLevel()

backtrack

public void backtrack()

changeCostOffset

public void changeCostOffset(long delta)
Description copied from interface: MutableNetwork
Changes the cost offset by some value.

Specified by:
changeCostOffset in interface MutableNetwork
Parameters:
delta - the change in cost

cost

public long cost(long cutoff)
Overrides:
cost in class NetworkSimplex

getStoreLevel

public int getStoreLevel()
Description copied from interface: MutableNetwork
Retrieves the current store level for domain pruning.

Specified by:
getStoreLevel in interface MutableNetwork
Returns:
the store level

needsUpdate

public boolean needsUpdate(int maxCost)