Least-cost path analysis (LCPA) is a widely recognized and practical algorithm for determining cost-effective paths between two points. This research presents an innovative LCPA designed to identify paths for infrastructure projects with slope threshold conditions (an interval of acceptable slopes). The algorithm incorporates potential DEM modifications through civil engineering structures, including cut-and-fill, tunnelling, and bridging, to include paths that otherwise exceed the maximum slope threshold. We conducted experiments of the developed LCPA on an area with complex topography, the Zagros Mountains in Iran, using three slope thresholds (5°, 8°, and 10°), with and without tunnelling and bridging. The results demonstrated the algorithm’s ability to identify paths with lower cost across all slope thresholds, with the inclusion of tunnelling and bridging leading to further cost reductions. A comparison with an LCPA based on an extended moving window approach highlighted the identification of paths with lower costs, even in the absence of tunnelling and bridging, across all slope thresholds and window sizes. The implementation of the developed LCPA in real-world scenarios is expected to significantly enhance transportation planning and infrastructure design processes.