0% found this document useful (0 votes)
2 views13 pages

Lecture 5

The document discusses problem-solving agents in artificial intelligence, focusing on their functionality including goal formulation, problem formulation, and search strategies. It elaborates on specific problems such as the 8-queens problem and the 8-puzzle problem, detailing their states, actions, transition models, goal tests, and path costs. Additionally, it highlights the importance of solution quality measured by path cost in achieving optimal solutions.

Uploaded by

extraubd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views13 pages

Lecture 5

The document discusses problem-solving agents in artificial intelligence, focusing on their functionality including goal formulation, problem formulation, and search strategies. It elaborates on specific problems such as the 8-queens problem and the 8-puzzle problem, detailing their states, actions, transition models, goal tests, and path costs. Additionally, it highlights the importance of solution quality measured by path cost in achieving optimal solutions.

Uploaded by

extraubd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Problem Solving Agent

Artificial intelligence
Muhammad Umar Farooq
In last lecture
• Problem solving agent
• Functionality of problem solving agent
– Goal formulation
– Problem formulation
– Search and search groups
– Goal test
– Path cost
• 8-puzzle problem
• 8 queens problem
8-queens problem
Problem formulation

• States: Any arrangement of 0 to 8 queens on the


board is a state.
• Initial state: No queens on the board.
• Actions: Add a queen to any empty square.
• Transition model: Returns the board with a queen
added to the specified square.
• Goal test: 8 queens are on the board, none attacked.
In this formulation, we have 64*63*....*57 ≈ 1.8×1014
possible sequences to investigate. A better formulation
would prohibit placing a queen in any square that is
already attacked:
Toy problem
Problem formulation
• States: The state is determined by both the agent location and the
dirt locations. The agent is in one of two locations, each of which
might or might not contain dirt. Thus, there are 2 × 22 = 8 possible
world states. A larger environment with n locations has
n × 2𝑛 states.
• Initial state: Any state can be designated as the initial state.
• Actions: each state has just three actions: Left, Right, and Suck.
• Transition model: The actions have their expected effects, except
that moving Left in the leftmost square, moving Right in the
rightmost square, and Sucking in a clean square have no effect. The
complete state space is shown in Figure 3.3.
• Goal test: This checks whether all the squares are clean.
• Path cost: Each step costs 1, so the path cost is the number of
steps in the path.
• Solution quality is measure by the path cost
function, and an optimal solution has the
lowest cost among all solution.
8-Puzzle problem
Problem formulation
• Initial state= Arad
– In(Arad)
• Action: from the state In(Arad), the applicable actions are
– { Go(Sibiu), Go(Timisoara), Go(Zerind) }.
• Transition model: specified by a function RESULT(s, a) that returns
the state that results from doing action a in state s.
– RESULT(In(Arad),Go(Zerind)) = In(Zerind)
• Path: A path in the state space is a sequence of states connected by a
sequence of actions.
• Goal Test: which determines whether a given state is a goal state
– {In(Bucharest )}.
• Path cost: A path cost function that assigns a numeric cost to each
path.
Thank you

Any question ?

You might also like