Generating optimal paths in dynamic environments using River Formation Dynamics algorithm

1 The paper presents a comparison of four optimisation algorithms implemented for the 2 purpose of ﬁnding the shortest path in static and dynamic environments with obstacles. Two 3 classical graph algorithms — the Dijkstra complete algorithm and A* heuristic algorithm 4 — were compared with metaheuristic River Formation Dynamics swarm algorithm and its 5 newly introduced modiﬁed version. Moreover, another swarm algorithm has been compared 6 — the Ant Colony Optimization and its modiﬁcation. Terms and conditions of the simulation 7 are thoroughly explained, paying special attention to the new, modiﬁed River Formation 8 Dynamics algorithm. The algorithms were used for the purpose of generating the shortest 9 path in three diﬀerent types of environments, each served as a static environment and as a 10 dynamic environment with changing goal or changing obstacles. The results show that the 11 proposed modiﬁed River Formation Dynamics algorithm is eﬃcient in ﬁnding the shortest 12 path, especially when compared to its original version. In cases where the path should be 13 adjusted to changes in the environment, calculations carried out by the proposed algorithm 14 are faster than the A*, Dijkstra, and Ant Colony Optimization algorithms. This advantage 15 is even more evident the more complex and extensive the environment is.


Algorithm 1 River Formation Dynamics algorithm
1: Place all drops in starting node 2: Height of nodes ← initial height 3: Height of target node ← 0 4: while end conditions are not met do

5:
Move all drops across the graph 6: Analyse complete paths 7: Height of nodes on paths −= erosion based on path costs 8: Height of all nodes += small amount of sediment 9: end while residing in node i would select the next node j is as follows: V k (i) is a set of neighbouring nodes with a positive gradient (node i has a higher altitude than 124 node j), U k (i) is a set of neighbouring nodes with a negative gradient (altitude of node j is 125 higher), and F k (i) represents neighbours with a flat gradient. Coefficients ω and δ are certain 126 small fixed values. 127 After all drops move, an erosion process is executed on all travelled paths by reducing altitudes 128 of nodes in proportion to their gradient with a successive node (line 7). The erosion amount 129 for each pair of nodes i and j (Equation (4)) also depends on the number of all used drops D, 130 number of all nodes in the graph N , and a certain erosion coefficient E. 131 Additionally, if a drop failed to choose a subsequent node to transition onto, it deposits a 132 fraction of carried sediment and evaporates for the rest of the algorithm iteration. This reduces 133 the likelihood of transition to blind alleys, hence weakening bad paths.
After each iteration a certain, small amount of sediment is added to all nodes (line 8) in order to avoid a situation where all altitudes are close to zero, which would make gradients negligible and 136 would ruin all formed paths. The formula for the sediment to be added is presented in Equation formula and its exemplary results are presented in Figure 1. It is based on two coefficients: pBase, 154 which is the base for the exponent, and α, which is a convergence tuning coefficient. The d j 155 indicates Cartesian distance from node j to the goal.
As can be seen in Figure 1 presents the Ant System algorithm in a form of a pseudo-code.

169
In each iteration, agents-ants start at the initial node. For an ant k located in node i, selection 170 of the next node j is made according to the following likelihood:  Construct a path for each agent.

5:
Update the amount of pheromone on each edge. 6: end while 7: Save the best path.
where N k (i) is a set of nodes connected to the edges of the node in which the ant k is located, 172 and τ i,j is the amount of pheromone on the edge between nodes i and j. the amount of pheromone on a single edge between node i and j is as follows: To simulate the process of volatilization of pheromones, the mechanism of evaporation is 179 introduced. It prevents formation of very large differences between successive edges. The formula 180 for the volatilization of pheromones on an edge is shown in the following equation: where ρ stands for an evaporation coefficient.  configurations. Each environment was scaled to three different sizes: 20×20, 50×50, and 100×100 210 cells, resulting in a total of nine test cases. A graphical representation of those three types of 211 environments is shown in Figure 3.

212
The modified ACO algorithm was developed in a similar manner than the RFD* algorithm.

213
That is, The probability of choosing the next node is divided by distance to the goal, as in the 214 denominator in Eq. (6).

215
Points on maps that represent tested environments were translated into graphs according to were carried out on a personal computer with an Intel Core i7-3770 CPU and 32 GB of RAM.

223
The presented swarm algorithms were set to work for up to 100 iterations.  on its performance and must be adapted to a specific problem, however their tuning is highly 240 unintuitive.

241
After introducing distance heuristic to the ACO algorithm, its performance increased. The 242 additional heuristic improves convergence.

243
The modified RFD* algorithm has found the optimal path in all cases, however its computation 244 times were still 5 to 37 times longer than the fastest obtained from the A* algorithm. Despite and more intuitive parameters. In this way the swarm behaviour is more easily controllable.

251
The modified RFD* algorithm however shows high potential when encountered with dynamic 252 conditions after an initial path calculation.      Based on the results presented in Table 2 it can be reconfirmed that the ACO algorithm new connections for all adjacent nodes. As for the RFD algorithm, the newly created available 291 node is given the default soil amount. Likewise these tests were performed after reinforcing a first 292 path for the starting conditions (Figure 3).

293
The results are similar to those obtained in previous tests. All algorithms except the original 294 RFD and ACO were able to find optimal paths. Analogously, the RFD* algorithm exceeds the 295 other algorithms, especially in extensive environments.

296
As an additional test, the algorithms were tested against introducing a major change in the 297 environment. As opposed to the tests presented above, the major changes mean either moving the   original River Formation Dynamics algorithm was modified to increase its convergence towards a 335 solution. During its operation, a set of agents-drops explores the environment in search for the 336 best path from a starting node to an objective. While searching for a solution, agents modify node 337 heights, which helps to create stronger tendencies towards a given goal. Moreover, properties of 338 the algorithm (in particular, relying on gradient between nodes) ensure its resistance to local 339 cycles.

340
The results obtained in this study have shown that modern swarm algorithms provide an

353
Further work is also required to verify the applicability of swarm algorithms, such as the 354 modified River Formation Dynamics, to generate paths in partly unknown environments. Given the described research, such work is justified, and the results may be promising.