Class 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:
    4.8
    • 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)
      • add

        private void add​(Arc arc)
      • 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()
      • restore

        private void restore​(ArcCompanion companion)
      • 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
      • 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)