SlideShare a Scribd company logo
1 of 21
The A* Algorithm
Maharaj Dey 11500117099
Sandeep Kumar 11500117059
Artificial Intelligence
The Search Problem
Starting from a node n find the shortest path to a goal node g
10
15
20 ?
20
15
5
18
25
33
Consider the following weighted undirected graph:
5
2
7
10
18
22
66
20
Shortest Path
10
20
16
4
6
8
24
20
6
9
We want: A path 5  v1  v2  …  20
Such that g(20) = cost(5v1) + cost(v1 v2) + … + cost ( 20)
is minimum
Djikstra Algorithm
Greedy algorithm: from the candidate nodes select the one
that has a path with minimum cost from the starting node
10
15
20 ?
20
15
5
18
25
33
Djikstra Algorithm
T
Given a Graph G = (V,E) and T a subset of V, the fringe of T, is
defined as:
Fringe(T) = { (w,x) in E : w  T and x V − T}
Djikstra’s algorithm
pick the edge v in
Fringe(T) that has
minimum distance to
the starting node
g(v) is minimum
Example
5
2
7
10
18
22
66
20
10
20
16
4
6
8
24
20
6
9
Properties
Dijkstra’s is a greedy algorithm
Why Dijkstra’s Algorithm works?
T
V T
The path from u to every node in T is the minimum path
w
u
r
s
v
6
20
20
x
7
15
Example
What does Djikstra’s algorithm will do? (minimizing g(n))
Problem: Visit too many nodes, some clearly out of the question
Complexity
• Actual complexity is O(|E|log2 |E|)
• Is this good?
Actually it is bad for very large graphs!
Branching
factor: b
….
….
# nodes = b(# levels)
Another Example: think of the search space in chess
Better Solution: Make a ‘hunch”!
• Use heuristics to guide the search
– Heuristic: estimation or “hunch” of how to search for a
solution
• We define a heuristic function:
h(n) = “estimate of the cost of the cheapest path from
the starting node to the goal node”
Lets Try A Heuristic
Heuristic: minimize h(n) = “Euclidean distance to destination”
Problem: not optimal (through Rimmici Viicea and Pitesti is shorter)
The A* Search
• Difficulty: we want to still be able to generate the path
with minimum cost
• A* is an algorithm that:
– Uses heuristic to guide search
– While ensuring that it will compute a path with
minimum cost
• A* computes the function f(n) = g(n) + h(n)
“actual cost”
“estimated cost”
A*
• f(n) = g(n) + h(n)
– g(n) = “cost from the starting node to reach n”
– h(n) = “estimate of the cost of the cheapest path from n
to the goal node”
10
15
20
20
15
5
18
25
33
n
g(n)
h(n)
Example
A*: minimize f(n) = g(n) + h(n)
Properties of A*
• A* generates an optimal solution if h(n) is an admissible
heuristic and the search space is a tree:
– h(n) is admissible if it never overestimates the cost to
reach the destination node
• A* generates an optimal solution if h(n) is a consistent
heuristic and the search space is a graph:
– h(n) is consistent if for every node n and for every
successor node n’ of n:
h(n) ≤ c(n,n’) + h(n’) n
n’
d
h(n)
c(n,n’) h(n’)
• If h(n) is consistent then h(n) is admissible
•Frequently when h(n) is admissible, it is also consistent
Admissible Heuristics
• A heuristic is admissible if it is too optimistic, estimating
the cost to be smaller than it actually is.
• Example:
In the road map domain,
h(n) = “Euclidean distance to destination”
is admissible as normally cities are not connected by
roads that make straight lines
How to Create Admissible Heuristics
• Relax the conditions of the problem
– This will result in admissible heuristics!
• Lets look at an 8-puzzle game:
http://www.permadi.com/java/puzzle8/
• Possible heuristics?
Example: Admissible Heuristics in 8-
Puzzle Game
• Heuristic: a tile A can be moved to any tile B
– H1(n) = “number of misplaced tiles in board n”
• Heuristic: a tile A can be moved to a tile B if B is adjacent to A
– H2(n) = “sum of distances of misplaced tiles to goal positions
in board n”
• Some experimental results reported in Russell & Norvig (2002):
– A* with h2 performs up to 10 times better than A* with h1
– A* with h2 performs up to 36,000 times better than a classical
uninformed search algorithm (iterative deepening)
Using A* in Planning
A
C
B A B C
A C
B
C
B
A
B
A
C
B
A
C
B C
A
C
A
B
A
C
B
B
C
A
A B
C
A
B
C
A
B
C
h(n) = “# of goals remaining to be satisfied” g(n) = “# of steps so far”
A* in Games
• Path finding (duh!)
– We will have several presentations on the topic
– We will see that sometimes even A* speed
improvements are not sufficient
– Additional improvements are required
• A* can be used for planning moves computer-controlled
player (e.g., chess)
• F.E.A.R. uses A* to plan its search
A* Algorithm

