Ai03solvingproblemsbysearching 231212093019 669b19f4
Ai03solvingproblemsbysearching 231212093019 669b19f4
LECTURE 3
Solving Problems by Searching
Spring 2022/2023
Outline
1-2
Problem-solving agents.
Search problems and solutions.
Example problems.
Formulating problems.
Basic search algorithms.
Problem-Solving Agents
1-3
When the correct action to take is not immediately obvious, an agent may
need to plan ahead: to consider a sequence of actions that form a path to a
goal state.
Such an agent is called a problem-solving agent, and the computational
process it undertakes is called search.
In this chapter, we consider only the simplest environments: episodic, single
agent, fully observable, deterministic, static, discrete, and known.
Describing one kind of goal-based agent called a problem-solving agent.
Problem-Solving Agents (2)
1-4
11
e.g. 8-Puzzle
States??
The location of each tile.
Initial state??
Any state can be initial.
Actions??
{Left, Right, Up, Down}.
Goal test??
Check whether goal configuration is reached.
Path cost??
Number of actions to reach goal.
12
Search Algorithms
1-13
14
Search Tree
15
Search Tree (2)
1-16
When all actions have the same cost, an appropriate strategy is breadth-first
search.
The root node is expanded first, then all the successors of the root node are
expanded next, then their successors, and so on.
Also called best-First-Search.
Implementation: fringe is a FIFO queue.
20
Breadth-First Search on a Simple Binary Tree
21
Uniform-Cost Search
1-23
When actions have different costs, an obvious choice is to use best-first search where
the evaluation function is the cost of the path from the root to the current node.
This is called Dijkstra’s algorithm by the theoretical computer science community,
and uniform-cost search by the AI community.
Extension of BF-search: Expand node with lowest path cost.
Implementation: fringe = queue ordered by path cost.
UC-search is the same as BF-search when all step-costs are equal.
Depth-First Search
24
Depth-First Search on a Simple Binary Tree
25
Depth-Limited Search
1-26
28
Iterative Deepening Search on a Simple Binary Tree (2)
29
Bidirectional search
bidirectional search simultaneously searches forward from the initial state and
backwards from the goal state(s), hoping that the two searches will meet.
The motivation is:
Check whether the node belongs to the other fringe before expansion.
Space complexity is the most significant weakness.
Complete and optimal if both searches are BF.
The predecessor of each node should be efficiently computable.
When actions are easily reversible.
30
Summary
1-31
Search algorithms introduced that an agent can use to select action sequences in a
wide variety of environments - as long as they are episodic, single-agent, fully
observable, deterministic, static, discrete, and completely known.
There are tradeoffs to be made between the amount of time the search takes, the
amount of memory available, and the quality of the solution.
Before an agent can start searching, a well-defined problem must be formulated.
A problem consists of five parts: the initial state, a set of actions, a transition model
describing the results of those actions, a set of goal states, and an action cost
function.
Summary (2)
1-32
BIDIRECTIONAL SEARCH expands two frontiers, one around the initial state and one
around the goal, stopping when the two frontiers meet.
Readings
1-35
Chapters 3 of Textbox.
The End