0% found this document useful (0 votes)
290 views7 pages

Greedy Best First Search Example

Greedy Best-First Search is an informed search algorithm that utilizes a heuristic function to expand the node closest to the goal, defined by f(n) = h(n). It is used to find the shortest route from City A to City G, following a specific path based on heuristic values. While it is fast and simple, it is not guaranteed to be optimal or complete.

Uploaded by

Arunprakash
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)
290 views7 pages

Greedy Best First Search Example

Greedy Best-First Search is an informed search algorithm that utilizes a heuristic function to expand the node closest to the goal, defined by f(n) = h(n). It is used to find the shortest route from City A to City G, following a specific path based on heuristic values. While it is fast and simple, it is not guaranteed to be optimal or complete.

Uploaded by

Arunprakash
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/ 7

Greedy Best-First Search

Explained with Example Problem


What is Greedy Best-First Search?
• Greedy Best-First Search is an informed search
algorithm that uses a heuristic function h(n).
• It expands the node that appears to be closest
to the goal using h(n).
• Evaluation function: f(n) = h(n)
• Not guaranteed to be optimal or complete.
Problem Statement
• Find the shortest route from City A to City G
using Greedy Best-First Search.
• Cities are connected with paths, and each city
has a heuristic value estimating distance to G.
Graph of Cities
• A
• /\
• 1/ \3
• / \
• B C
• /\ /\
• 3/ \5 2/ \2
• / \/ \
• D E F
Heuristic Values h(n)
• A: 7
• B: 6
• C: 4
• D: 5
• E: 2
• F: 1
• G: 0
Step-by-Step Execution
• Start at A
• Step 1: A → C (h=4)
• Step 2: C → F (h=1)
• Step 3: F → G (h=0)
• Path Found: A → C → F → G
Summary
• Algorithm Type: Informed Search
• Evaluation Function: f(n) = h(n)
• Pros: Fast, simple
• Cons: Not always optimal, may get stuck in
local minima

You might also like