More Related Content

What's hot

Tools for research plotting
Tools for research plottingTools for research plotting
Tools for research plottingNimrita Koul
 
Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics LabNeil Mathew
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
Dynamic Program Problems
Dynamic Program ProblemsDynamic Program Problems
Dynamic Program ProblemsRanjit Sasmal
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALVivek Kumar Sinha
 
Rumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanRumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanT. Astari
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaEdureka!
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2Koshy Geoji
 
SMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTSSMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTSsolved_assignments
 
Period 4 Quadratic Funtions
Period 4 Quadratic FuntionsPeriod 4 Quadratic Funtions
Period 4 Quadratic Funtionsingroy
 
10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)Roman Brovko
 
APassengerKnockOnDelayModelForTimetableOptimisation_beamer
APassengerKnockOnDelayModelForTimetableOptimisation_beamerAPassengerKnockOnDelayModelForTimetableOptimisation_beamer
APassengerKnockOnDelayModelForTimetableOptimisation_beamerPeter Sels
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualAnkit Kumar
 

What's hot (17)

Tools for research plotting
Tools for research plottingTools for research plotting
Tools for research plotting
 
Computer Graphics Lab
Computer Graphics LabComputer Graphics Lab
Computer Graphics Lab
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Dynamic Program Problems
Dynamic Program ProblemsDynamic Program Problems
Dynamic Program Problems
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Boundary Fill Algorithm in C
Boundary Fill Algorithm in CBoundary Fill Algorithm in C
Boundary Fill Algorithm in C
 
COMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUALCOMPUTER GRAPHICS LAB MANUAL
COMPUTER GRAPHICS LAB MANUAL
 
Rumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai PersamaanRumus VB Menghitung Nilai Persamaan
Rumus VB Menghitung Nilai Persamaan
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | EdurekaA star algorithm | A* Algorithm in Artificial Intelligence | Edureka
A star algorithm | A* Algorithm in Artificial Intelligence | Edureka
 
C programs Set 2
C programs Set 2C programs Set 2
C programs Set 2
 
SMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTSSMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTS
 
Period 4 Quadratic Funtions
Period 4 Quadratic FuntionsPeriod 4 Quadratic Funtions
Period 4 Quadratic Funtions
 
10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)10 - Scala. Co-product type (sum type)
10 - Scala. Co-product type (sum type)
 
APassengerKnockOnDelayModelForTimetableOptimisation_beamer
APassengerKnockOnDelayModelForTimetableOptimisation_beamerAPassengerKnockOnDelayModelForTimetableOptimisation_beamer
APassengerKnockOnDelayModelForTimetableOptimisation_beamer
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 

Similar to A* Algorithm

Informed Search.pptx
Informed Search.pptxInformed Search.pptx
Informed Search.pptxMohanKumarP34
 
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttkt
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttktshamwari dzerwendo.mmmmmmfmmfmfkksrkrttkt
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttktPEACENYAMA1
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data sciencedevvpillpersonal
 
informed_search.pdf
informed_search.pdfinformed_search.pdf
informed_search.pdfSankarTerli
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* SearchIOSR Journals
 
AI 22-23 Chpt3 informed.pptx
AI 22-23 Chpt3 informed.pptxAI 22-23 Chpt3 informed.pptx
AI 22-23 Chpt3 informed.pptxDrChhayaPawar1
 
Lecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdfLecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdfiftakhar8
 
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECUnit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECsundarKanagaraj1
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAndrew Ferlitsch
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsSigSegVSquad
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2MuradAmn
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchPalGov
 
Discrete Mathematics Presentation
Discrete Mathematics PresentationDiscrete Mathematics Presentation
Discrete Mathematics PresentationSalman Elahi
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programminghodcsencet
 

Similar to A* Algorithm (20)

Informed Search.pptx
Informed Search.pptxInformed Search.pptx
Informed Search.pptx
 
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttkt
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttktshamwari dzerwendo.mmmmmmfmmfmfkksrkrttkt
shamwari dzerwendo.mmmmmmfmmfmfkksrkrttkt
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data science
 
