0% found this document useful (0 votes)
10 views21 pages

Lecture 8

Uploaded by

xegoke1134
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)
10 views21 pages

Lecture 8

Uploaded by

xegoke1134
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/ 21

PROBLEM SOLVING

APPROACH TO TYPICAL AI
PROBLEMS
⚫ Problem-solving agents
Rational agents or Problem-solving agents in AI mostly used
search strategies or algorithms to solve a specific problem and
provide the best result.
Problem- solving agents are the goal-based agents and use atomic
representation.
⚫ Problem Searching
Searching refers to as finding information one needs.
Searching is the most commonly used technique of problem solving
in artificial intelligence.
The searching algorithm helps us to search for solution of particular
problem.
Problem: Problems are the issues which comes across any system. A
solution is needed to solve that particular problem.
Key Pillars in Working Domain:
⚫ Goal formulation:
⚫ based on the current situation and the agent's performance
measure, is the first step in problem solving.

⚫ Problem formulation:
⚫ is the process of deciding what actions and states to
consider, given a goal.
Key Pillars in Working Domain:
⚫ Search:
⚫ This process of looking for possible sequence of actions
that lead to states of known value and then choosing the best
sequence is called search.

⚫ A search algorithm takes a problem as input and returns a


solution in the form of an action sequence
Steps Involved in Solving Problem:
⚫ To solve problem:
⚫ First we define problem
⚫ Analyze the problem
⚫ Find possible solution and
⚫ Select the best one.
WELL DEFINED PROBLEM
Components of a Problem:
⚫ A problem can be defined formally by four components:
⚫ States
⚫ State Modification (Successor Function)
⚫ State Space
⚫ Path
State:
⚫ A problem is defined by its elements and their
relations.
⚫ A state is a representation of those elements in a
given moment.
⚫ Two special states are defined:
– Initial state (starting point)
– Final state (goal state)
Successor Function:
⚫ A successor function is a description of possible actions, a set
of operations.
⚫ It is a transformation function on a state representation, which
convert it into another state.
⚫ For state x, SUCCESSOR-FN(x):
⚫ returns a set of (action, successor) ordered pairs
State Space:
⚫ The state space is the set of all states reachable from the initial
state.

⚫ It forms a graph (or map) in which the nodes are states and the
arcs between nodes are actions.

⚫ initial state and successor function implicitly define the state


space of the Problem.
Structure of State Space:
⚫ Data structures:
⚫ Trees: only one path to a given node
⚫ Graphs: several paths to a given node
⚫ Operators: directed arcs between nodes
⚫ The search process explores the state space.
⚫ In the worst case all possible paths between the initial
state and the goal state are explored.
Path:
⚫ A path in the state space is a sequence of states connected by a
sequence of actions.

⚫ The solution of the problem is part of the map formed by the


state space.
SOLUTION OF A PROBLEM
Terminologies Associated with
Solution:
⚫ A solution:
⚫ in the state space is a path from the initial state to a goal state or,
sometimes, just a goal state.

⚫ An optimal solution:
⚫ has the lowest path cost among all solutions.

⚫ Path/Solution Cost:
⚫ function that assigns a numeric cost to each path, the cost of
applying the operators to the states
Terminologies Associated with
Solution:
⚫ The step cost:
⚫ of taking action a to go from state x to state y is denoted by c(x,
a, y).

⚫ The goal test:


⚫ which determines whether a given state is a goal state.
⚫ For example, in chess, the goal is to reach a state called
"checkmate,“
EXAMPLE OF WELL KNOWN
PROBLEM
8-puzzle Problem:

Initial State Goal State


8-puzzle Problem:
⚫ State space:
⚫ configuration of the eight tiles on the board
⚫ Initial state:
⚫ any configuration
⚫ Goal state:
⚫ tiles in a specific order
⚫ Operators or actions: “blank moves”
⚫ Condition: the move is within the board
⚫ Transformation: blank moves Left, Right, Up, or Down
⚫ Solution:
⚫ optimal sequence of operators
n-queens Problem:

For n=4 For n=8


n-queens Problem:
⚫ State space:
⚫ configurations from 0 to n queens on the board with only one
queen per row and column

⚫ Initial state:
⚫ configuration without queens on the board

⚫ Goal state:
⚫ configuration with n queens such that no queen attacks any
other
n-queens Problem:
⚫ Operators or actions: place a queen on the board

⚫ Condition: the new queen is not attacked by any other already


placed

⚫ Transformation: place a new queen in a particular square


of the board

⚫ Solution: one solution (cost is not considered)

You might also like