What is A * Search? What is Heuristic Search? What is Tree search Algorithm?

What is a Search Algorithm?

Tree search Algorithm

  • Blind search algorithms (e.g. “Breadth-first” and “Depth-first”) use a fixed strategy to methodically traverse the search tree. Blind search is not suitable for complex problems as the the large search space makes them impractical given time and memory constraints.
  • Best-first search algorithms (e.g. “Greedy” and “A*”) use a heuristic function to determine the order in which nodes are traversed, giving preference to states that are judged to be most likely to reach the required goal. Using a “heuristic” search strategy reduces the search space to a more manageable size.

Breadth-First Search

Bidirectional Search

Uniform Cost Search

Iterative Deepening Depth-First Search

Heuristic Search

Manhattan distance

Pure Heuristic Search

A * Search

(What is heuristic function in ai, What is heuristic search in ai)


  • G — G is the cost of moving from one node to the other node. This parameter changes for every node as we move up to find the most optimal path.
  • H — H is the heuristic/estimated path between the current code to the destination node. This cost is not actual but is, in reality, a guess cost that we use to find which could be the most optimal path between our source and destination.

A * Search Explanation

  • Add start node to list
  • For all the neighbouring nodes, find the least cost F node
  • Switch to the closed list
  • For 8 nodes adjacent to the current node
  • If the node is not reachable, ignore it. Else
  • If the node is not on the open list, move it to the open list and calculate f, g, h.
  • If the node is on the open list, check if the path it offers is less than the current path and change to it if it does so.
  • Stop working when
  • You find the destination
  • You cannot find the destination going through all possible points
1. let the openList equal empty list of nodes
2. let the closedList equal empty list of nodes
3. put the startNode on the openList (leave it's f at zero)
4. while the openList is not empty
5. let the currentNode equal the node with the least f value
6. remove the currentNode from the openList
7. add the currentNode to the closedList
8. if currentNode is the goal10.
9. You've found the end!
10. let the children of the currentNode equal the adjacent nodes
11. for each child in the children
12. if child is in the closedList
13. continue to beginning of for loop
14. child.g = currentNode.g + distance between child and current
15. child.h = distance from child to end
16. child.f = child.g + child.h
17. if child.position is in the openList's nodes positions
18. if the child.g is higher than the openList node's g
19. continue to beginning of for loop
20. add the child to the openList


Turn Text To Speech With Human Like Voices

Human Synthesys Studio

Gcse Maths In Four Weeks





AI subject matter expert

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Beyond Prop Drilling in React: Using Context, Reducers and Custom Hooks to Connect Components

BABY & HELMET NFB Sales On Going

Хайр минь, дурлал минь, шаналал минь.

Life during Juno College’s Bootcamp

These are the Things You Must Do to Land a Junior Web Developer Job in Berlin

Hello World!

Best programming languages for Software Engineers / Developers

C static libraries.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Santosh Pandey

Santosh Pandey

AI subject matter expert

More from Medium

Easynote Lifetime Deal- Organize Any Workload

2 Factors Why Indie Consulting Firms Can’t Say No To Bad Deals (seeing red flags all over).

Towards Racially-Inclusive Voice Interfaces (Part I)

Achieving SDG 4 using EdTech (The importance of achieving equity and inclusivity

Photo by Katerina Holmes from Pexels