Search Algorithms

Preface: these notes are primarily based on portions of Chapter 6 of Ertel's text.


Motivation

We wish to consider planning algorithms, starting with discrete, deterministic, fully-observable environments. Classic examples are one-player puzzles such as the "8-tile puzzle", "Rush hour" style block sliding games, Rubik's cube, and so on.


Search Space Definitions

State
An complete description of the domain world at an instant in time.
Search Space
The set of all possible states.
Start State
The initial state in which the search agent begins.
Goal State
One of possibly many states state that represent a successful completion if reached.
Action
A transition that leads from one state to another.
Cost
Each action has an associated cost value. (If not otherwise stated, we assume a uniform cost metric with value 1 for each action.
Solution
An ordered sequence of states (and transitional actions) leading from the initial state to a goal state.

As noted before, we begin by considering the following restrictions:

Discrete
States are countably enumerable (that is, there are either finitely many, or an infinite series that can be produced computationally). (i.e., no tight-rope walking)
Determinstic
There is a unique state s' that results from applying action a from state s. (i.e., no rolling dice)
Fully-Observable
The search agent is fully aware of its current state. (i.e., no hidden cards, not dropped into unknown maze).


Search Tree

The search space is commonly modeled (implicitly or explicitly) as a search tree, with states associated with nodes, and actions associated with directed edges between nodes. The search tree is rooted at the initial state and with directed edges. A solution can be represented as a path in the tree from root to a goal state.

For a specific state s, we let Successors(s) be the set of states that can be reached by a direct action from s. A node associated with s will have children in the search tree associated with each state of Successors(s).

Branching factor, b(s) of a node s is the number of successor states. In some models, there is constant branching factor, b, for all states. In most models, the branching factor varies. But we can define the effective branching factor for a tree with n nodes and depth d as approximately logd+1 n.


Uninformed Search

We will consider the following strategies:

Informed (Heuristic) Search

With uninformed search model, we presume that the only thing an algorithm can do with a state is to test if its a goal, test if its equivalent to a known state, or to determine actions that can be performed to produce successors. In particular, there is no notion of a state being "close" to a goal. But we will have knowledge of

g(s) : the actual accrued cost in going from the initial state to s along the given tree path

For many problems, we might be able to estimate the distance from a state to a potential goal. In particular, we might define

h(s) : is an estimate of the cost from s to the nearest goal
not that we can necessarily assume that the heuristic is a good estimate!

We can refine a priority-based search strategy as follows:

We maintain a priority queue of "frontier" states, with each state s having some assigned priority f(s).
Initially, the start state is the only entry in the queue, having cost 0.
We remove the state from the PQ with lowest priority, and we "process" it by finding all of its successors, and inserting each of them into the queue with appropriate priority.

Depending on how we define the priority function f(s), we can get any of the following algorithms:

Defining Admissible Heuristics

So the A* algorithm is foundational for informed search, but we need to define an admissible heuristic. Let's look at some examples:

IDA* (Iterative Deepening A*)

As great as A* is, it still requires that we maintain the frontier in a priority queue, and that memory usage can be burdensome (as well as the additional data structure support for managing priorities).

We can adapt A* as a form of DFS, with only O(bd) memory usage, by placing a threshold on the value f(s) = g(s) + h(s) that we are willing to consider, and truncating the DFS on any branch once that threshold is exceeded. We then use iterative deepening, repeating the search from scratch with a higher threshold.

If we have integral costs and heuristic functions, and we increase our threshold by one in each round, then first solution found will be optimal. We can do slighlty better by setting the new threshold to be the minimal f(s) value that was pruned in the previous round (since otherwise we would not proceed any farther).


Michael Goldwasser
Last modified: Monday, 30 September 2013