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

///A* Pathfinding Visualization Tutorial – Python A* Path Finding Tutorial

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

FavoriteLoadingAdd to favorites

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

By |2021-01-22T11:59:56+00:00January 22nd, 2021|Python Video Tutorials|28 Comments

28 Comments

  1. Tech With Tim January 22, 2021 at 12:00 pm - Reply

    What other tutorial so you want to see?!

  2. THE Nuts January 22, 2021 at 12:00 pm - Reply

    we didn't even make use of the f_score.. we had to compare that right?

  3. Atifa Omer January 22, 2021 at 12:00 pm - Reply

    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.

  4. vaibhav pandey January 22, 2021 at 12:00 pm - Reply

    how can i make a topdown camera for my survival game

  5. Stefen Konkus January 22, 2021 at 12:00 pm - Reply

    Do you ever watch the coding train?

  6. Ewan H January 22, 2021 at 12:00 pm - Reply

    why does it think my node is a list lmao

  7. tacoCat January 22, 2021 at 12:00 pm - Reply

    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?

  8. Franco Yudica January 22, 2021 at 12:00 pm - Reply

    Amazing

  9. Ali Alavizadeh January 22, 2021 at 12:00 pm - Reply

    amazing Tim thank you so much

  10. HINAY MODI January 22, 2021 at 12:00 pm - Reply

    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?

  11. From earth c-34 January 22, 2021 at 12:00 pm - Reply

    Great tutorial Tim !!!!!!!!!!!!!!!!!!!!

  12. Crisis #RE_NAME_ January 22, 2021 at 12:00 pm - Reply

    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?

  13. Alex Bianchi - Define Wisdom January 22, 2021 at 12:00 pm - Reply

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

  14. Viper January 22, 2021 at 12:00 pm - Reply

    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

  15. Michael Truong January 22, 2021 at 12:00 pm - Reply

    what if there are 2 shortest paths of the same length, how does the program choose?

  16. Joseph Leva January 22, 2021 at 12:00 pm - Reply

    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

  17. A. Bisma Nugraha January 22, 2021 at 12:00 pm - Reply

    Can you create a tutorial of these but without pygame implementation?

  18. ZhiJie Li January 22, 2021 at 12:00 pm - Reply

    you are very good at explaining stuff

  19. Ben Birch January 22, 2021 at 12:00 pm - Reply

    omg line 50 was on my nerves from the start

  20. José Freitas January 22, 2021 at 12:00 pm - Reply

    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

  21. Siddharth January 22, 2021 at 12:00 pm - Reply

    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 👍

  22. Shred It January 22, 2021 at 12:00 pm - Reply

    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!

  23. Daniel Trejo January 22, 2021 at 12:00 pm - Reply

    You are a legend dude, ty so much!

  24. Tech Tutorials January 22, 2021 at 12:00 pm - Reply

    I would love to see an algorithm on Q-Learning in python.

  25. Arpit Kapoor January 22, 2021 at 12:00 pm - Reply

    why u have not used github… no one is supposed to download a zip file

  26. raghav gupta January 22, 2021 at 12:00 pm - Reply

    This video helped me for my project in AI. Thank you so much

  27. Luka Ivanić January 22, 2021 at 12:00 pm - Reply

    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)

  28. Satyam SlayZ January 22, 2021 at 12:00 pm - Reply

    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.

Leave A Comment

*