Class TSPTWDominance
java.lang.Object
org.ddolib.examples.nolayer.tsptw.TSPTWDominance
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionCreates a new dominance checker with an empty dominance front. -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the internally cached states used for dominance checking.booleanupdateDominance(TSPTWState state, double value) Evaluates if a state can be pruned based on previously seen states.
-
Constructor Details
-
TSPTWDominance
public TSPTWDominance()Creates a new dominance checker with an empty dominance front.
-
-
Method Details
-
updateDominance
Description copied from interface:NoLayerDominanceCheckerEvaluates if a state can be pruned based on previously seen states.- Specified by:
updateDominancein interfaceNoLayerDominanceChecker<TSPTWState>- Parameters:
state- the current state to checkvalue- the objective value associated with reaching the state- Returns:
trueif the state is dominated and should be pruned;falseotherwise
-
clear
public void clear()Description copied from interface:NoLayerDominanceCheckerClears the internally cached states used for dominance checking. This is useful to reset the checker's state between solver iterations.- Specified by:
clearin interfaceNoLayerDominanceChecker<TSPTWState>
-