4.1.1. Lower and Raise Wavefronts

Following the basic ideas of Dynamic Brushfire algorithms, CODB employs two kinds of wavefront, lower and raise wavefronts, to incrementally update DMs. CODB keeps a priority queue (denoted as *OPEN*) to sort the cells to be explored by the wavefronts. A cell's priority is determined by its *dists* value and is dequeued with increasing priority values. When a cell is popped from *OPEN*, the distance change on it will be propagated to its adjacent cells and any inconsistent cells (i.e., cells which are affected by the wavefront) are again put on *OPEN*, so as to prepare for the next round of propagation.

As shown in Figure 4a, when an obstacle cell (red dot denoted as *s*) is newly inserted into the center of the grids, it firstly sets *dists* as 0 and *obsts* as its own coordinates; then, a so called "lower wavefront" is launched to propagate a distance reduction to its adjacent cells (as shown in Figure 4b). This propagation emanates from *s*, the source of the change, and terminates when the distance change no longer affects anymore cells (as shown in Figure 4c,d, the wavefront encounters cells which keeps equal clearance to other obstacle cells and thus failed to continue the propagation.). Finally, new boundaries of the updated DM are reached and the distance values of all affected cells are updated (As shown in Figure 4e).

**Figure 4.** Lower wavefront propagation. (**a**) Insert a new obstacle cell; (**b**) Launch a lower wavefront; (**c**) Propagate the distance change; (**d**) Reach edges of affected area; (**e**) New DM is reconstructed.

On the other hand, when an obstacle cell is removed (e.g., as Figure 5a shows, we again remove the center obstacle cell *s* from the map), all the cells whose *obst* and *dist* value are computed based on *s* become invalid; therefore, a so called "raise wavefront" is launched to reset these invalid cells, declaring that they can be then updated by other lower wavefronts (as shown in Figure 5b). The "raise wavefront" terminates at the boundaries between *s* and other obstacle cells (as shown in Figure 5c), then lower wavefronts on the other sides of the boundaries are permitted to continue their propagation until the invalid region is again submerged (as shown in Figure 5d) and Figure 5e).

**Figure 5.** Raise wavefront propagation. (**a**) Remove the center obstacle; (**b**) Launch a raise wavefront; (**c**) Propagate the resetting to the invalid edges; (**d**) Continue the lower wavefront from other sides; (**e**)The invalid region is again submerged.
