GRASS Meets Longest Flow Paths, Shortest Compute Times
11-05, 13:30–14:00 (America/New_York), Lake Fairfax

We present r.lfp, a GRASS addon for scalable longest flow path analysis using a memory-efficient algorithm with hybrid loop-then-task parallelism. It enables fast, reproducible hydrologic modeling on large terrains and integrates seamlessly into GRASS workflows.


We present r.lfp, a new GRASS addon for computing the Longest Flow Path (LFP) across a large number of watersheds, built for scalable high-performance hydrologic modeling. Based on the Memory-Efficient Longest Flow Path (MELFP) algorithm, r.lfp delivers substantial performance improvements by combining tail recursion with hybrid OpenMP parallelism and minimal memory usage, making it especially well suited for large digital elevation models (DEMs). r.lfp integrates seamlessly into the GRASS ecosystem, leveraging GRASS's native data structures and parallel processing framework. It supports both subwatershed-level and watershed-level LFP analysis modes, and offers reproducible results even across varied multi-threaded environments. The module's design emphasizes computational efficiency, reproducibility, and scriptability, enabling rapid analysis in research and operational workflows. In benchmark comparisons, r.lfp achieves orders-of-magnitude speedups over traditional implementations, without sacrificing accuracy. It also plays a key role in supporting advanced hydrologic modeling tasks, such as river network analysis and travel time estimation. As a contribution to the open-source geospatial community, r.lfp demonstrates how modern algorithmic design and memory-conscious parallelism can revitalize established GIS platforms like GRASS. Its development is part of a broader initiative to modernize and extend GRASS for continental-scale hydrologic modeling, with strong emphasis on scalability, interoperability, and scientific transparency. We highlight case studies on continental datasets to showcase r.lfp's performance, scalability, and integration potential with other GRASS modules and external tools.

Huidae Cho is a Professional Engineer (PE) licensed in Maryland, Member of the American Society of Civil Engineers (M.ASCE), Certified Floodplain Manager (CFM), and Certified GIS Professional (GISP). He is an avid Open-Source advocate and enjoys scientific programming to solve computational problems. He has been part of the Geographic Resources Analysis Support System (GRASS) development team since June 2000, is a member of the GRASS Project Steering Committee, and has special interests in developing and contributing geospatial modules to the Open-Source community. He is also a senior ArcGIS developer.