Trekking in the Alps Without Freezing or Getting Tired
- Cite this article as:
- de Berg, M. & van Kreveld, M. Algorithmica (1997) 18: 306. doi:10.1007/PL00009159
- 288 Downloads
Let F be a polyhedral terrain with n vertices. We show how to preprocess F such that for any two query points on F it can be decided whether there exists a path on F between the two points whose height decreases monotonically. More generally, the minimum total ascent or descent along any path between the two points can be computed. It is also possible to decide, given two query points and a height, whether there is a path that stays below this height. All these queries can be answered with one data structure which stores the so-called height-level map of the terrain. Although the height-level map has quadratic worst-case complexity, it is stored implicitly using only linear storage. The query time for all the above queries is \(O(\log n)\) and the structure can be built in \(O(n\log n)\) time. A path with the desired property can be reported in additional time that is linear in the description size of the path.