Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

Artificial Intelligence

Ms. Sania Yousuf


Problem Solving Agent
• Problem solving agent is a kind of goal based agent.

• Problem-solving agents decide what to do by finding sequences of


actions that lead to desirable states.

• We can also say that a problem-solving agent is a result-driven agent


and always focuses on satisfying the goals.
Steps problem-solving in AI
These are the following steps which require to solve a problem :
1. Goal Formulation: This one is the first and simple step in problem-
solving. It organizes finite steps to formulate a target/goals which
require some action to achieve the goal. Today the formulation of the
goal is based on AI agents.
2. Problem formulation: It is one of the core steps of problem-solving
which decides what action should be taken to achieve the formulated
goal.
Steps problem-solving in AI
3. Search for solution-Given the problem, search for a solution--a
sequence of actions to achieve the goal starting from initial state.

4. Execution of the solution


Terminologies
• Problem: It is the question which is to be solved. For solving a problem it needs to be
precisely defined. The definition means, defining the start state, goal state, other valid
states and transitions.
• Search Space: It is the complete set of states including start and goal states, where the
answer of the problem is to be searched.
• Search: It is the process of finding the solution in search space. The input to search space
algorithm is problem and output is solution in form of action sequence.
• Well defined problem: A problem description has three major components. Initial state,
final state, space including transition function or path function. A path cost function
assigns some numeric value to each path that indicates the goodness of that path.
• Solution of the problem: A solution of the problem is a path from initial state to goal
state. The movement from start states to goal states is guided by transition rules. Among
all the solutions, whichever solution has least path cost is called optimal solution.
Problems
A problem is a tuple (S,s,A,ρ,G,P) where,

S is a set of states
s∈ S is the initial state
A is a set of actions
ρ:S×A→S is a partial function, that tells you for each state, which actions will
take you to which states.
G:S→bool is the goal test function, which tells you whether a state is a goal
state or not.
P is the path cost function.
Problem Representation in AI
Before a solution can be found, the prime condition is that the problem
must be very precisely defined. By defining it properly, one converts the
abstract problem into real workable states that are really understood.

The most common methods of problem representation in AI are:-


• State Space Representation
• Problem Reduction
State Space Representation: 
• A set of all possible states for a given problem is known as the state
space of the problem.

• A state space essentially consists of a set of nodes representing


each state of the problem, arcs between nodes representing the legal
moves from one state to another, an initial state and a goal state.
Problem Reduction
• In this method a complex problem is broken down or decomposed
into a set of primitive sub problems.

• Solutions for these primitive sub-problems are easily obtained. The


solutions for all the sub-problems collectively give the solution for the
complex problem.

• In fact, the human mind adopts this strategy for finding solutions to
majority of problems it encounters.
Examples
The Missionaries and Cannibals Problem
• In the missionaries and cannibals problem,
Three missionaries and Three cannibals must cross a river using a boat
which can carry at most two people.
Under the constraint that,
For both banks, if there are missionaries present on the bank, they
cannot be outnumbered by cannibals (if they were, the cannibals
would eat the missionaries). The boat cannot cross the river by itself
with no people on board.
The Missionaries and Cannibals Problem

Initial
Goal
State Space (Left bank to right bank scenario)
State Space (Right bank to left bank scenario)
The Missionaries and Cannibals Problem
(Combine for both scenario LR or RL)
8 Puzzle Problem
8 Puzzle Problem8 Puzzle Problem
8 Puzzle Problem8 Puzzle Problem

You might also like