informed_search.pdf
informed_search.pdfinformed_search.pdf
informed_search.pdf
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
 
Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5Final slide (bsc csit) chapter 5
Final slide (bsc csit) chapter 5
 
AI 22-23 Chpt3 informed.pptx
AI 22-23 Chpt3 informed.pptxAI 22-23 Chpt3 informed.pptx
AI 22-23 Chpt3 informed.pptx
 
Lecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdfLecture 16 - Dijkstra's Algorithm.pdf
Lecture 16 - Dijkstra's Algorithm.pdf
 
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VECUnit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
Unit II Problem Solving Methods in AI K.sundar,AP/CSE,VEC
 
AI Greedy and A-STAR Search
AI Greedy and A-STAR SearchAI Greedy and A-STAR Search
AI Greedy and A-STAR Search
 
Unit ii-ppt
Unit ii-pptUnit ii-ppt
Unit ii-ppt
 
M4 heuristics
M4 heuristicsM4 heuristics
M4 heuristics
 
Searching
SearchingSearching
Searching
 
Analysis of Pathfinding Algorithms
Analysis of Pathfinding AlgorithmsAnalysis of Pathfinding Algorithms
Analysis of Pathfinding Algorithms
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2
 
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearchJarrar.lecture notes.aai.2011s.ch4.informedsearch
Jarrar.lecture notes.aai.2011s.ch4.informedsearch
 
Discrete Mathematics Presentation
Discrete Mathematics PresentationDiscrete Mathematics Presentation
Discrete Mathematics Presentation
 
Search 2
Search 2Search 2
Search 2
 
unit-4-dynamic programming
unit-4-dynamic programmingunit-4-dynamic programming
unit-4-dynamic programming
 

More from maharajdey

FInal Year Project Presentation
FInal Year Project PresentationFInal Year Project Presentation
FInal Year Project Presentationmaharajdey
 
Medern Symmetric -Key Ciphers (AES, DES)
Medern Symmetric -Key Ciphers (AES, DES)Medern Symmetric -Key Ciphers (AES, DES)
Medern Symmetric -Key Ciphers (AES, DES)maharajdey
 
Merge Sort vs Quick Sort presentation
Merge Sort vs Quick Sort presentationMerge Sort vs Quick Sort presentation
Merge Sort vs Quick Sort presentationmaharajdey
 
Softwere Testing Aplication Specific Techniques
Softwere Testing Aplication Specific TechniquesSoftwere Testing Aplication Specific Techniques
Softwere Testing Aplication Specific Techniquesmaharajdey
 
Classification of Compiler
Classification of CompilerClassification of Compiler
Classification of Compilermaharajdey
 
Cloud Service Models
Cloud Service ModelsCloud Service Models
Cloud Service Modelsmaharajdey
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programmingmaharajdey
 

More from maharajdey (7)

FInal Year Project Presentation
FInal Year Project PresentationFInal Year Project Presentation
FInal Year Project Presentation
 
Medern Symmetric -Key Ciphers (AES, DES)
Medern Symmetric -Key Ciphers (AES, DES)Medern Symmetric -Key Ciphers (AES, DES)
Medern Symmetric -Key Ciphers (AES, DES)
 
Merge Sort vs Quick Sort presentation
Merge Sort vs Quick Sort presentationMerge Sort vs Quick Sort presentation
Merge Sort vs Quick Sort presentation
 
Softwere Testing Aplication Specific Techniques
Softwere Testing Aplication Specific TechniquesSoftwere Testing Aplication Specific Techniques
Softwere Testing Aplication Specific Techniques
 
Classification of Compiler
Classification of CompilerClassification of Compiler
Classification of Compiler
 
Cloud Service Models
Cloud Service ModelsCloud Service Models
Cloud Service Models
 
Travelling salesman dynamic programming
Travelling salesman dynamic programmingTravelling salesman dynamic programming
Travelling salesman dynamic programming
 

Recently uploaded

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 

Recently uploaded (20)

Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptxExploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
Exploring_Network_Security_with_JA3_by_Rakesh Seal.pptx
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 

