This is a terribly short video of a graph transversal algorithm.
I was wondering how GPSs and video-game pathing works (ie, how does the GPS calculate your route so quickly?— or rather, how does it calculate it at all?)
The answer is pretty ingenious, and actually quite simple.
From your starting location, instead of searching each individual possible route (or which there would be billions), the algorithm determines the shortest amount of steps it will take to any given location.
From there, planning a route is easy: just follow the numbers.
A friend explained the logic to me, and I just had to try it out for myself, which is why you see the material in this video.
I thought it would be entertaining to try to code the basic logic he told me. It was not only entertaining, but instructive as well.
Hopefully it made sense to you.
Thanks for watching/reading.
Link to this comment:
All Comments (0)