# What is the difference between Djikstra and flow fields?

I understand flow field pathfinding (as illustrated in recent Gas Powered Games titles) consists of 1) computing a vector field covering the map for a given destination, 2) deriving unit directions from their position on that field, and 3) recomputing it at each frame to take dynamic obstacles into account.

I was wondering if the very same steps could be used, but by computing the vector field simply with Dijkstra. After all, if you apply Dijkstra in reverse (from the destination), and continue until you've covered the whole map, you end up with a vector field giving the best direction for each unit trying to get to that destination. If you recompute it each frame, don't you end up with the same behavior and efficiency as flow field, only without the math I don't understand?

• Check out this abstract, for a more detailed summary of research into this question:mit.edu/~jnt/dijkstra.html. The Fast Marching techniques for solving the Eikonal Equation are in fact based on Dijkstra-like techniques. Jun 14 '15 at 19:06

The Fast Marching method for solving the *Eikonal Equation is in fact based on Dijkstra's algorithm. It has O(N log(N)) performance, which is fine for small grids but can be improved on for larger grids by employing either the Fast Iterative or Fast Sweeping methods.