Interrupting and restarting the search
When solving large applications it is often not possible to enumerate the complete search tree within a reasonable time span. Several stopping criteria are therefore available in Xpress Kalis to interrupt the search. These are
- KALIS_MAX_BACKTRACKS
- maximum number of backtracks,
- KALIS_MAX_COMPUTATION_TIME
- limit on total time spent in search,
- KALIS_MAX_DEPTH
- maximum search tree depth,
- KALIS_MAX_NODES
- maximum number of nodes to explore,
- KALIS_MAX_SOLUTIONS
- maximum number of solutions,
- KALIS_OPT_ABS_TOLERANCE
- absolute difference between the objective function value in a solution and its best possible value (= current upper bound on objective function in maximization problems and lower bound with minimization),
- KALIS_OPT_REL_TOLERANCE
- relative difference between the objective function value in a solution and its best possible value (= current upper bound on objective function in maximization problems and lower bound with minimization).
These parameters are accessed with the Mosel functions setparam and getparam (see, for example, the output of problem statistics in model sudoku_ka.mos in Section all_different: Sudoku, and the search time limit set in the model freqasgn.mos of Section abs and distance: Frequency assignment).
In optimization problems, after a solution has been found the search continues from this point unless the setting of parameter KALIS_OPTIMIZE_WITH_RESTART is changed. The same is true if the search is interrupted by means of one of the above-named criteria and then continued, for instance with a different search strategy. To restart the search from the root node the procedure cp_reset_search needs to be called (as an example, see model freqasgn.mos in Section abs and distance: Frequency assignment)