AI2 Problem-Solving
AI2 Problem-Solving
2
Problem Solving
Russell and Norvig: Chapter 3
Outline
• Problem-solving agents
• Components of Well-Defined Problem
• Problem formulation
• Example problems
• Basic search algorithms
Problem-solving agents
• In this chapter we consider a type of Goal-Based
Agent, known as Problem Solving Agent that uses
atomic representation.
• Atomic Representation: Consist of indivisible states,
i.e., that has no internal structure.
Example (Atomic Representation)
Finding the route from one part of the country to the other through
some sequence of cities. For simplicity, only city names can represent
the states of the world i.e., single atom or black box.
?
environment
agent
actuators
• Formulate Goal
• Formulate Problem
•States
•Actions
• Find Solution
Problem solving
Goal Formulation : is the first step in problem solving and it
is based on the current situation and the
agent’s performance measure.
It helps to simplify the decision problem.
Goal is normally considered to be set of
states in which the Goal is satisfied.
Problem Formulation : is the process of deciding what
actions and states to consider, given a
goal.
• It is not necessary that in the initial stage the agent action
on the current state (transition) results in achieving the
goal.
• Then generally an agent with several immediate options of
unknown value can decide what to do by first examining
future actions that eventually lead to states of known
Problem solving
Search-Solution-Execute
Search is the process of looking for a sequence of actions that
reaches the goal.
A search algorithm takes a problem as input and returns a
solution in the form of an action sequence.
Once a solution is found, the actions it recommends can be
carried out. This is called the execution.
Simple Problem-Solving Agent
Components of Well-Defined Problem
• Initial State
• Actions
• Transition Model
• Goal Test
• Path Cost
Components of a problem
Definition (Actions)
Description of possible actions given a particular state s, i.e.,
ACTIONS(s) will return all possible actions executable in s
and these set of actions will be called applicable in s. For
example, {Go(Sibiu), Go(Timisoara), Go(Zerind)} are
applicable in state Arad.
Components of a problem
Definition (Transition Model)
Describes each action a with respect to state s. i.e.,
RESULT(s,a) will return the state that result by doing action a
in state s. For example, RESULT(IN(Arad),Go(Zerind)) =
IN(Zerind)
Static
Tidak perlu memperhatikan perubahan
yang terjadi pada environment
Observable
Ada peta, initial state diketahui (di Arad)
Discrete
Enumeration action
Deterministic
Tidak bisa menangani terhadap hal-hal
yang tidak diperkirakan
Romania : Well-defined problem agent
States
Actions
Start Solution
Goal
Romania : Formulate goal, formulate
problem, and solution
• Formulate Goal:
Be in Bucharest
• Formulate Problem:
States: various cities
Actions: drive between cities
• Find solution:
Sequence of cities: Arad, Sibiu, Fagaras, Bucharest
Types of Problems
8 2 1 2 3
3 4 7 4 5 6
5 1 6 7 8
10 million states/sec
Toy problem: 8-queens
Formulation #1:
• States: any arrangement of 0 to 8
queens on the board
• Initial state: 0 queens on the
board
• Successor function: add a queen in
any square
• Goal test: 8 queens on the board,
none attacked