Reader small image

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

Product typeBook
Published inAug 2018
Reading LevelIntermediate
PublisherPackt
ISBN-139781789537550
Edition1st Edition
Languages
Right arrow
Author (1)
Nisheeth Joshi
Nisheeth Joshi
author image
Nisheeth Joshi

Nisheeth Joshi is an associate professor and a researcher at Banasthali University. He has also done a PhD in Natural Language Processing. He is an expert with the TDIL Program, Department of IT, Government of India, the premier organization overseeing language technology funding and research in India. He has several publications to his name in various journals and conferences, and also serves on the program committees and editorial boards of several conferences and journals.
Read more about Nisheeth Joshi

Right arrow

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 page is locked
Previous PageNext Page
You have been reading a chapter from
Hands-On Artificial Intelligence with Java for Beginners
Published in: Aug 2018Publisher: PacktISBN-13: 9781789537550

Author (1)

author image
Nisheeth Joshi

Nisheeth Joshi is an associate professor and a researcher at Banasthali University. He has also done a PhD in Natural Language Processing. He is an expert with the TDIL Program, Department of IT, Government of India, the premier organization overseeing language technology funding and research in India. He has several publications to his name in various journals and conferences, and also serves on the program committees and editorial boards of several conferences and journals.
Read more about Nisheeth Joshi