Keywords

1 Introduction

Robots are widely used for the production of all kinds of goods, in military, construction and other working environments. Their widespread and continuous applications require new tasks that should be solved. One such problem is the “navigation and route optimization task”. For example, the navigation of different groups of robots in one construction site requires to perform a variety of parallel works, like the on-site navigation of the construction machinery. To solve such problems, it is adequate to use various heuristic algorithms, as they provide acceptable results within an adequate timeframe.

One of the superior heuristic group of algorithms is the ant colony (ACO) group of algorithms [1, 2]. These algorithms are simulating the real ants behavior. For the first time, these algorithms have been applied in the combinatorial graph task, for the well-known traveling salesman problem [3]. They focus on the solution of various graph problems, which makes it reasonable to apply ACO to solve the optimization problems of the trajectory, in order to move robots in the environment with static obstacles. Some known applications of ACO [4, 5] have shown competitive results.

2 Formulation of the Problem

The purpose of this article is to study the capabilities and features of applying the modified ACO to solve the problem of planning and optimization of the trajectory within the static environment containing obstacles.

The analysis of the ACO application results is necessary to be performed on the specially generated environment test scenes.

3 ACO Description

In this paper we consider the modified classical ACO [4,5,6,7,8,9], which is adapted to find a solution to the problem of laying out the route within the flat environment containing obstacles. The algorithm is based on the mechanism simulating the real ants behavior, when they are looking for food. As in the classical ACO [6, 7], this modification can be divided into conditional steps, such as: placement and initialization, movement of agents, pheromone update and breakpoint condition checking.

All the space considered is divided into equal fragments, in which the agents travel to contribute to the process of the route optimization. To each fragment, a small amount of the positive pheromone is allocated. In order to solve such a problem, it is necessary to construct a route between 2 points (start and finish). We need to allocate the “Start” fragment and place all the agents in it (the analog of the colony). Respectively, the other allocated fragment is the “Finish” point (analogue to the food place).

At the heart of the ant movement mechanism is the classical probability model [5], which is updated with some appropriate modifications.

When the ant moves, it has 8 different options for further travel, as shown in Fig. 1.

Fig. 1
figure 1

Direction options for the agent to travel

The ant transition probability k-th, for the t iteration in each adjacent fragment \( i \in [1;8] \) is calculated according to the modified formula [5], as

