0% found this document useful (0 votes)
4 views53 pages

module_2

The document discusses problem-solving agents in AI, which are designed to find solutions by breaking down larger problems into manageable parts and focusing on goal satisfaction. It categorizes problems into three types (ignorable, recoverable, and irrecoverable) and outlines the steps for problem-solving, emphasizing well-defined problems and solutions. Additionally, it covers various search algorithms, including uninformed and informed search methods, detailing their characteristics, advantages, and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views53 pages

module_2

The document discusses problem-solving agents in AI, which are designed to find solutions by breaking down larger problems into manageable parts and focusing on goal satisfaction. It categorizes problems into three types (ignorable, recoverable, and irrecoverable) and outlines the steps for problem-solving, emphasizing well-defined problems and solutions. Additionally, it covers various search algorithms, including uninformed and informed search methods, detailing their characteristics, advantages, and disadvantages.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 53

Module-2

PROBLEM SOLVING
AGENTS
 The problem-solving domain which breaks the
large stored problem into the smaller storage
area and resolves one by one.
 The final integrated action will be the desired
outcomes.
 Problem-solving agents in AI are entities
designed to find solutions to problems by
considering various possible actions and their
outcomes.
 We can also say that a problem-solving agent is
a result-driven agent and always focuses on
satisfying the goals.
 There are basically three types of
problem in AI
1. Ignorable:In which solution steps
can be ignored
2. Recoverable:In which solution
steps can be undone.
3. Irrecoverable:Solution steps
cannot be undo
Steps for problem-
solving in AI
 Problem definition:Detailed
specification of inputs and
acceptable system solution.
 Problem analysis:Analyse the
problem thoroughly.
 Knowledge
Representation:Collect detailed
information about the problem and
define all possible techniques.
 Problem-solving:Selection of best
WELL DEFINED PROBLEMS
AND SOLUTIONS
 Well-defined problem and solutions
are clear, unambiguous problems
with precisely specified goals and
solutions.
 These types of problems are
particularly suitable for
computational approuches
A problem can be defined formally by
five components
 The initial state that the agent starts
in.
 A description of the possible actions
available to the agent.
 A description of what each action
does
 The state space forms a directed
network or graph in which the nodes
Key characteristics of well-defined problem and
solution:
 Clarity
Well defined problem have clearly stated
goals,initial states,and possible actions. The
problem’s statement leaves little room from
ambiguity or interpretation.
 Observable states:
The state of the problem is fully
observable .The agent can perceive and
accurately determine the current state of the
system at any point in time.
 Deterministic:
The outcomes of action are
predictable and deterministic. Given
a particular state and action,the nest
state is uniquely detemined.
 Known action
The set of possible actions that
an agents can take is well known and
clearly defined. The agents has a
precise understanding of the
 Defined transition model:
The transition model, describing how
environment responds to action, is explicitly
known. It specifies the possible states
resulting from each action in each state.
 Single goal
There is a single well-defined goal that
the agent aims to achieve. The success or
failure of the agent is unambiguously
determined by reaching or not reaching the
goal state.
 No uncertainty
There is no uncertainty or randomness in the
problem. The agents has complete information
about the environment and the consequences
of its action.
A well-defined problem and solution set the
stage for effective problem-solving by providing
clarity,specificity,measurability,relevance,
 Fesibility and practicality stakeholders are
crucial in ensuring that the problem and its
solution are well-defined.
A WELL-DEFINED
SOLUTION
 The directly addresses the identified
problem and aligns with the established
criteria and constraints.
 Solution should provide a clear path to
resolving the problem and achieving the
desired outcomes.
 Key characteristics of well-defined solution
include
RELEVENCE:The solution should directly
address the root clause of the problem and
contribute to achieving the desired goals.
 Feasibility:The solution should be pratical and of
available resources such as time budget and expertise
 Effectiveness:The solution should be capable of
resolving the problem and producing the intended
results. It shoud have a measurable impact on the
identified issues.
 Scalability:If applicable, the solution should be
scalable to accommodate future growth or changes in
the environment.
 Implementation plan:A well-defined solution includes a
clear plan implementation, outlining the steps,
timeline and responsibilities for carrying out the
solution
WHAT IS SEARCH
PROBLEM
 A search problem consists of
1. A State Space:Set of all possible states where
you can be
2. A Start State:The start from where the search
begins
3. A Goal State:A function that looks at the
current state return whether or not it is the goal
state.
 The solution to a search problem is a sequence
of actions, called the plan that transforms the
start state to the goal state.
 This plan is achieved through search algorithms.
ALGORITHM

 UNINFORMED
 INFORMED
UNINFORMED SEARCH
ALGORITHM
 The search algorithm have no additional
information on the goal node other than the
one provided in the problem definition.
 These algorithm can only generate the
successors and differentiate between the
goal state and non-goal state.
 The following uniformed search algorithms
