If this is not the course you expected to find in this room, stick around anyhow: this will probably be more interesting than the course you were looking for.
Some points to note:
Formally, a goal is a description of a set of desirable states of the world and a plan is a sequence of actions. An action takes the agent from one state to another state.
Example: if you are in Arad (Romania) and your visa will expire tomorrow, your goal is to reach Bucharest airport.
Be sure to notice and understand the difference between a state that satisfies a goal and a description of a goal. Technically, "reach Bucharest airport" is a description of a goal. You can apply this description to particular states and decide yes/no whether they belong to the set of goal states.
Problem formulation means choosing a relevant set of states to consider, and a feasible set of operators for moving from one state to another.
The relevant set of states should include the current state, which is the initial state, and (at least one!) goal state. The operators correspond to actions that the agent might take.
Search is the process of imaginingsequences of operators applied to the initial state, and checking which sequence reaches a goal state.
A standard example of a planning problem formulated as a search
problem is the so-called 8-puzzle (see pictures in book).
Important: typically the agent does not "know" the entire set of states, where "know" means "has available an explicit representation of". What is called a "representation" in AI is often called a data structure elsewhere in computer science.
Instead of "knowing" the set of all states, the agent knows the initial state, and it knows operators. An operator is a function which "expands" a node. "Expanding" a node means computing the node(s) (zero, one, or many) that the agent could move to using all applicable operators.
With this available knowledge, the general search algorithm that the agent can use is:
The algorithm above assumes that when a node is chosen, all available operators are also chosen. Alternatively expansion could be viewed as a process with two inputs: the node to start from, and the operator to be used.input: a properly formulated search problem
a function "insert" to place new nodes into a queuefringe := make-queue(initial-node)
loop
if empty?(fringe) then return FAIL
else
X := remove-front(fringe)
if satisfies-goal(state(X)) then return X
else
fringe := insert(fringe,expand(X))
end loop
When a node is expanded, it may prove to have no children.
Expanding a leaf node may lead to another node that has already been
visited. In general the search algorithm does not "know"
this. (Remember that "know" means "has available a directly usable
explicit representation".) The general search algorithm generates
a tree of nodes, not the search space directly: compare the
pictures on pages ? and ?.
Different algorithms use different insert functions, but always remove
nodes one by one from the front of the fringe.
DFS goes down a path until it reaches a node that has no children. Then DFS "backtracks" and expands a sibling of the node that had no children. If this node has no siblings, then DFS looks for a sibling of the grandparent, and so on.
See the picture on page ? for an illustration of DFS.
BFS first considers all paths of length 1, then all paths of length 2, and so on. This is why it is called "breadth-first".
The picture on page ? shows intuitively how BFS works.
The search algorithm needs an efficient representation of the
fringe. We shall use a queue, i.e. a special list where you can
remove elements from the front and you can insert new elements into the
middle.
Depth-limited search is the same as DFS except a nodes of depth equal to a fixed maximum (say M) are not expanded.
If a solution exists at depth M or less, then M-limited DFS will
find it, and this algorithm is very space-efficient, since it uses only
O(b*M) space.
The idea is to do depth-limited DFS repeatedly, with an increasing depth limit, until a solution is found.