# GIS Lab

Geospatial Engineering & Next Intelligence

### Site Tools

efficient_longest_flow_path_algorithm

# Efficient longest flow path algorithm

$\def\LFP{\overrightarrow{\text{LFP}}} \def\FP{\overrightarrow{\text{FP}}} \def\FL{\text{FL}} \def\DFL{\text{DFL}} \def\UFL{\text{UFL}} \def\LFL{\text{LFL}}$

A flow path $\FP_i$ is the watercourse between a pair of two points $i$ within the watershed and the longest flow path $\LFP$ is defined as

$\LFP\in\left\{\FP_i\;:\;\left|\FP_i\right|\geq\left|\FP_j\right|\;\forall i\neq j\right\}.$

The longest flow path plays an important role in hydrologic modeling, but its computation requires multi-step raster calculations for each watershed. This research project aims to improve the current process and efficiency of computing the longest flow path for a lot of watersheds.

## Performance comparisons

Method lfp.sh lfp2.sh r.lfp r.accumulate
Elapsed time 3h 48m 9h 8m 6h 46m 56s