are discussed futher
1. Depth First Search
2. Breadth First Search
3. Uniform cost Search
INFORMED SEARCH
ALGORITHMS
 Informed search algorithm contains an
array of knowledge such as how far we are
from the goal,path cost,how to reach to
goal node etc.
 This knowledge help agents to explire less
to the search space and find mre
effeciently the goal node.
 The informed search algorithm is more
useful for large search space.
 Informed search algorithm also called
heuristic search
HEURISTICS FUNCTION

 Heuristic is a function which is used


in informed search and it finds the
most promising path.
 It take the current state of agents as
its input and produces the estimation
of how close agent is from the goal.
HEURISTICS FUNCTION

Each of these algorithms will have


 A problem graph containing the start node S
and the goal node C.
 A Strategy describing the manner in which the
graph will be traversed to get to C.
 A fringe which is a data structure used to store
all the possible states(nodes) that you can go
from the current states.
 A tree, that result while traversing to the goal
node.
 A solution plan,which the sequence of nodes
from S to C
DIFFERENCE
UNINFORMED INFORMED
SEARCHING SEARCHING
Search without Search with
information information(heuristic)
No knowledge Use knowledge to
find the step to
solution
Time consuming Quick solution
More complexity Less complexity
DFS,BFS etc A*,AO*,Heuristic,BFS
etc
DEPTH FIRST SEARCH

 DFS can be recursive or non-recursive


algorithm
 DFS is an algorithm for traversing or
searching tree or graph data structure
 The algorithm starts at the root node
and explores as far as possible along
each branch before backtracking
 It used last in-first-out strategy and
hence it is implemented using a stack
 DFS implements backtracking
 Which solution would DFS find to
move from node S to node Gif run on
the graph below?
S A B C G

D
SOLUTION

 As DFS traverses the tree-”deepest


node first”. It would always pick the
deeper branch until it reaches theS

solution.
A E
 PATH-SABCG
B G

C G

G
ADVANTAGES AND
DISADVANTAGES
 ADVANTAGES
1. Requires less memory
2. It takes less time to reach goal
 DISADVANTAGES
1. States keep re occurring and there
is no guarantee of finding the
solution
2. As it traverse deep down searching
may enter in to infinite loop some
time
BREADTH-FIRST
SEARCH(BFS)
 BFS is an algorithm for traversing or
searching tree or graph
 It starts at the tree root and explore
all the neighbor nodes at the present
 Start from node and expand to
successor node at current-level
 It implemented using a queue that is
FIFO
 Which solution would BFS find to
move from node S to node G if run
on the graph below?
S A B C G

D
SOLUTION

 As BFS traverses the


tree-”SHALLOWEST NODE FIRST”. It
would always pick the shallower S
branch until it reaches
A E
the solution.
 PATH-SEG B G

C G

G
ADVANTAGES AND
DISADVANTAGES
 ADVANTAGES
1. BFS will provide a solution if there
exist a solution
2. If more then one solution are
available, it will select minimal
solution
 DISADVANTAGES
1. It requires lot of memory, because
each level has to be saved into
memory
DEPTH-LIMITED SEARCH
ALGORITHM
A depth-limited search algorithm is similar to
DFS with a predetermined limit
 This can solve the drawbacks of the infinite path
in the DFS
 The nodes at the depth limit will treat as it has
no successor nodes further
 Depth-limited search can be terminated with two
condition of failure:
1. Standard failure value:It indicates that problem
does not have any solution
2. Cutoff failure value:It defines no solution for
problem within a given depth limit.
DEPTH-LIMITES SEARCH
ALGORITHM
LEVEL-1
S

LEVEL-2
A B

LEVEL-3

C D T J

E F G H LEVEL-4
ADVANTAGES AND
DISADVANTAGES
 ADVANTAGES:
1. Is memory efficient.
 DISADVANTAGES
1. Also has a disadvantages of
incompleteness.
2. It may not be optimal if the problem
has more than one solution.
UNIFORM-COST SEARCH
ALGORITHM
 Searching algorithm used for traversing a weighted
tree and graph
 Comes into play when difference cost is available
fro each edge
 Goal of the uniform-cost search is to find a path to
the goal node which has the lowest cumulative cost
 A uniform-cost search algorithm is implemented by
the priority queue
 It gives maximum priority to the lowest cumulative
cost
 Uniform cost search is equivalent to BFS algorithm
if the path cost of all edges is the same
ADVANTAGES AND DISADVANTAGES

 ADVANTAGES
 Uniform cost search is optimal
because at every state the path with
the least cost is chosen
 DISADVANTAGES
 It does not care about the number of
steps involve in searching and only
concerned about the path cost.
ITERATIVE DEEPING DEPTH-
FIRST SEARCH
 Algorithm is a combination of DFS and
BFS algorithm
 This algorithm finds out the best depth
