I'm using OptaPlanner to solve some plannig problems. I read the documentation and I'm not quite sure how does exactly Hill Climbing and Tabu Search algorithms work. What I'm unsure of is:
- does hill climbing pick only moves with THE BEST score that is BETTER than current one or does it allow to pick moves with THE BEST score that is NOT WORSE than the current one?
- does tabu search allow picking moves that have WORSE score than the current one if there is no move leading to a solution with better or equal score to the current one?
For Hill Climbing, see
HillClimbingAcceptor#isAccepted(...)
. It accepts any move that has a score that is better or equal to the lastest step score. And looking at the default forager config for hill climing (inLocalSearchPhaseConfig
, which saysforagerConfig.setAcceptedCountLimit(1);
), as soon as 1 move is accepted, it is the winning move.For Tabu Search, it will select moves that have a worse score, if:
acceptedCountLimit
is configured to1000
or so), no better move is seenPS: Hill Climbing sucks. There's never a good reason to not use Late Acceptance or Tabu Search instead.
PPS: Use the Benchmarker, do let HC, LA, TS, ... fight against each other. It will give you a lot of insight.