Consider TSP with one domicile and one entity. CH builds best solution and then local search is performed. Say that local search termination is configured like this: <termination> <stepCountLimit>1</stepCountLimit> </termination> obviously, there is no move what planner could do, but that is a problem. If planner is in state, when there is no way out, it will stuck forever and nothing can terminate it except time termination.
There's no intrinsic requirement that a step should finish within x amount of time. But it would indeed be helpful that LocalSearch recognizes that there are no doable moves. I think it does if you configure a cacheType PHASE or STEP, instead of the default of JIT. It's not just doable moves, but also filtered moves that can cause this issue (although filtering has a bail-out). That case too only applies to JIT selection as far as I know. Jiri, could you verify that cacheType PHASE or STEP move selection don't suffer from this issue? That would worry me and I 'd fix that asap. As for JIT (the default cacheType), I currently don't see a reasonable way of fixing it (without killing the scalability gain of JIT selection).
Geoffrey, I think the easies way how to provide reproducer is just make little alternations on any TSP example you have. 1. take any TSP Solution instance and get rid of all locations, except two. So there will be only one Domicile and one Visit. 2. use this localSearch <localSearch> <termination> <stepCountLimit>1</stepCountLimit> </termination> <changeMoveSelector> <cacheType>PHASE</cacheType> </changeMoveSelector> </localSearch> 3. run solver. I hope this is enough to reproduce the problem.
Jiri, have you tried if it reproduces with cacheType PHASE or STEP? That would be a high priority bug. The fact that it reproduces with JIT selection, is a less important known issue (because it's intrinsic to JIT selection and any fix might be worse than the problem).
Created attachment 1008979 [details] reproducer just run mvn clean install there is 10 seconds timeout. One step on so little problem should take less than 10 seconds.