Jump Point Search implementation for a shortest-path algorithm.