0% found this document useful (0 votes)
20 views31 pages

Unit 2

The document discusses various problem-solving methods in AI and ML, focusing on uninformed (blind) and informed (heuristic) search strategies. It provides examples of both types of searches, including Breadth First Search, Depth First Search, Greedy Best-First Search, and A* Search, along with their evaluation functions and conditions for optimality. Additionally, it touches on local search algorithms and their advantages, as well as links to further resources on related topics.

Uploaded by

rishiv1947
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)
20 views31 pages

Unit 2

The document discusses various problem-solving methods in AI and ML, focusing on uninformed (blind) and informed (heuristic) search strategies. It provides examples of both types of searches, including Breadth First Search, Depth First Search, Greedy Best-First Search, and A* Search, along with their evaluation functions and conditions for optimality. Additionally, it touches on local search algorithms and their advantages, as well as links to further resources on related topics.

Uploaded by

rishiv1947
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/ 31

FUNDAMENTALS IN AI AND

ML
Unit 2

Problem Solving Methods


Gyan Prakash Tiwary 100311

Uninformed Search or Blind Search


The term means that the strategies have no additional information
about states beyond that provided in the problem definition. All they can
do is generate successors and distinguish a goal state from a non-goal
state.
Gyan Prakash Tiwary 100311

Informed Search or Heuristic Search


Strategies that know whether one non-goal state is “more promising”
than another are called informed search or heuristic search.
Gyan Prakash Tiwary 100311

Uninformed Search or Blind Search


Examples of Uninformed Search or Blind Search:
Breadth First Search
Depth First Search
Bidirectional Search
Many more.
Gyan Prakash Tiwary 100311

Informed Search or Heuristic Search


Examples of Informed Search or Heuristic Search:
 Greedy best-first search
 A* search: Minimizing the total estimated solution cost
 Memory-bounded heuristic search
Gyan Prakash Tiwary 100311

Breadth First Search

Visit all the children nodes of the


current node before going to the
next depth.

Order can be: 1. A, B, C,


Gyan Prakash Tiwary 100311

QUEUE

Queue is First In First Out (FIFO)


Gyan Prakash Tiwary 100311

Breadth First Search Using Queue

The Graph BFS on The Graph

BFS Order can be A, B, C, D, K, L, J, M


Gyan Prakash Tiwary 100311

Depth First Search


Gyan Prakash Tiwary 100311

Depth First Search


Gyan Prakash Tiwary 100311

STACK

Stack is First In Last Out (FILO)


Gyan Prakash Tiwary 100311

Depth First Search Using Stack

The Graph DFS on The Graph

DFS Order can be A, D, L, K, C, J, M, B


Gyan Prakash Tiwary 100311

Bidirectional Search
01/31/2025 14

Informed (Heuristic) Search Strategies


• An informed search strategy—one that uses problem-specific knowledge beyond
the definition of the problem itself—can find solutions more efficiently than can an
uninformed strategy.
• The general approach we consider is called best-first search. Best-first search is
an instance of the general TREE-SEARCH or GRAPH-SEARCH algorithm in which a
node is selected for expansion based on an evaluation function, f(n).
• The evaluation function is construed as a cost estimate, so the node with the lowest
evaluation is expanded first.
• The choice of f determines the search strategy.
• Most best-first algorithms include as a component of a heuristic function,
denoted h(n):
• h(n) = estimated cost of the cheapest path from the state at node n to a goal
state.
• f(n) defines the cost.
• h(n) is the overall estimated cost.
01/31/2025 15

Informed (Heuristic) Search Strategies

• Greedy Best First Search


• A* search: Minimizing the total estimated solution cost
• Memory-bounded heuristic search
01/31/2025 16

Greedy Best-First Search


• Greedy best-first search tries to expand the node that is closest to the goal, on
the grounds that this is likely to lead to a solution quickly. Thus, it evaluates nodes
by using just the heuristic function; that is, f(n) = h(n).
01/31/2025 17

Greedy Best-First Search


Greedy best-First Search always try for
Local Optimal rather than global optimal.
01/31/2025 18

A* Search: Minimizing the total estimated solution cost

