**Long Qin, Yue Hu, Quanjun Yin \* and Junjie Zeng**

College of Systems Engineering, National University of Defense Technology, Changsha 410073, China; qldbx2007@sina.com (L.Q.); huyue.cse@gmail.com (Y.H.); zjjnudt@foxmail.com (J.Z.)

**\*** Correspondence: yin\_quanjun@163.com

Received: 2 April 2019; Accepted: 13 May 2019; Published: 16 May 2019

**Abstract:** In the context of robotics and game AI, grid-based Distance Maps (DMs) are often used to fulfill collision checks by providing each traversable cell maximal clearance to its closest obstacle. A key challenge for DMs' application is how to improve the efficiency of updating the distance values when cell states are changed (i.e., changes caused by newly inserted or removed obstacles). To this end, this paper presents a novel algorithm to speed up the construction of DMs on planar, eight-connected grids. The novelty of our algorithm, Canonical Ordering Dynamic Brushfire (CODB), lies in two aspects: firstly, it only updates those cells which are affected by the changes; secondly, it employs the strategy of Canonical Ordering from the fast path planning community to guide the direction of the update; therefore, the construction requires much fewer cell visits and less computation costs compared to previous algorithms. Furthermore, we propose algorithms to compute DM-based subgoal graphs. Such a spatial representation can be used to provide high-level, collision-free roadmaps for agents with certain safety radius to engage fast and rational path planning tasks. We present our algorithm both intuitively and through pseudocode, compare it to competing algorithms in simulated scenarios, and demonstrate its usefulness for real-time path planning tasks.

**Keywords:** distance map; incremental algorithms; canonical ordering; path planning; subgoal graph
