In this chapter, we are not only looking for a feasible solution but we want the best solution! Most of the time, the search is done in two steps. First, we find the best solution[1]. Second, we prove that this solution is indeed the best (or as good as any other feasible solution in case there are multiple optimal solutions) by scouring (preferably implicitly) the complete search tree.
Overview:
We start by stating the Golomb Ruler Problem (GRP) and showing that this problem is difficult. We implement five models and compare them two by two. To do so, we introduce some basic statistics about the search (time, failures, branches, ...). Two very useful techniques are introduced: adding better bounds and breaking symmetries. Finally, we say a few words about the strategies used by the solver to optimize an objective function.
Prerequisites:
Remarks:
Classes under scrutiny:
AllDifferent, OptimizeVar, SearchLimit.
Files:
The files used in this chapter are:
In all the codes, we use the same strategy to select the next variable to branch on (CHOOSE_FIRST_UNBOUND) and the same strategy to assign it a value (ASSIGN_MIN_VALUE). The times we compare not only measure the solve process but also the time needed to construct the model.
Content:
[1] | How do we know we have a best solution? Only when we have proven it to be so! The two steps are intermingled. So why do we speak about two steps? Because, most of the time, it is easy to find a best (good) solution (heuristics, good search strategies in the search tree, ...). The time-consuming part of the search consist in disregarding/visiting the rest of the search tree. |