Figure 2.1 shows a search space with N (here 16) possible total assignments, some of which are solutions. Search methods now differ in the way in which these assignments are visited. We can classify search methods according to different criteria:
Method | exploration | assignments | random |
Full tree search | complete | constructive | no |
Credit search | incomplete | constructive | no |
Bounded backtrack | incomplete | constructive | no |
Limited discrepancy | complete | constructive | no |
Hill climbing | incomplete | move-based | possibly |
Simulated annealing | incomplete | move-based | yes |
Tabu search | incomplete | move-based | possibly |
Weak commitment | complete | hybrid | no |
The constructive search methods usually organise the search space by partitioning it systematically. This can be done naturally with a search tree (Figure 2.2). The nodes in this tree represent choices which partition the remaining search space into two or more (usually mutually exclusive) disjoint sub-spaces. Using such a tree structure, the search space can be traversed systematically and completely (with as little as O(N) memory requirements).
Figure 2.4 shows a sample tree search, namely a depth-first incomplete traversal. As opposed to that, figure 2.3 shows an example of an incomplete move-based search which does not follow a fixed search space structure. Of course, it will have to take other precautions to avoid looping and ensure termination.
A few further observations: Move-based methods are usually incomplete. This is not surprising given typical sizes of search spaces. A complete exploration of a huge search space is only possible if large sub-spaces can be excluded a priory, and this is only possible with constructive methods which allow to reason about whole classes of similar assignments. Moreover, a complete search method must remember which parts of the search space have already been visited. This can only be implemented with acceptable memory requirements if there is a simple structuring of the space that allows compact encoding of sub-spaces.
Many practical problems are in fact optimisation problems, ie. we are not just interested in some solution or all solutions, but in the best solution.
Fortunately, there is a general method to find the optimal solution based on the ability to find all solutions. The branch-and-bound technique works are follows:
Since search space sizes grow exponentially with problem size, it is not possible to explore all assignments except for the very smallest problems. The only way out is not to look at the whole search space. There are only two ways to do this:
In the following sections we will first investigate the considerable degrees of freedom that are available for heuristics within the framework of systematic tree search, which is the traditional search method in the Constraint Logic Programming world.
Subsequently, we will turn our attention to move-based methods which in ECLiPSe can be implemented using the facilities of the repair-library.