Lec 4_ Problem Solving Agent 3
Lec 4_ Problem Solving Agent 3
Problem Solving
Agent
Lecture 4: Problem Formulation and Search
What is Problem?
ØA problem is a collection of information that agent will use to
decide what to do!
ØBasic elements of problem definition are STATEs and ACTIONs.
oAn agent can look ahead to find a sequence of actions that will
eventually achieve its goal.
1
10/11/22
2
10/11/22
(3) Search
ØNow, the agent should de
oWhich action to choose (with map or without map)?
oWhat action should be chosen in a state with unknown value?
ØProcess of looking for a sequence of states-actions is called
Search.
ØSearch: is a behavior that an agent exhibits when it has
insufficient knowledge in order to solve a problem.
ØSearch Algorithm takes problem as input and returns a solution
in form of an action sequence.
(4) Execute
ØAfter finding a suitable action sequence, the actions can be carried out.
3
10/11/22
4
10/11/22
11
5
10/11/22
Search Trees
ØSearch function: return a solution or failure.
ØExpanding: applying operators (actions) on the current state.
ØSearch Strategy: the choice of which state to expand first is
determined by it.
ØSearch algorithms build a search tree whose roots is correspond to
initial state.
oIt defines the order of nodes expansion.
oNodes in tree are expanded using operators (actions).
oSome nodes may be visited more than once.
ØThe environment is static, discrete, observable and deterministic.
12
13
6
10/11/22
Search Tree
14
A Search Tree
ØThe basic idea: build a search tree which systematically
explores the state space graph:
1. Begin with creating a root node at the start state
2. Expand this node by finding all the states we can get to from this
state and adding these nodes as children of the root node
3. The previous step creates a fringe of new nodes. Now expand all of
these new nodes in turn
4. Each time a node expanded, the new nodes are added to the
fringe.
5. Before expanding a node, it should be tested if it is the goal state.
15
7
10/11/22
16
As a Code!
17
8
10/11/22
Types of Problems
ØThere are four types of problems:
oSingle-state problems
oMulti-state problems
oContingency problems
oExploration problems
18
Single-State Problems
ØAgents know exactly in which state it
is.
ØState information may be received by
sensors or using a complicated process
of saving track of the world.
ØThe initial state of the agent should be
clear
ØAgent should know the exact effect of
its actions.
ØDeterministic, static, discrete and fully
observable.
19
9
10/11/22
Multi-State Problems
ØAgent cannot find exactly in which state it is in (world is not
fully accessible)
ØAgent knows all the effects of its action
ØIn these problems, agent should reason about sets of states
that it might go to.
ØAgent still knows the effect of its actions
ØAgent does not know the initial state
oIs there a sequence of actions that leads to goal?
ØPartially observable, deterministic, static and discrete.
20
Multi-State Problems
oActions(Left, Suck, Right, Suck)
21
10
10/11/22
Contingency Problem
oThe effect of an action is not clear.
ØThe agent does not know what effect
its actions will have.
oUsually, in non-deterministic and
partially observable environment.
oIt is impossible to define a
complete sequence of actions that
constitute a solution in advance
because information about the
intermediary states is unknown.
22
Exploring Problem
ØThe agent has no information about effect of his action
oLike new born baby
ØAgent should experiment to discover what its actions do.
ØUsually, agent cannot be simulated
ØExample: being lost in new country without map!
23
11