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 with Java for Beginners

You're reading from  Hands-On Artificial Intelligence with Java for Beginners

Product type Book
Published in Aug 2018
Publisher Packt
ISBN-13 9781789537550
Pages 144 pages
Edition 1st Edition
Languages
Author (1):
Nisheeth Joshi Nisheeth Joshi
Profile icon Nisheeth Joshi

Table of Contents (14) Chapters

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Introduction to Artificial Intelligence and Java 2. Exploring Search Algorithms 3. AI Games and the Rule-Based System 4. Interfacing with Weka 5. Handling Attributes 6. Supervised Learning 7. Semi-Supervised and Unsupervised Learning 1. Other Books You May Enjoy Index

A brief introduction to the A* algorithm


We'll now look at how an A* algorithm works. In this algorithm, we'll calculate two costs. We'll be taking four pieces of input: our start state (a set of implicitly given states), a state transition operator, a goal state, and the heuristic value of each node. Based on those, we'll be calculating our actual cost, g(n) (which we also calculated in our Dijkstra's algorithm). Along with the actual cost, we'll calculate one more cost: the final cost (f(n)). The final cost will be the actual cost plus the heuristic cost (h(n)). The formula is as follows:

 

In the preceding formula, the following applies:

  • g(n) is the actual cost of traversing from the initial state to state n
  • h(n) is the estimated cost of reaching the goal from state n

We are given the following information:

[S,s,O,G,h]

In the preceding statement, the following applies:

  • S is an implicitly given set of states
  • s is the start state
  • O is the state transition operator
  • G is the goal
  • h is the heuristic function...
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 $15.99/month. Cancel anytime}