• The most widely known form of best-first search is called A∗ search (pronounced
“A-star SEARCH”). It evaluates nodes by combining g(n), the cost to reach the node,
and h(n), the cost to get from the node to the goal:
• f(n) = g(n) + h(n) .

• Since g(n) gives the path cost from the start node to node n, and h(n) is the
estimated cost of the cheapest path from n to the goal, we have
• f(n) = estimated cost of the cheapest solution through n .

• Thus, if we are trying to find the cheapest solution, a reasonable thing to try first is
the node with the lowest value of g(n) + h(n).
• It turns out that this strategy is more than just reasonable: provided that the
heuristic function h(n) satisfies certain conditions, A∗ search is both complete and
optimal.
01/31/2025 19

A* Search: Conditions for optimality

• The first condition we require for optimality is that h(n) be an admissible


heuristic.

• An admissible heuristic is one that never overestimates the cost to reach the goal.

• Because g(n) is the actual cost to reach n along the current path, and f(n)=g(n) +
h(n), we have as an immediate consequence that f(n) never overestimates the true
cost of a solution along the current path through n.
01/31/2025 20

A* Search: Conditions for optimality

• A second, slightly stronger condition called consistency (or sometimes


monotonicity) is required only for applications of A∗ to graph search.
• A heuristic h(n) is consistent if, for every node n and every successor n` of n
generated by any action a, the estimated cost of reaching the goal from n is no
greater than the step cost of getting to n` plus the estimated cost of reaching the
goal from n`:
• h(n) ≤ c(n, a, n`) + h(n`) .

• Estimated cost of reaching to goal from new position should be less than or equal to
estimated cost of reaching to goal from old position.
01/31/2025 21

Other Content on Heuristics Technique


• https://www.javatpoint.com/heuristic-techniques
01/31/2025 22

Local Search Algorithm

• In some problems path to solution is irrelevant.


• If the path to the goal does not matter, we might consider a different class of
algorithms, ones that do not worry about paths at all.
• Local search algorithms operate using a single current node (rather than
multiple paths) and generally move only to neighbors of that node. Typically, the
paths followed by the search are not retained.
• Although local search algorithms are not systematic, they have two key
advantages:
• (1) they use very little memory—usually a constant amount; and
• (2) they can often find reasonable solutions in large or infinite (continuous) state
spaces for which systematic algorithms are unsuitable.
01/31/2025 23

Local Search Algorithm

• Following local search algorithms are possible:


• Hill-climbing search
• Simulated Annealing
• Local beam search
01/31/2025 24

Hill-Climbing Algorithm

• YouTube link: https://www.youtube.com/watch?v=3SiWtAnUROs


• https://www.javatpoint.com/hill-climbing-algorithm-in-ai

• These content are already discussed in the class.


01/31/2025 25

Simulated Annealing

• YouTube link: https://www.youtube.com/watch?v=ct9rpyxbgaE

• These content are already discussed in the class.


01/31/2025 26

Local Beam Search

• YouTube link: https://www.youtube.com/watch?v=r6h9hydNhPw


• https://www.javatpoint.com/define-beam-search

• These content are already discussed in the class.


01/31/2025 27

Searching With Partial Observations

• YouTube link: https://www.youtube.com/watch?v=_UStErjxV8Y


• Constraint Satisfaction Problems 1:
https://www.youtube.com/watch?v=AgyCSmDVk5s
• Constraint Satisfaction Problems 2:
https://www.youtube.com/watch?v=udOfKqeLVSg

• Constraint propagation and Intelligent Bactracking are discussed in this


video.
01/31/2025 28

Game Playing

• YouTube link: https://www.youtube.com/watch?v=FFzdXJ49KAI


• https://www.youtube.com/watch?v=Ntu8nNBL28o
01/31/2025 29

Optimal Decisions in Game

• YouTube link: https://www.youtube.com/watch?v=dbbsNWw87co


01/31/2025 30

Alpha Beta Purning

• YouTube link: https://www.youtube.com/watch?v=dEs_kbvu_0s


01/31/2025 31

Stochastic Games

• YouTube link: https://www.youtube.com/watch?v=KMUdMM1sAxA

You might also like