A* Pathfinding Algorithm (Coding Challenge 51 - Part 1)

preview_player
Показать описание


Other Parts of this Challenge:

References:

Live Stream Archive:

Related Coding Challenges:

Timestamps:
0:00:00 Introduction
0:01:26 A* Pathfinder
0:09:39 Coding a Grid
0:13:09 A* Pathfinder Algorithm
0:22:07 Choosing Best Available Path
0:27:05 Finding New Nodes
0:38:30 Adding Heuristic
0:41:50 Tracing Back
0:46:49 Using Better Heuristics

Editing by Mathieu Blanchette
Animations by Jason Heglund
Music from Epidemic Sound

#aalgorithm #pathfinding #heuristic #p5js #javascript
Рекомендации по теме
Комментарии
Автор

I ended up here while trying to fix my own version of A* code for a personal project. Although in a completely different language, I figured following the logic from start to finish would help. I am happy to say that after watching this twice, clocking in at a near 2 hours of of the most energetic coding I've ever observed, I realized one of my i's were a j.

drlipnose
Автор

People like you do more for students than many universities around the world. Cheers to learning 🎉

akshayrdts
Автор

I know this is a pretty old video, but for anyone watching. The reason it wasnt giving his expected results with no walls and no diagonals is because you need to add tiebreaking in. You can do this simply by changing


for (int i = 0; i < openSet.Count; i++)
{
if (openSet[i].F < openSet[winner].F)
winner = i;
}

Too


for (int i = 0; i < openSet.Count; i++)
{
if (openSet[i].F < openSet[winner].F)
winner = i;
else if (openSet[i].F == openSet[winner].F)//tie breaking
if (openSet[i].H < openSet[winner].H)
winner = i;
}

CodingWithUnity
Автор

I have been binge watching your videos over the holiday vacation...and I just don't know how I can express my gratitude for making these amazing videos. Your enthusiasm, presentation style...makes what would be a tough process (learning to program) a VERY enjoyable learning process. A massive thank you for sharing your incredible knowledge. You just got a new member.

sennabullet
Автор

I honestly don't know what I would do without you.

dumbcalamitychild
Автор

If I had more professors who teach like you I was a better engineer now !

taradis
Автор

For any of you wondering, this is the kind of algorithm top down view rpgs and mobas use like league, runescape, fallout etc

ipwnzyanoobz
Автор

This was super helpful for actually learning A*. I have tried to do it multiple times in C# but never got it working, but ~3 days ago i figured it out thanks to this video. You rock!

viggzta
Автор

So after a mess and 2 hours you finished it? You are BRILLIANT my friend!

sulochandhungel
Автор

Translating this into C# for unity is... interesting. Tough to find a good tutorial on pathfinding, luckily this seems to be working for me so far. Love the videos keep up the great work : )

canitbeapplied
Автор

I'm in web dev and watching this. Idk why but this is refreshing some good memories lol

dtymnn
Автор

4:36 "The algorithm is typically written with a formula. The formula's actually quite simple, although any time you write a formula, it starts to be like, 'Oh my god, is this really what we're doing today?' "
haha ily dan

jesseefcf
Автор

Man, thank to you again!! I'm so interesting in algorithms and ML, but didn't know where to start. And your lectures are such a good place to start and go far! It's really great, new level, so different to compare with usual front-end JS, it's real science, it's interesting, it's improve you. Thank you!

АлексейГусар-фй
Автор

at 25:48 you create a function to find the index of the `current` element, but you already know that value, it is the value stored in `winner`, so I think you could just do `openSet.splice(winner, 1)`, or without side effects: `openSet = openSet.slice(0, + 1, openSet.length))`

adamjc
Автор

Really Really Really!!!! Fantastic Video. I really love his energy while he was teaching!! Wish I could have this man as my professor. Amazing!!

tanmayagarwal
Автор

Looks just like a robot finding an optimal path through a building. ;)

freeidaho-videos
Автор

Thanks to your inspiration I finally managed to implement an object oriented version of Astar for Codewars. Keep up the good work!

petergriffith
Автор

It is fantastic how this guy has so muck inspiration and energy to program, and a lot of that anergy actually hi is giving to us, BIG THANKS YO HIM :D

CHITUS
Автор

Holy crap what a good A* explanation at the beginning

BukovTervicz
Автор

I cannot stop watching your videos. The way you explain your process of coding is excellent. Awesome videos, I always look forward the the next one!!

JavaVampire
visit shbcf.ru