A* Algorithm

  • 1. The A* Algorithm Maharaj Dey 11500117099 Sandeep Kumar 11500117059 Artificial Intelligence
  • 2. The Search Problem Starting from a node n find the shortest path to a goal node g 10 15 20 ? 20 15 5 18 25 33
  • 3. Consider the following weighted undirected graph: 5 2 7 10 18 22 66 20 Shortest Path 10 20 16 4 6 8 24 20 6 9 We want: A path 5  v1  v2  …  20 Such that g(20) = cost(5v1) + cost(v1 v2) + … + cost ( 20) is minimum
  • 4. Djikstra Algorithm Greedy algorithm: from the candidate nodes select the one that has a path with minimum cost from the starting node 10 15 20 ? 20 15 5 18 25 33
  • 5. Djikstra Algorithm T Given a Graph G = (V,E) and T a subset of V, the fringe of T, is defined as: Fringe(T) = { (w,x) in E : w  T and x V − T} Djikstra’s algorithm pick the edge v in Fringe(T) that has minimum distance to the starting node g(v) is minimum
  • 7. Properties Dijkstra’s is a greedy algorithm Why Dijkstra’s Algorithm works? T V T The path from u to every node in T is the minimum path w u r s v 6 20 20 x 7 15
  • 8. Example What does Djikstra’s algorithm will do? (minimizing g(n)) Problem: Visit too many nodes, some clearly out of the question
  • 9. Complexity • Actual complexity is O(|E|log2 |E|) • Is this good? Actually it is bad for very large graphs! Branching factor: b …. …. # nodes = b(# levels) Another Example: think of the search space in chess
  • 10. Better Solution: Make a ‘hunch”! • Use heuristics to guide the search – Heuristic: estimation or “hunch” of how to search for a solution • We define a heuristic function: h(n) = “estimate of the cost of the cheapest path from the starting node to the goal node”
  • 11. Lets Try A Heuristic Heuristic: minimize h(n) = “Euclidean distance to destination” Problem: not optimal (through Rimmici Viicea and Pitesti is shorter)
  • 12. The A* Search • Difficulty: we want to still be able to generate the path with minimum cost • A* is an algorithm that: – Uses heuristic to guide search – While ensuring that it will compute a path with minimum cost • A* computes the function f(n) = g(n) + h(n) “actual cost” “estimated cost”
  • 13. A* • f(n) = g(n) + h(n) – g(n) = “cost from the starting node to reach n” – h(n) = “estimate of the cost of the cheapest path from n to the goal node” 10 15 20 20 15 5 18 25 33 n g(n) h(n)
  • 14. Example A*: minimize f(n) = g(n) + h(n)
  • 15. Properties of A* • A* generates an optimal solution if h(n) is an admissible heuristic and the search space is a tree: – h(n) is admissible if it never overestimates the cost to reach the destination node • A* generates an optimal solution if h(n) is a consistent heuristic and the search space is a graph: – h(n) is consistent if for every node n and for every successor node n’ of n: h(n) ≤ c(n,n’) + h(n’) n n’ d h(n) c(n,n’) h(n’) • If h(n) is consistent then h(n) is admissible •Frequently when h(n) is admissible, it is also consistent
  • 16. Admissible Heuristics • A heuristic is admissible if it is too optimistic, estimating the cost to be smaller than it actually is. • Example: In the road map domain, h(n) = “Euclidean distance to destination” is admissible as normally cities are not connected by roads that make straight lines
  • 17. How to Create Admissible Heuristics • Relax the conditions of the problem – This will result in admissible heuristics! • Lets look at an 8-puzzle game: http://www.permadi.com/java/puzzle8/ • Possible heuristics?
  • 18. Example: Admissible Heuristics in 8- Puzzle Game • Heuristic: a tile A can be moved to any tile B – H1(n) = “number of misplaced tiles in board n” • Heuristic: a tile A can be moved to a tile B if B is adjacent to A – H2(n) = “sum of distances of misplaced tiles to goal positions in board n” • Some experimental results reported in Russell & Norvig (2002): – A* with h2 performs up to 10 times better than A* with h1 – A* with h2 performs up to 36,000 times better than a classical uninformed search algorithm (iterative deepening)
  • 19. Using A* in Planning A C B A B C A C B C B A B A C B A C B C A C A B A C B B C A A B C A B C A B C h(n) = “# of goals remaining to be satisfied” g(n) = “# of steps so far”
  • 20. A* in Games • Path finding (duh!) – We will have several presentations on the topic – We will see that sometimes even A* speed improvements are not sufficient – Additional improvements are required • A* can be used for planning moves computer-controlled player (e.g., chess) • F.E.A.R. uses A* to plan its search