IT Elect 104
(Chapter 3)
Some text and images in these slides were drawn from
Russel & Norvig’s published material
Problem Solving
Agent Function
Problem Solving Agent * Agent finds an action sequence to achieve a goal * Requires problem formulation * Determine goal * Formulate problem based on goal * Searches for an action sequence that solves the problem * Actions are then carried out, ignoring percepts during that period
Problem * Initial state * Possible actions / Successor function * Goal test * Path cost function
* State space can be derived from the initial state and the successor function
Example: Vacuum World * Environment consists of two squares,
A (left) and B (right) * Each square may or may not be dirty * An agent may be in A or B * An agent can perceive whether a square is dirty or not * An agent may move left, move right, suck dirt (or do nothing) * Question: is this a complete PEAS description?
Vacuum World Problem * Initial state: configuration describing * location of agent * dirt status of A and B * Successor function * R, L, or S, causes a different configuration * Goal test * Check whether A and B are both not dirty * Path cost * Number of actions
State Space * 2 possible locations x 2 x 2 combinations
( A is clean/dirty, B is clean/dirty )
=
8 states
Sample Problem and Solution * Initial State: 2 * Action Sequence:
Suck, Left, Suck
(brings us to which state?)
States and Successors
Example: 8-Puzzle * Initial state: as shown * Actions? successor function? * Goal test? * Path cost?
Example: 8-Queens Problem * Position 8 queens on a chessboard so that no queen attacks any other queen * Initial state? * Successor function? * Goal test? * Path cost?
Example: Route-finding * Given a set of