A* Star Pathfinding

Dijkstra’s Algorithm (Left). A* Algorithm (Right). Source.

Algorithm and Time complexity.

  • The G score is the distance the algorithm has traveled since the start node, every node has a distance 1 from each other, so a smaller G score means a smaller path.
  • The F score is the heuristic function value, this function is similar to a distance formula from one node to the end node, the smaller the F score is, the closer we are.
On the right we are tricking the algorithm as it approaches the end node through a dead end.
Operations count on the left of the code, and some notes on the right.


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

Recommended from Medium

Let us get in touch with Design Patterns-Part 03

Kafka Producer failure handling at multiple levels of Spring abstractions

8 Software to boost your productivity for programmers

Game-Changer for Web Apps — Safaris 15.2 update including File System Access API

MetaRace AIRDROPS | 800 USDT To Win (Nov 23,2021 — Nov 26, 2021)

My First Project Contribution as a Software Engineer

Levenshtein Distance Tutorial

ASCII, Unicode and UTF-8: What are they?

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
David Antonio Jaramillo Bautista

David Antonio Jaramillo Bautista

More from Medium

2. Add Two Numbers

algorithm concept

My Outreachy Internship Introduction: SaySayo

My Internship Experience at Oasis Infobyte