Comparison of Various Methods for the Calculation of the Distance Potential Field
The distance from a given position toward one or more destinations, exits, and way points is a more or less important input variable in most models of pedestrian dynamics. Except for the special case when there are no obstacles in a concave scenario – i.e. each position is visible from any other – the calculation of these distances is a non-trivial task. This isn’t that big a problem, as long as the model only demands the distances to be stored in a Static Floor Field also called Potential Field, which never changes throughout the whole simulation. In this case a pre-calculation once before the simulation starts is sufficient. But if one wants to allow changes of the geometry during a simulation run – imagine doors or the blocking of a corridor due to some hazard – in the Distance Potential Field, calculation time matters strongly. This contribution gives an overview over existing and new exact and approximate methods to calculate a potential field, analytical investigations for their exactness, and tests of their computation speed. The advantages and drawbacks of the methods are discussed.
💡 Research Summary
The paper provides a comprehensive survey and performance evaluation of methods for computing distance potential fields (DPFs), also known as static floor fields, which are a fundamental input for pedestrian dynamics simulations. In static scenarios a DPF can be pre‑computed once, but in dynamic environments—where doors open, corridors become blocked, or hazards appear—the field must be updated repeatedly, making computational efficiency crucial.
Metric Foundations
The authors begin by defining p‑norms on a two‑dimensional rectangular grid. The Manhattan (p = 1) and Chebyshev (p → ∞) metrics correspond to the von Neumann and Moore neighborhoods, respectively, and can be calculated extremely fast using flood‑fill (or wave‑front) algorithms. However, neither metric yields the true Euclidean distance (p = 2), which is required for realistic pedestrian behavior that assumes global knowledge of the shortest path around obstacles.
Exactness‑Improving Variants
Four flood‑fill‑based variants are introduced to bridge the gap between speed and Euclidean accuracy:
-
Variant 1 (Manhattan + Chessboard Combination) – Perform two flood‑fills, one with Manhattan and one with Chessboard distances, compute the per‑cell minimum of the absolute coordinate differences, and combine them via the Pythagorean theorem. This yields exact Euclidean distances for cells that are directly visible from the destination, but when a path consists of several line segments the method underestimates the total distance because the square‑root of summed squares is not taken. The worst‑case error can reach about –15.9 % of the true distance.
-
Variant 2 (√2 over Corners) – Modify the Chessboard flood‑fill so that diagonal steps cost √2 instead of 1. This makes distances at 45° exact and improves overall accuracy. The maximal over‑estimation is about +8.2 % of the true distance, while the average error stays around –5 %. The error does not accumulate with the number of segments, making it more robust for complex obstacle layouts.
-
Variant 3 (Larger Neighborhoods) – Extend the neighborhood to cells two or three steps away, reducing recursion depth and stack usage. The trade‑off is a higher chance of “over‑looking” narrow obstacles; the authors do not explore this variant further.
Visibility‑Graph + Dijkstra
A different class of exact methods builds a visibility graph: nodes are the destination, obstacle corners, and any other points that may be needed for navigation; edges exist only between mutually visible nodes. Running Dijkstra’s algorithm on this graph yields exact Euclidean distances for all graph nodes, after which distances for the remaining grid cells are interpolated using the graph. While mathematically exact, constructing the graph is O(N²) in the number of cells, and the preprocessing time dominates for large grids, making it unsuitable for real‑time updates.
Iterated Ray‑Casting
The authors propose an iterative ray‑casting algorithm. First, all cells directly visible from the destination are assigned their Euclidean distance. Then the algorithm repeatedly selects the unprocessed cell closest to the destination that has at least one unprocessed neighbor, casts rays from this cell to all cells within a predefined “board” radius, and updates distances where the new path is shorter. Ray casting uses Bresenham’s line algorithm, but instead of drawing a line for every visibility check, a rectangle around the whole scenario is drawn once, and rays are cast only to the board’s perimeter cells. This reduces the number of line draws from O(area) to O(board size). The method balances accuracy (it respects true line‑of‑sight) with speed, and is especially well‑suited for dynamic environments where obstacles appear or disappear.
Error Analysis
Closed‑form expressions for the absolute and relative errors of Manhattan and Chessboard metrics are derived: the Manhattan error is bounded by (√2 – 1)·D_E, and the Chessboard error by (√0.5 – 1)·D_E, where D_E is the exact Euclidean distance. For Variant 1 the error depends on the number of line segments N in the path; as N grows the error can approach –15.9 % of D_E. For Variant 2 the error per cell is independent of N, with a worst‑case over‑estimate of about +8.2 % and a systematic under‑estimate of roughly –5 % on average.
Experimental Evaluation
Five test geometries are used: a typical room, a 200 × 200 maze, a circular room of diameter 996 cells, a square room of side 3998 cells, a room with a large central column, and a ring‑shaped room (same size as the circle). For each geometry the authors measure the wall‑clock time required by the following methods: (i) basic Manhattan flood‑fill, (ii) basic Chessboard flood‑fill, (iii) Variant 1, (iv) Variant 2, (v) visibility‑graph + Dijkstra, and (vi) iterated ray‑casting. The results confirm the theoretical expectations: basic flood‑fills are the fastest (often sub‑millisecond for modest grids) but exhibit the largest distance errors; the visibility‑graph method is the most accurate (error essentially zero) but can be orders of magnitude slower (seconds to minutes for the largest grids); ray‑casting occupies a middle ground, delivering near‑Euclidean distances with computation times roughly an order of magnitude higher than basic flood‑fills but far lower than the graph‑based approach.
Conclusions and Recommendations
The study highlights a clear trade‑off between computational speed and distance accuracy. For real‑time simulations with dynamic obstacles, the authors recommend either the √2‑over‑corners variant or the iterated ray‑casting method, as they provide acceptable accuracy (average error < 10 %) while keeping update times within interactive limits. For offline analyses or scenarios where exact distances are critical (e.g., validation studies, evacuation planning with static geometry), the visibility‑graph plus Dijkstra approach remains the gold standard despite its computational cost. The paper also demonstrates that modest modifications to classic flood‑fill (Variants 1 and 2) can substantially improve Euclidean fidelity without requiring a complete redesign of existing simulation codebases.
Overall, the work offers a valuable decision framework for researchers and practitioners needing to select or implement a distance‑potential‑field computation method that aligns with their performance constraints and accuracy requirements.
Comments & Academic Discussion
Loading comments...
Leave a Comment