Back to Browse

A* Star Algorithm with Python

2.2K views
Dec 21, 2025
21:17

๐ŸŒŸ This is Part 5 of our Python Graph series. In the last video, we built Dijkstra's Algorithm - the "Accountant" that finds the cheapest path by counting every penny. In this video, we are going to do something even cooler: we will upgrade that exact same code into A-Star. We do not need to rewrite the whole algorithm! We will see how adding just one simple variable - a Heuristic (guess) changes the entire behavior of our search. We will transform our "accountant" into a "smart compass" that knows exactly which direction to go, prioritizing the most promising paths first (f = g + h). ๐Ÿ“š What you will learn: * The difference between Dijkstra (Blind Search) and A* (Heuristic Search) * How to refactor Dijkstra code into A* with minimal changes * Bonus - where to fix the old Dijkstra code from the previous video, as it had some indentation errors. ๐Ÿงช Tech stack: * Python 3 * Jupyter ๐Ÿงฎ The set of videos and articles for Graph Theory: โ–ถ๏ธ Graph Theory Set: https://youtu.be/gwUDbV_VGI0 https://youtu.be/tNVU9HSyVxE https://youtu.be/e0RBEHvAI_4 https://youtu.be/VjA_VFO_I6g A* Star Algorithm with Python - This one! https://youtu.be/-rlHYNPQhyQ โ–ถ๏ธ Other (older), related to graph theory: https://youtu.be/DVgqA8-c1oI https://youtu.be/8vnu_5QRC74 https://www.vitoshacademy.com/vba-depth-first-search-algorithm-with-vba https://www.vitoshacademy.com/python-get-the-shortest-path-in-a-weighted-graph-dijkstra/ โ–ถ๏ธ Video with A-Star, just solving it in Excel and listening to music. https://youtu.be/yAx6QGoOdIs ๐Ÿ“ Links ๐Ÿ“ VitoshAcademy blog: https://www.vitoshacademy.com/python-a-star-search-in-graph/ ๐Ÿ“ GitHub code: https://github.com/Vitosh/Python_personal/tree/master/YouTube/048_Python-Graph ๐Ÿ‘ Like, ๐Ÿ’ฌ Comment, and ๐Ÿ”” Subscribe for more real-world programming tutorials. #python #a-star #algorithms #coding #graphtheory

Download

1 formats

Video Formats

360pmp423.1 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

A* Star Algorithm with Python | NatokHD