Class TSPTWDominance

java.lang.Object
org.ddolib.examples.nolayer.tsptw.TSPTWDominance
All Implemented Interfaces:
NoLayerDominanceChecker<TSPTWState>

public class TSPTWDominance extends Object implements NoLayerDominanceChecker<TSPTWState>
Dominance checker for the Traveling Salesman Problem with Time Windows (TSPTW), using the no-layer modeling API.

Two states with the same current city and the same set of cities still to visit are comparable; among those, the state with the earlier arrival time and lower cost dominates the other.

  • Constructor Details

    • TSPTWDominance

      public TSPTWDominance()
      Creates a new dominance checker with an empty dominance front.
  • Method Details

    • updateDominance

      public boolean updateDominance(TSPTWState state, double value)
      Description copied from interface: NoLayerDominanceChecker
      Evaluates if a state can be pruned based on previously seen states.
      Specified by:
      updateDominance in interface NoLayerDominanceChecker<TSPTWState>
      Parameters:
      state - the current state to check
      value - the objective value associated with reaching the state
      Returns:
      true if the state is dominated and should be pruned; false otherwise
    • clear

      public void clear()
      Description copied from interface: NoLayerDominanceChecker
      Clears the internally cached states used for dominance checking. This is useful to reset the checker's state between solver iterations.
      Specified by:
      clear in interface NoLayerDominanceChecker<TSPTWState>