

This A* Path Finding tutorial will show you how to implement the a* search algorithm using python. We will be building a path finding visualizer tool to visualize the a star pathfinding algorithm as it runs. This astar pathfinding algorithm is an informed search algorithm which means it is much more efficient that your standard algorithms like breadth first search or depth first search.
⭐️ Thanks to Simplilearn for sponsoring this video! Check out their data scientist masters program here:
💾 Source Code:
⭐️ Timestamps ⭐️
00:00:00 Introduction
00:03:17 – Algorithm Explanation
00:19:22 – Implementation
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
🔊 Subscribe to my second channel for weekly podcasts!
💰 Courses & Merch 💰
💻 The Fundamentals of Programming w/ Python:
👕 Merchandise:
🔗 Social Medias 🔗
📸 Instagram:
📱 Twitter:
⭐ Discord:
📝 LinkedIn:
🌎 Website:
📂 GitHub:
🔊 Podcast:
🎬 My YouTube Gear 🎬
🎥 Main Camera (EOS Canon 90D):
🎥 Secondary Camera (Panasonic Lumix G7):
📹 Main Lens (EFS 24mm f/2.8):
🕹 Tripod:
🎤 Main Microphone (Rode VideoMic Pro):
🎤 Secondary Microphone (Synco Wireless Lapel System):
🎤 Third Microphone (Blue Yeti USB Mic):
☀️ Lights:
⌨ Keyboard (Daskeyboard 4Q):
🖱 Mouse (Steelseries Rival 300):
📸 Webcam (Logitech 1080p Pro):
📢 Speaker (Beats Pill):
🎧 Headphones (Bose Quiet Comfort 35):
🌞 Lamp (BenQ E-reading Lamp):
🌞 Secondary Lamp (BenQ Screenbar Plus):
💻 Main Monitor (LG 4K):
💻 Secondary Monitor (Thinkvision 1080p):
🎤 XLR Microphone (Rode NT1): Not available
🎙 Mic Boom Arm (Rode PSA 1):
🎚 Audio Interface (Behringer 4 Channel):
💾 Recorder (Zoom H6):
◾ 💸 Donations 💸 ◾
💵 One-Time Donations:
💰 Patreon:
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡
⭐ Tags ⭐
– Tech With Tim
– A* Pathfinding
– A Star Path Finding Tutorial
– A Star Search Algorithm
– Path Finding A Star Tutorial
– Python Path Finding Tutorial
– Python A Star Path Finding Algorithm
– Path Finding Visuallizer
⭐ Hashtags ⭐
#python #pathfinding #astar
source
What other tutorial so you want to see?!
we didn't even make use of the f_score.. we had to compare that right?
For anyone who wants easy access to almost all colors' RGB values, install the colorspy module. It includes the RGB values of many colors and can be used with pygame easily. Command to install it: 'pip install colorspy' . Write it without quotation marks. This could also be helpful for you Tim.
how can i make a topdown camera for my survival game
Do you ever watch the coding train?
why does it think my node is a list lmao
36:09
When creating the heuristic function, the 2 legs of a right triangle isnt equal to the diagonal. Wouldn't you need to use the Pythagorean theorem to find the distance between two points. Or the distance formula?
Amazing
amazing Tim thank you so much
Great tutorial, very helpful, Thank You!
But there are few doubts, hope if it can get cleared, in get_clicked_pos function, why y,x sequence is used? Doesnt pos returns in X,Y format with X being horizontal and Y vertical, origin at top left.
Also if used in as shown way, if i try to get position of barriers, using get_pos, idk why, but rows and columns are interchanged. Can you please clarify this?
Great tutorial Tim !!!!!!!!!!!!!!!!!!!!
hey man, i was trying your code, and there's a index error in "spot = grid[row][col]" can you say it how to fix it?
*when you are literally typing alongside the entire tutorial in the same IDE and you still get errors
Hey everybody i was wondering if you could answer my question. On the lasts couple lines the line right above the lambda function it won’t let me run it. It says there is something wrong with the sort function
what if there are 2 shortest paths of the same length, how does the program choose?
Made this and added Dijkstra's, greedy best first and a couple other cool features check out code if your looking to add some more stuff on my channel
Can you create a tutorial of these but without pygame implementation?
you are very good at explaining stuff
omg line 50 was on my nerves from the start
I have a robot that moves only in black lines, so I have a circuit for it. I was wondering if I can create a "map" of where he can go by using this type of pathfiding visualization
Hey Tim! Keep up the great work! 😊👍
And at 1:30:00 in the video :-
I feel You can add :
"start.make_start() " too , along with " end.make_end() "
So , that way BOTH our Start and End nodes are highlighted with their respective colors…
So it looks like:
if current == end:
reconstruct_path(came_from , end , draw)
end.make_end()
start.make_start()
👈
return True
Just a small addition to the code…But Great job Tim😊 Love that you put the effort and time to teach all of this 👍
you the man, I really needed this project. Almost done with my bootcamp(A/a) and needed a fun break from studying, this was perfect. Cheers!
You are a legend dude, ty so much!
I would love to see an algorithm on Q-Learning in python.
why u have not used github… no one is supposed to download a zip file
This video helped me for my project in AI. Thank you so much
COLORS
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
YELLOW = (255, 255, 0)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
PURPLE = (128, 0, 128)
ORANGE= (255, 165, 0)
GREY = (128, 128, 128)
TURQUOISE = (64, 224, 208)
At 42:30, u can change all the “j” in line 100 to “i” and remove the line 99, its unnecessary. And by doing so the program will run A LOT faster.