Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Artificial Intelligence for Search

You're reading from  Hands-On Artificial Intelligence for Search

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781789611151
Pages 124 pages
Edition 1st Edition
Languages
Author (1):
Devangini Patel Devangini Patel
Profile icon Devangini Patel

A* Search

In the preceding section, you learned that the path found by a greedy BFS is as follows:

Figure 19

The total distance covered is 14.24. However, the actual optimal solution is shown in the following diagram:

Figure 20

The total distance covered is 12. This means that the greedy BFS algorithm is not optimal. The problem is that the heuristic function doesn't consider the costs already incurred. A* Search proposes a new heuristic function, which computes the sum of the cost incurred and the estimated cost to reach the goal state.

For our application, the heuristic function can compute the sum of the distance traveled from the root node to the current node, and the straight line distance to the goal state. Let's look at the example that we saw in the previous section and compute this new heuristic function for the three nodes Car Park, Bus Stop, and Student...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}