Professional Documents
Culture Documents
CH 3 Problem Solving Agents
CH 3 Problem Solving Agents
Although interesting behaviours can be achieved by all three types, we will concentrate
on goal-based agents.
Motivation
car driving: only the goal-based agent will try to get from point A to B
RoboCup (or any other adverserial game): there are clear objectives that we want
our agents to fulfill
in general: goals are an important characteristic of intelligent behaviour
For now, we will only deal with agents that perform these four steps in sequential order.
Problem Formulation
Representation is very important, as we shall soon see. The problem can be specified by
the following four items:
states: description of the relevant properties of the world; the state space is the
set of all states reachable from the initial state through any sequence of actions
B. Okuku Page 1
operators: the actions that cause a transition from one state to another
goal test: apply to state to determine whether it is a goal state; sometimes an
explicit set can be defined, but other times, it is an abstract property (e.g.
checkmate in chess); the solution is a path in the state space from the initial state
to a goal state
path cost: how much effort/cost it takes us to reach that state; note that for some
problems, the path is irrelevant -- we just care about getting a solution
Toy Problems
8-puzzle
states: location of each of the eight tiles in one of the nine squares
operators: for each tile, move up, down, left, or right
goal test: state matches the configuration:
path cost: each step costs 1, so the path cost is the length of the path
Our choice of operators is not very good because there are so many (8 * 4 = 32) and this
will influence the efficiency of our search (big state space). Can you think of a better
alternative?
8 Queen's problem
What data structure might you use to represent state? What if we generalized the
problem to the n x n case? Regardless of memory efficiency, our choice of state
representation is not very good because there are so many (64^8) possibilities to explore.
Once we place a queen in a square where it is attacked, we cannot have a solution that
builds from that point. Recognizing this, we can come up with an improved
representation:
This reduces the state space dramatically (to 2057 possible sequences).
B. Okuku Page 2
Missionaries and Cannibals [Amarel 68]
Do we need to know which of the missionaries and cannibals are on each side of the
river?
Abstraction:
States: ?
B. Okuku Page 3
Operators: based on boat capacity, there are only five possibile operators:
Goal test: ?
Path cost:
could be a unit cost per arc in path (pay per number of boat crossings)
could be a unit cost per missionary or cannibal carried per arc in path (pay per
passenger)
could be a more complex function (tourists pay "foreigner price")
Real-world problems
given a network of cities (nodes) connected by roads (arcs), find the shortest path
that visits every city exactly once
problem is NP-hard
very important problem -- results applied to military supply operations and
automatic circuit board drills
VLSI layout
cell layout and channel routing - minimize area and connection lengths
constraints: cells cannot overlap and must allow enough room for connecting wire
B. Okuku Page 4