- Introduced by
- Edsger Dijkstra (shortest path); GIS cost-surface adaptation
- Year
- 1994
- Type
- Raster cost-surface routing
- Family
- Network/raster GIS
What does it do?
Least-cost path analysis finds the route between two locations that minimizes accumulated travel cost across a landscape, rather than straight-line distance.
It encodes terrain, slope, land cover, and other frictions as a cost surface, accumulates cost outward from a source, and traces the cheapest route back to the destination. The accumulation step rests on Dijkstra's shortest-path algorithm (Dijkstra, 1959). Douglas (1994) describes least-cost paths computed in GIS from an accumulated cost surface and slopelines.
The intuition behind the method
The shortest route on a map is often not the cheapest in practice: a straight line may cross a mountain, a swamp, or a built-up area. Least-cost path turns the landscape into a grid in which each cell carries a friction cost, so steep slopes, water, or protected areas cost more to cross. Spreading outward from the start, the method tallies the cheapest accumulated cost to reach each cell, then traces back from the destination along the cheapest links. The resulting route bends around expensive terrain and follows the path of least resistance.
History
The shortest-path logic comes from Dijkstra's 1959 note on problems in graph theory. Douglas (1994) describes least-cost paths in GIS computed from an accumulated cost surface and slopelines. Cost-distance and cost-path tools are now common in raster GIS software.
When to use it
Choose least-cost path analysis when the cost of travel varies across space and the quantity of interest is effort, money, or risk rather than geometric length, for example when routing a road, pipeline, or trail through varied terrain, or mapping movement corridors for wildlife. The input must be a raster cost surface whose weights can be justified, so an analysis that cannot defend its friction layers is a poor fit. Do not use it when the travel network is explicit (for example, roads or rail lines) and routing along network edges is what matters; network shortest-path or vehicle-routing methods are better suited. If the weights are contested, run a sensitivity test over them before reporting a single route.
Limitations and considerations
- The route is only as good as the weights w_k in the cost surface, which are judgements rather than quantities the data supply.
- Accuracy depends on raster cell size: cell costs and step lengths are discretised, so features narrower than a cell cannot be represented faithfully.
- A basic run returns one line per destination; the spread of alternative routes is not shown without corridor or alternative-path analysis.
- The formula attaches cost to the cells entered, so direction-dependent travel cost, such as uphill versus downhill movement, needs an anisotropic extension.
- Route geometry depends on the neighbourhood connectivity used (four or eight neighbours). Grid moves introduce a directional bias that favours routes aligned with the grid axes or diagonals, so the connectivity should be reported and the route tested under an alternative setting.
- The calculation assumes that cost is additive along the path, that each cell's cost applies to the cell entered, and that all cost layers are expressed in one consistent unit. Nodata and impassable cells need explicit treatment, usually exclusion from traversal, and the choice should be stated with the result.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- The cost surface is a weighted sum of factor layers (the cost_surface formula), so several criteria, such as slope and land cover, can enter one route calculation.
- A single accumulation from a source gives the minimum cost to every cell, so the same surface can answer routing questions for many destinations.
- Routes bend around high-cost cells because accumulated cost is minimised over all paths through the grid rather than over a fixed set of straight segments.
- Corridor extensions widen the search beyond the single optimal line, giving a band of low-cost routes rather than one path.
Applications
- Routing roads, railways, pipelines, and transmission lines through terrain.
- Designing hiking trails and recreational corridors.
- Modelling wildlife movement and conservation connectivity corridors.
- Accessibility and cost-distance mapping for services.
- Archaeological and historical movement/route reconstruction.
How it works
How it works
Build a cost (friction) surface as a weighted sum of input layers, C = sum of w_k f_k, where each factor f_k might be slope, land cover, distance to hazards, or regulatory zones. Each cell's value then reflects how costly it is to traverse. The weights w_k encode planning priorities and are the main modelling judgement in the analysis.
Formula
C(x,y) = \sum_k w_k\, f_k(x,y)\quad (\text{weighted friction layers})From the source cell or cells, compute for every cell p the minimum accumulated cost over paths from the source, A(p) = min of the sum of C times step length l along the path. Applied to the grid as a graph, this is Dijkstra's shortest-path algorithm (Dijkstra 1959), and it yields an accumulated-cost surface. Diagonal steps have a longer step length l than orthogonal steps.
Formula
A(p) = \min_{\text{paths } s\to p} \sum_{\text{cells}} C \cdot \ellDuring accumulation, each cell records the neighbour from which it was reached most cheaply, its backlink. Following these links from the destination back to the source traces the least-cost path, which the mechanics step describes as a steepest-descent trace of the accumulated surface. The basic output is one line; corridor variants widen the search to produce a band of low-cost routes instead.
Formula
\text{trace steepest-descent backlink from target to source}Common pitfalls
- Setting friction weights by convention and then presenting the resulting route as objective.
- Reporting a route without testing how it changes when the weights or the cell size change.
- Using the isotropic cost formulation for slope-driven movement, where uphill and downhill costs differ.
- Reading the accumulated-cost value as a distance: it is a sum of cell costs times step lengths, in cost units, not metres of travel.
Frequently asked questions
How is least-cost path different from shortest path?
Shortest path minimizes geometric distance; least-cost path minimizes accumulated cost across a friction surface that encodes slope, land cover, and other factors. The least-cost route can be longer in kilometres but cheaper or safer to traverse, which is usually what infrastructure and ecological planning care about.
What goes into the cost surface?
Any spatial factors that affect traversal cost — slope/steepness, land cover, water bodies, hazard or protected zones, construction cost — combined as a weighted sum. Because the route depends entirely on these weights, they should be justified (often via multi-criteria analysis) and their influence tested by sensitivity analysis.
Can it handle direction-dependent (anisotropic) cost?
Yes, with anisotropic cost-distance methods that make traversal cost depend on the direction of movement (e.g., uphill costing more than downhill). The basic isotropic version assumes cost depends only on the cell entered, which can misrepresent slope-driven travel.
Related methods
Sources
Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1(1), 269–271.
Open DOI referenceDouglas, D. H. (1994). Least-cost path in GIS using an accumulated cost surface and slopelines. Cartographica, 31(3), 37–51.
Open DOI reference