Path finding Algorithms A Vs Jump Point Search
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.
Introduction
A* and Jump Point Search are both shortest-path techniques used heavily on grid maps, but they are not interchangeable. A* is the more general algorithm, while Jump Point Search, usually called JPS, is a specialized optimization for uniform-cost grids where many neighbor expansions are symmetric and therefore redundant.
What A* Gives You
A* explores nodes using the score f = g + h, where g is the known path cost so far and h is the heuristic estimate to the goal.
The important strength of A* is generality. It works on many graph types, not only simple game grids. If your map has weighted terrain, unusual movement rules, or dynamic graph structure, A* is usually the safer starting point.
What JPS Changes
JPS does not replace A*'s goal of finding a shortest path. Instead, it changes how neighbor expansion works on suitable grids. Instead of stepping to every adjacent tile, it jumps forward in a direction until it reaches a meaningful turning point, obstacle, or forced neighbor.
That means JPS can skip large stretches of obvious intermediate cells that plain A* would still visit one by one. On open uniform grids, that can reduce the number of expanded nodes dramatically.
The price is specialization. JPS depends on assumptions about the map structure and movement cost model.
Where JPS Usually Wins
JPS is most attractive when:
- the world is a regular grid
- movement cost is uniform
- the map contains large open areas
- pathfinding queries are frequent enough that search overhead matters
In that setting, the pruning rules remove a lot of symmetric work. A* is still the underlying search idea, but JPS cuts down the search frontier aggressively.
In many game maps with eight-direction movement and mostly static terrain, that is a very practical speedup.
Where A* Is Usually the Better Choice
A* is usually the better engineering decision when:
- terrain costs vary
- movement rules are irregular
- the graph is not a simple grid
- maintainability matters more than raw speed
- the map changes often and specialized pruning becomes awkward
That does not mean JPS is bad. It means JPS is an optimization with assumptions. If those assumptions stop fitting the domain, the implementation complexity stops paying for itself.
Heuristics Still Matter
Both approaches still depend on a good heuristic. On four-direction grids, Manhattan distance is common. On eight-direction grids, octile distance is often more appropriate.
If the heuristic is inconsistent with the movement model, your comparison between A* and JPS is not fair. The heuristic and neighbor rules need to match across both algorithms before benchmarking.
Compare Them With the Right Metrics
Do not compare only wall-clock time from one map. A better comparison includes:
- path optimality
- expanded node count
- runtime across several map shapes
- behavior on cluttered maps as well as open maps
- implementation complexity and debugging cost
Expanded node count is often more informative than raw timing because it is less sensitive to machine noise and language-specific overhead.
Implementation Complexity Is Real
A* is easier to teach, debug, and modify. JPS requires directional jump logic and forced-neighbor rules, which makes the implementation harder to maintain.
That matters in real systems. A well-implemented A* that the team understands can be a better long-term choice than a theoretically faster JPS implementation that only one person can debug.
If your maps are static and the pathfinding layer is performance-critical, JPS can absolutely be worth it. If not, plain A* is often the right tradeoff.
Common Pitfalls
A common mistake is applying JPS to maps with non-uniform movement cost and expecting the same correctness and speed properties. Another is benchmarking on very open maps only, then deploying on cluttered maps where the gain is much smaller.
Teams also often compare the two algorithms using different heuristics or different movement rules, which invalidates the result.
Finally, do not ignore implementation cost. A specialized algorithm that is difficult to maintain can lose its advantage quickly in a real codebase.
Summary
- A* is the general-purpose shortest-path baseline and works on many graph types.
- JPS is a grid-specific optimization that prunes symmetric expansions.
- JPS is strongest on static, uniform-cost, open grid maps.
- A* is usually the safer choice when movement costs or graph rules are more complex.
- Compare them on realistic maps with consistent heuristics before deciding.
Related reading
- Pathfinding on large map
- Pathfinding routing, trip planning, ... algorithms on graphs with time restrictions
- paxos algorithm - how does the propose stage work?
- Paxos algorithm in the context of distributed database transaction
- paxos for system builder
- Paxos leader election might not terminate
- Paxos questions if proposer down, what happened?
- Paxos understanding

DSA Fundamentals
Master algorithmic patterns and data structures through hands-on LeetCode-style problems - from arrays and hashing to dynamic programming and advanced graphs.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Data Structures & Algorithms practice on Codemia
Step through 300 algorithm problems with animated visualisers that show the data structure changing as the code runs.