A* Pathfinding Visualization Tutorial - Python A* Path Finding Tutorial

preview_player
Показать описание
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.

⭐️ Timestamps ⭐️
00:00:00 Introduction
00:03:17 - Algorithm Explanation
00:19:22 - Implementation

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾

💰 Courses & Merch 💰

🔗 Social Medias 🔗

🎬 My YouTube Gear 🎬

🎤 XLR Microphone (Rode NT1): Not available

◾ 💸 Donations 💸 ◾
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾

⚡ 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
Рекомендации по теме
Комментарии
Автор

What other tutorial so you want to see?!

TechWithTim
Автор

Tim, a whole series on Ds/algs would be fantastic.

bcorei
Автор

Love this tutorial. Still working on getting my own built. Great fun. 
Really like the graphics, and learning pygame.  
Have done a few things differently -- more classes, fewer variables, visualization tools for the A* algorithm (e.g. coloring neighbors 'light blue').
I am 79 years old and started teaching myself python a year ago, working with the Mandelbrot set. I needed to take a break with something different, and this tutorial gave me the perfect venue.
I've used many of your great tutorials over the last year. Thank you!

jhw
Автор

Im dying on the fact i was LITERALLY doing this yesterday, this would have made it SO EASIER

zackydev
Автор

I saw this video last night, wanted to add it to my portfolio, woke up this morning and made it. Thank you so much Tim! You're the best!

AnmolTheSage
Автор

My friend, only few people understand the joy and satisfaction of building something like this. I loved every minute of it. Thank you so much.

Would be great to see a continuation into the topic of mazes - of course leveraging the the same grid-like visualization engine (aka the grid). It's a great foundation for all sorts of further grid-like problems and topics.

Banta
Автор

Oh man, I have been having a hard time for a past few days trying to make a A* algorithm. And when I'm finally done with it, this just pops up :D nevermind, going to watch the whole thing, might learn a thing or two! Love your vids mate, cheers from Slovakia

michalrybecky
Автор

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)

lukaivanic
Автор

dude to follow the 90 minute tutorial it took me 5 hours, to understand and i typed along. i can imagine the level of effort you put into this. this is my first video i saw on this channel and absolutaly loved it. i subbed.

Rahulsharma-rgce
Автор

This video is ocean of programming knowledge
Will watch it at least 10 times and also recreate this on my own after learning

dabupk
Автор

You're an absolute legend bro. Top notch tutorial.

dallasdominguez
Автор

im setting up an a* algorithm for a university project that I will then optomise using heap optimisation and this made my life so much easier thanks for the help and so well explained

thompsonmedia
Автор

Thanks so much but PLEASE, and I mean PLEASE, make a video on another maze solving algorithm like the follow the wall one, and keep it how you can input the maze by clicking each cell. thanks! 🙏🐹

TgTube
Автор

I usually never leave comments but I felt like you deserve one. I am doing a project for school and had no clue how to start but I found this and it got me going on the right track and was a great intro to pathfinding. Thank you so much for all your work to make this video.

EpicNemo
Автор

I've just watched this 1.5hr clip in one go since it was enjoyable and very helpful. Towards the end you went 2x while my brain was like 0.5x 😂. Thank you so much!!

onemoretube
Автор

Been watching your videos for time man. I felt I've grown with you lol. Everyone who watches this guy we all come a long way from where we started no giving up!

lamedev
Автор

*when you are literally typing alongside the entire tutorial in the same IDE and you still get errors

bianchialex
Автор

I have to say man I really appreciate your videos, I learn a lot with them, since I'm a beginner I really appreciate the way you teach. have been watching you for 2 years by now, in 2020 I was working in a personal project an offline pc voice assistance and a very useful part of the program I learned here with you, unfortunately lost my computer, but the more I see theses videos, I get even more motivated to not give up on my dream of becoming a proper programmer, you really o inspire me to keep on going. Thanks man.

JesseBila
Автор

Last minute project. Lifesaver. Totally recommended.

ashraybaral
Автор

Thanks!

Note: regarding the draw_grid function, no need to re-draw the vertical lines in each iteration:

just draw them once, after the horizontal lines have been drawn:

def draw_grid(window, rows, width):
gap = width // rows
# width: The width of our entire grid (ex: 800px)
# rows: How many rows we have (ex: 50)
# gap: indicates what the width of each spot (node) should be (ex: 800px/50 = 16px)
for i in range(rows):
pygame.draw.line(window, GREY, (0, i * gap), (width, i * gap))
# ☝ draws a horizontal line from (x=0, y=i*gap) --> (x=width, y=i*gap)
for i in range(rows):
pygame.draw.line(window, GREY, (i * gap, 0), (i * gap, width))
# ☝ draws a vertical line from (x=i*gap, y=0) --> (x=i*gap, y=width)

faris.abuali