4.2.1. Initiate the DM

Table 1 presents pseudocode for the initialization of a DM, including three functions, i.e., (1) **initialize()** to set aside certain space for required data structures and then initial their values; (2) **setObstacleCell(***o***)** to register a newly inserted obstacle cell; and (3) **removeObstacleCell(***o***)** to reset an removed obstacle cell. Upon initialization, all the cells are set to be traversable and undetermined, declaring that there is no obstacle cell, neither in the map, nor in finite distance (lines 1 to 7). When a cell *o* is marked as an obstacle cell by calling **setObstacleCell(***o***)**, it sets *disto* as 0 and refers to itself as the closest obstacle cell, i.e., *obsto* = *o* (lines 8 and 9). Conversely, when *o* is freed by calling **removeObstacleCell(***o***)**, the function **resetCell(***o***)** resets it to the initial values, i.e., *disto* = ∞ and

*obsto* = ∅ (line 11), and *raiseo* is set as true (line 12). The function **insert (***OPEN***,** *c***,** *d***)** inserts a cell *c* into *OPEN* with a priority value *d*, or updates the priority if *c* is already in *OPEN*.


**Table 1.** The pseudocode for initialization.
