tags:


2. Best First Search #

Created Sat Aug 3, 2024 at 9:57 PM

Best-First Search is elaboration of backtracking.

Context #

In backtracking, two important decisions are “which free solution position to expand next” and “order of considering candidates for current solution position”.

The second one is quite important, i.e. order of candidates, especially for optimization problems (say min finding), since we not only want to get the lowest, we want to get it fast (i.e. before instead of later during the backtrack).

Backtracking didnt care about order of candidates since it was about enumeration/existence-finding (i.e. we look for one or all solutions). Optimization problems seek a solution that has the lowest (or highest) value of some objective function.

Best-First Search (aka branch-and-bound) #

As said, order of candidates is important for optimization problems. When we consider order in backtracking, the algorithm is called “Best-First search” - more jargon ;)

Here we assign a cost to every partial solution and store it in a “global” priority queue (min). At any moment, only the one with least cost is expanded. i.e. in a way we automatically ignore the current search if its cost increased (but was low earlier).

Two things here:

Note:

Skiena doesn’t say how to implement this.

maid #

Best-First search is backtracking that advances the best partial solution so far, at every point.