Technical

A* algorithm

Shortest-path search algorithm published in 1968 that steers exploration with an estimate of the remaining distance. The backbone of robot navigation and route planning.

Sol sombre quadrillé de dalles de verre vu de haut, traversé en diagonale par un chemin de dalles bordeaux lumineuses qui contourne des blocs de métal brossé, depuis un petit pilier métallique au fond jusqu'à une étoile lumineuse au premier plan
Algorithme A* — Image générée par IA (Qwen-Image 2.1, ComfyUI local)

The A* algorithm (pronounced "A-star") finds the shortest path between two points on a map or a network. Published in 1968 by Peter Hart, Nils Nilsson and Bertram Raphael, researchers at the Stanford Research Institute, it owes its efficiency to one simple idea: at each step, estimate the distance still to cover, and explore the most promising options first. Almost sixty years on, it remains the reference method for planning the movements of robots, video game characters and routes.

Technical definition

Cost so far + estimated cost

A* works on a graph: points (nodes) joined by links that carry a cost, such as a distance or a duration. For a robot, the map is often cut into a grid of small cells, and every free cell is a node.

At each step, the algorithm picks the cell that minimises the sum of two terms: the actual cost from the start, and an estimate of the remaining cost to the goal, the heuristic, often the straight-line distance. If that estimate never overstates reality, the returned path is the shortest possible. The closer the estimate is to reality, the fewer useless cells the algorithm explores.

From grid to real trajectory

The raw A* path follows the cells in a staircase pattern. Before handing it to a robot, it is reworked: obstacles are inflated by a safety margin so the robot does not brush against walls, then the route is simplified into a few straight lines. That is the approach taken by the home-made pilot of the Neato robot vacuum described on this site (article in French): A* on a 5 cm grid, kept clear of walls and furniture already seen, then reduced to a handful of segments, since every segment removed is one fewer stop.

Current challenges

A classic building block inside robots

A* came out of a robotics project: Shakey, developed at SRI from 1966 to 1972, had to plan its way around obstacles. Today's mobile robots, from vacuum cleaners to warehouse carts, still rely on the same division of labour: localise (lidar, odometry, camera), plan (A* or a variant) and follow the path. Even in the era of embodied AI and models that learn to act, these deterministic algorithms remain popular because they are predictable, explainable and cheap to compute.

Limits worth knowing

An optimal path on the map is only useful if the map is right. A* knows nothing about furniture missing from the floor plan, chair legs, or a robot that thinks it is somewhere else: the quality of localisation and mapping matters as much as the algorithm itself. For decision-makers, the lesson reaches beyond robotics: a good optimisation algorithm cannot make up for bad input data, and frequent replanning often beats a perfect plan computed once.

Frequently Asked Questions

How does the A* algorithm work?

A* explores a graph (a map split into cells, a road network) outward from the starting point. For each candidate cell, it adds two values: the cost already travelled from the start, and an estimate of the remaining cost to the goal, called the heuristic (for example the straight-line distance). It always expands the cell with the lowest total first.

That estimate keeps it from wasting effort on directions that obviously lead away from the goal. As long as the estimate never overstates the real cost, the path it returns is guaranteed to be the shortest.

What is the difference between A* and Dijkstra's algorithm?

Dijkstra's algorithm spreads out evenly in every direction, like an ink blot, until it reaches the goal. A* uses the same principle but adds the heuristic, which pulls the search towards the goal.

Both find the shortest path, but A* usually visits far fewer cells, so it runs faster and uses less memory. Dijkstra is still the right tool when you need distances to every destination at once, or when no good estimate is available: it is in fact A* with a heuristic of zero.

What is the A* algorithm used for?

A* shows up wherever a route has to be found: mobile robots (vacuum cleaners, warehouse carts), video games (moving characters around), driving directions and logistics. It was designed in the late 1960s for Shakey, the first mobile robot able to reason about its own actions.

In a robot, A* computes the path on the map; other components work out where the robot actually is (lidar, odometry, visual markers) and drive it along that path.

What are the limitations of A*?

A* assumes a known, static map: when a new obstacle appears, the search has to be run again. On very large maps or very fine grids, the number of cells held in memory grows quickly. And the raw path follows the grid in a staircase pattern, ignoring how the vehicle actually turns.

In practice it is paired with path smoothing, a safety margin around obstacles and frequent replanning. Variants such as D* Lite, Theta* and hierarchical search address these cases.

Resources and Documentation