User:TerribleTadpole/sandbox

In computer science, jump point search is an optimization to the A* search algorithm pathfinding algorithm for uniform-cost grids. It reduces symmetries in the search procedure by means of graph pruning, eliminating certain nodes in the grid based on assumptions that can be made about the current node's neighbors, as long as certain conditions relating to the grid are satisfied. As a result, the algorithm can consider long "jumps" along straight (horizontal, vertical and diagonal) lines in the grid, rather than the small steps from one grid position to the next that ordinary A* considers.

Jump point search preserves A*'s optimality, while potentially reducing its running time by an order of magnitude.

Description
The jump point search algorithm focuses on discovering jump points. A jump point represents a potential change of direction in the optimal path from the origin to a goal point.

Applicability
The jump point search algorithm is applicable to search problems that can be defined as a grid with the following characteristics: These constraints are satisfied most obviously by using a grid to represent 2-dimensional space.
 * 1) The problem graph must be represented as a grid consisting of square units.
 * 2) The movement cost must be uniform across the entire grid.
 * 3) Movement is constrained to eight directions: the four cardinal directions and the four diagonal directions.

Assumptions
Given the above constraints jump point search can make the following simplifying assumptions when searching:
 * 1) The lowest-cost path between any two points on the grid is represented by the geometrically shortest path.
 * 2) It is only necessary to investigate a single path through any region of path symmetry.
 * 3) If the goal is reachable through a direct line of travel then no lower-cost path to the goal will exist.

Neighbour Pruning
Neighbour pruning rules are determined by the direction of travel and the presence of obstructions around a cell. Each cell has one natural neighbour, which exists when no obstructions are present. These diagrams illustrate the natural neighbours for both cardinal and diagonal directions.

Two different pruning rules have been published for cardinal travel when obstructions are present. One rule applies when corner-cutting is allowed. Another pruning rule applies when corner-cutting is not permitted.





History
Harabor and Grastien's original publication provides algorithms for neighbour pruning and identifying successors. The original algorithm for neighbour pruning allowed corner-cutting to occur, which meant the algorithm could only be used for moving agents with zero width; preventing its application to either real-life agents (e.g. robotics) or simulations (e.g. many games).

The authors presented modified pruning rules for applications where corner-cutting is not allowed the following year. This paper also presents an algorithm for pre-processing a grid in order to minimise online search times.

A number of further optimisations were published by the authors in 2014.

All the published modifications and optimisations preserve A* optimality.