$$ P_{ij,k} = \left\{ {\begin{array}{*{20}l} {\frac{{(1 + \tau_{ij} )^{\alpha } \times \eta_{ij}^{\beta } }}{{\sum\nolimits_{l = 1}^{8} {(1 + \tau_{ij} )^{\alpha } \times \eta_{ij}^{\beta } } }},\,\text{if}\,ij\,{\text{available}}^{*} ,} \hfill \\ {0,\, \text{if}\,ij\,not\,{\text{available}}^{*} ,} \hfill \\ \end{array} } \right. $$
(1)

where conditions are preferably transition assessment, and related to the goal direction described by the following model, as proposed by the authors:

$$ \eta_{ij} = (\cos (\gamma ) + 2) + (\cos (\gamma ) + 1)^{\lambda } $$
(2)

where: ij is the fragment; k is the ant number; τ is the pheromone level; η is the “visibility”; α, β, λ are variable coefficients; γ is the angle between goal position, current position and next element position; * means available if fragment is both, adjacent and do not have an obstacle.

At the core of Eqs. (1) and (2), the proposed model is a classic ant algorithm, as used for the optimization of routes in a graph [1,2,3, 6, 7, 10]. However, there are number of incorrect situations that may arise from the calculation related to the probabilities of moving the ants within the specific areas. This fact forced the developers to introduce a number of modifications to this model.

First, the estimated concentration of the pheromone \( \tau \) may be less than an unity found under a certain conditions. Therefore, when calculating the probabilities of the introduced displacement, at each iteration \( \tau \), the summation operation is with this unity. This is done in order to maintain a direct dependence between the pheromone value and the degree coefficient.

There was also a component, which the authors reworked in the heuristic algorithm part [see Eq. (2)], and which is responsible for the attraction to the goal. The classical implementation of the attractiveness, to a particular graph vertex, depends on its distance. This relationship is not direct, and depends on the angle between the point considered to be moving, and the current position of the ant and the finish point.

Also, it should be noted that this addition has added to the algorithm another configuration parameter \( \lambda \), which made this modification even more flexible, to meet the challenges of varying difficulty. Figure 2 shows dependences graphs of the “attraction” values \( \eta \) for different \( \lambda \) values.

Fig. 2
figure 2

Graphics of dependence of the “attraction” for different λ values in polar and Cartesian coordinate systems

Once all the agents reach the finish point, and on all the investigated area, the pheromone is updated applying the following model:

$$ \tau_{ij} (t + 1) = (1 - \rho )*\tau_{ij} ({\text{t}}) + \frac{Q}{{L_{k} }}, $$
(3)

where: ij is the fragment; k is the ant number; ρ is the evaporation coefficient; τ is the pheromone level; t is the iteration number; Q is the constant; L is the route length.

Thus, in the whole space, there is an uniform evaporation of the pheromone, and also on fragments, while the agents built the routes the pheromone is incremented. Moreover, the increment value dependents on the length of the route.

The last step is to verify the breakpoint conditions. In this case the breakpoint condition is limited by the number of iterations.

When applying the algorithm, we are observing the iterative improvement of the route, which is building up to avoid obstacles.

Figure 3 shows the flowchart of the algorithm.

Fig. 3
figure 3

Flowchart of ACO

4 Examples of the Algorithm

Based on the above mentioned ant movement and the update of the pheromone models Eqs. (13), a software tool “PPO_OA_AA” (Path Planning Optimization with Obstacle Avoidances by Ant Algorithm), is designed and implemented to support the experiments.

To check the efficiency of the algorithm 3 test polygons, with obstacles of varying difficulty, were created. Figure 4 shows the defined polygons. The difficulty in this case is linked to the number of obstacles encountered within the zone of movement.

Fig. 4
figure 4

Test polygons (a 1st, b 2nd, c 3rd)

5 Parametric Optimization

Since the algorithm depends on Eqs. (13) having variable parameters, it is advisable to optimize it parametrically. The developed software provides the opportunity to adjust the tuning parameters.

On the basis of previous works [6, 7, 11, 12], 4 key factors (parameters) have been identified to have the greatest influence on the result.

A small number of factors allowed the use of the full factorial experiment (FFE). The applied varying factors values, on 2 levels reduce time and number of required experiments. At the same time, the total factors variation allows to investigate, not only their linear effects, but also the interaction effects [13]. The first test site was selected for the parametric optimization. It was planned for the 2-tier paradigm, the FFE consists of 16 unique combination of factors. For each combinations of factors, 5 tests have been done having 10 parallel experiments in each of them. This was done with the purpose to diversify the random data generated with pseudorandom number generator provided in the computer systems. The initial parameters for these experiments are offered in Table 1. These values were selected based on earlier works [6, 7, 11, 12] performed.

Table 1 Intervals of considered values

The plan of this experiment is partially presented in Table 2. The applied optimization criterion is the percentage of the best optimal route length in the sample experiments. For this test site the best route length is 41 step.

Table 2 Plan of the experiment

Since the values of the regression coefficients and parameters of combinations do not exceed the standard deviation value, it is not necessary to use the gradient method. The parameters α and β are fixed on the lower level, and the parameter λ is fixed for the center of the plan, as it gives the same results, as the one for the upper and the lower level of variation.

Thus, in the view of the specific nonlinear dependence, the ρ value has been found to have the greatest influence. At one of its extremes, the algorithm shows the highest efficiency, thus it was decided to explore the value of 0.9. The results are given in Fig. 5.

Fig. 5
figure 5

Dependence of the optimization criterion based on the ρ value

It is obvious that the value of ρ = 0.9 provide the maximum efficiency of the algorithm. 10 tests with 10 experiments for each of them were carried out to validate the results, taking into account the following values of the parameters: α = 2, β = 0.1, λ = 1, ρ = 0.9. Figure 6 shows a probability chart for the computed results.

Fig. 6
figure 6

Probability of the obtained values

Figure 6 indicates that the probability of getting the best result is equal to 42.73%. To increase this probability, ACO should be applied to this problem with n-th number of times, which can be calculated from the formula:

$$ k = \log \left( {1 - p_{0}^{k} } \right)/log p_{no}^{1} , $$
(4)

where \( p_{no}^{1} \) is the probability of nonappearance optimal results in one solution to the problem; \( p_{o}^{k} \) is the single occurrence probability of optimal result in k-sample set of solutions.

Thus, with a probability of \( p_{o}^{k} = 0.8 \) to get at least one global optimum results by using parametrically suboptimized ACO, it is necessary to apply this algorithm to the problem

$$ k = \log (1 - 0.8)/\log (1 - 0.4273) = - 0.6989/{-}0.242 = 2.888 \approx 3\,{\text{times}}. $$

Table 3 shows the results of calculating Eq. (4) to define the number of tests in order to obtain the optimal results, and in addition the suboptimal results for the different specified trust probabilities.

Table 3 Number of experiments to get the specified result

6 Application Parametrically Optimized ACO

This section presents the results of the tests, which have been obtained by using the parametric suboptimized ACO. Figure 7 shows the shortest routes, which were found for all the 3 earlier described test polygons.

Fig. 7
figure 7

Best routes results

In all 3 cases, the global optimal results were achieved in 100 iterations.

7 Conclusion

The results of these studies indicate that the proposed modification effectively manifested them as the solution to the problem in finding the laying route with obstacles.

The parametric suboptimization significantly has improved the quality of the result. It should be noted that for each particular task, it is required to perform its parametric optimization, as it is strongly influenced by the variety of the test conditions.

Also worth noting is that with almost 100% certainty we can get close to the optimum or even optimal results, when repeating its application to the problem. This indicates that the sub-optimization of the algorithm should be carried out, by focusing not only on the accuracy of the solution, but more important, on the time given to solve the optimization problem.