September 7, 2016

Pathfinding

light

You may have been told that light takes the fastest path. Or if you ever used a GPS (Global Positioning System) and magically a path is shown usually the shortest path unless theres traffic than the shortest time is shown. But how? Do protons somehow perform mathmatical calculations in their head to determine which path they should take?

Nope, light actually takes all paths and then due to wave interface only the fastest path is "shown". Of course thats much more simply said and much more than that happens and if really want to know how light takes the "fastest" path you can read Richard P. Feynman's book 'The Strange Theory of Light and Matter'. He explains the topic rather well in a way that you don't need to be a physic's major to understand.

time dialation

As for a GPS, satellites are calibrated percisely because we know of special relativity in 1905 from Einstein that time for moving objects are slower than objects that are stationary thus with the help of relativity to account for this small change in time we can figure out the position of a person using a gps from the time the signal takes to reach that person. Even a slight error would make the position off by a good amount. Not only that but than the gps calculates the shortest or fastest path to get to your destination using an algorithm.

Algorithms can be used for things from data processing, response automation, optimization and pathfinding is just one thing that can be done by implmenting such a thing. The A* algorithm is a common one implemented in games. There are all kinds of algorithms for pathfinding some are better and some are worse, and than there are some that are more extensive and some that are less extensive to use. If you take computer science you'll probably be familiar with the quicksort, bubblesort and later on probably the greedy and divide and conquer algorithm. Point is there is a lot of them.

Tags: Pathfinding