limit and does it by gradually increasing
the limit until a goal is found
 The iterative search algorithm is useful
uniformed search when search space is
large and depth of goal node is unknown
 This algorithm combine the benefits BFS
fast search and DFS memory efficients
 Tree structure is showing the
iterative deepening depth-first
search.
 1th iterationA
 2nd iterationA,B,C
 3rd iterationA,B,D,E,C,F,C

IN THE THIRD ITERATION THE


ALGORITHM WILL FIND THE GOAL
NODE.
ADVANTAGES AND
DISADVANTAGES
 ADVANTAGES
 It combines the benefits of BFS and
DFS search algorithm in terms of fast
search and memory efficiency.
 DISADVANTAGES
 The memory drawback of IDDFS is
that it repeats all the work of the
previous phase.
BIDIRECTIONAL SEARCH
ALGORITHM
 Bidirectional search algorithm runs two
simultaneous searches.
 One form initial state called a forward-
search and other from goal node called as
backward-search
 Bidirectional search replaces one single
search graph with two small sub-graphs
 One starts the search from an initial vertex
and other starts from goal vertex
 The search stops when these two graphs
intersect each other.
 Itstarts traversing from node 1 in
the forward direction and starts from
goal node 16 in the backward
direction
1 13
1
4
1
2 14
9
8 10
3
15
6

5 1
6
ADVANTAGES AND
DISADVANTAGES
 ADVANTAGES
 Bidirectional search is fast.
 Bidirectional search required less
memory
 DISADVANTAGES
 Implementation of the bidirectional
search tree is difficult
 In bidirectional search one should
know the goal state in advance
INFORMED SEARCH
ALGORITHM
 Informed search algorithm contains an
array of knowledge such as how far we are
from the goal,Path,cost , how to reach to
goal node etc
 This knowledge help agents to explore less
to the search space and find more
efficiently the goal node.
 The informed search algorithm is more
useful for large search space.
 Informed search algorithm also called
heuristic search
 Here,the algorithms have
information on the goal state, which
helps in more efficient searching.
 This information is obtained by
something called heuristic.
 3 types of informed search
algorithms.
 Greedy search(best-first Search)
 A* Search
 Ao* Search
GREEDY SEARCH(BEST-
FIRST-SEARCH)
 Algorithm that attempts to find first
most promising path from a given
starting point to a goal.
 It prioritizes paths that appear to be
the most promising, regardless of
whether or not they are actually the
shortest path.
 The algorithm works by evaluating
the cost of each possible path and
then expanding the path with the
How it works!!!!!!!!
 Greedy best-first Search works by evaluating the
cost of each possible path and then expanding
the path with the lowest cost.
 The algorithm uses a heuristic function to
determine which path is the most promising
 The heuristic function takes into account the cost
of current path and the estimated cost of the
remaining paths.
 If the cost of the current path is lower than the
estimated cost of the remaining paths, then the
current path is chosen.
 This process is repeated until the goal is reached.
Example
ADVANTAGES

 Simple and easy to implement


 Fast and efficient
 Low Memory Requirements
 Flexible
 Efficiency
DISADVANTAGES

 Inaccurate Results
 Local Optima
 Heuristic Function
 Lack of completeness
Application

 Path finding
 Machine Learning
 Optimization
 Game AI
 Navigation
 Natural Language Processing
 Image Processing
A* SEARCH ALGORITHM

 A* search algorithm is one of the


best and popular technique used in
path-finding and graph traversals.
 It is really a smart algorithm which
separates it from the other
conventional algorithms
 It finds shortest path through the
search space using heuristic function
 Expand less search tree and provides
optimal result.
 Consider a square grid having many
obstacles and we are given starting
cell and a target cell.We want to
reach the target cell(if possible) from
the starting cell a quickly as
possible.Here A* search algorithm
comes to the rescue
 At each step of algorithm, it picks the node
according to a value ‘f’ which is a parameter equal
to the sum of two other parameter ‘g’ and ‘h’.
 F(n)=g(n)-h(n) this function is called as fitness
number
 At each step it picks the node/cell having the
lowest ‘f’ and process that node/cell.
f=estimated cost of the cheapest solution
g=Actual Cost from start node to n
h=estimated cost from n to goal node
 This is often referred to as the heuristic,which is
nothing but a kind of smart guess
Example
 Initialize the open list
 Initialize the closed list
 Put the starting node on the open list
 Check if open list is empty or not, if
list is empty
 Return failure and step
 Else if select the node from open list
whoch has smallest value of f(n)
 If n is goal node then success & stop
 Else expand node n and generate all of
its successor and put ‘n’ in closed list
 For each successor ‘n’ check weather n
is already in a open or closed list
 If not then compute evaluation function
for “n” and place into open list
 If ‘n’ is already in open or closed list
then it should be attached to the back
pointer which reflects lowest value
 Return to step 2

You might also like