Abstract
In this study, a series of new concepts and improved genetic operators of a genetic algorithm (GA) was proposed and applied to solve mobile robot (MR) path planning problems in dynamic environments. The proposed method has two superiorities: fast convergence towards the global optimum and the feasibility of all solutions in the population. Path planning aims to provide an optimal path from a starting location to a target location, preventing collision or so-called obstacle avoidance. Although GAs have been widely used in optimization problems and can obtain good results, conventional GAs have some weaknesses in an obstacle environment, such as infeasible paths. The main ideas in this paper are visible space, matrix coding and new mutation operators. In order to demonstrate the superiority of this method, three different obstacle environments have been used and an experiment is conducted. This algorithm is effective in both static and dynamic environments.
1. Introduction
Path planning is a crucial issue in artificial intelligence and MR domains. The issue concerns the search for feasible paths for MRs to move from a start location to a target location in an environment with obstacles [1]. The path planning environment can be either static or dynamic [2]. In the static environment, everything is static except the MR. Before a robot moves towards the target, the nearest feasible path must be obtained. However, one or more obstacles would be intersected, while the computation processes are complicated. Researchers have been searching alternative and more efficient ways to solve the path planning problems [3].
Many techniques and algorithms have been applied to solve path planning problems, such as grid-based A* algorithms [4–6], road maps (Voronoi diagrams and visibility graphs) [7,27, 28], D* algorithms [8, 29–31], fuzzy logic [9], genetic algorithms [2], particle swarm algorithms [10], PBIL algorithms [11], ant colony algorithms [12], simulated annealing [13], potential field methods [14, 15] and so on. Each has its merits and drawbacks in different environments. For example, an A* algorithm can acquire a solution faster than a GA in relation to small-scale maps.
GAs were first proposed by Holland [16], informed by the theory of evolution [17]. In other words, they are inspired by biological evolution and have proved to be robust and powerful adaptive search techniques [18]. Indeed, GAs have been successfully applied to optimization problems in many domains.
A dynamic robot path planning schema for unknown environments is studied in [19]. In [20], GAs are used to generate the optimal path by exploiting the advantage of its strong optimization ability, leading to the proposal of a tailored genetic algorithm for optimal path planning. GAs have attracted considerable interest due to their usefulness in solving complex robot path planning problems [11].
However, GAs also have some shortcomings, for example, slow convergence rates, local optima and ignoring cooperation between populations [21].
Based on the advantage of other optimization algorithms, many researchers have studied hybrid genetic algorithms. A hybrid of an ant colony algorithm and a GA can reduce the risk of falling into a local minimum and minimizing the execution time. [22] studied the use of a hybrid multi-neuron heuristic search and genetic algorithm. Other researchers have concentrated on modifying operators belonging to GAs. Adem Tuncer in [2] improved a new mutation operator and applied it to the path planning problem for an MR; good results were obtained.
In light of the previous studies, some new methods are proposed for solving path planning problems for an MR in this paper. It involves an improved GA, as well a new population generation strategy, a novel environment representing and encoding method, and novel mutation operators. The proposed improved genetic algorithm (IGA) allows the MR to navigate in a dynamic environment without being trapped. Comparisons with A*, D* and two IGAs are summarized in Table 1.
This article is organized as follows. In section 2, some preconditions are listed and the concept of visible space is described. In section 3, the proposed IGA is described in detail. In section 4, experiments are performed in order to make a comparison between the proposed method and A*, D* and two IGAs. A conclusion of this paper is given in section 5.
Comparison between the proposed IGA and A*, D* and the other IGAs
2. Concept of Visible Space
Since GAs have been frequently used, this paper will not describe the basic GA as referenced in [2, 23, 24,26]. Rather, this paper focuses on visible space, new mutation operators and the modification method of infeasible genes.
2.1. Assumptions
To simplify the path planning problem, it is necessary to make some assumptions. They are as follows:
At least one path along which a robot can move from a start location to a target location is available.
The obstacle space is known.
All obstacles are made up of unit grids, whether regular or irregular, as shown in Figures 2 and 3.
This improved algorithm is represented in a two-dimensional (2D) space.
The path point is always the centre of a grid.
In order to simplify calculation, amplification is carried out in relation to the obstacles.
According to the upper assumption f, the robot can be considered as a particle without considering its dimensions.
2.2. Problem space representation
Many path planning methods for MRs use a grid-based graph to represent the obstacle space, as shown in Figure 1. This paper takes the same approach, but with a different encoding method. In Figure 1, the darker colours represent obstacles, while the lighter colours represent obstacle-free spaces.
Some methods in the literature use orderly numbered encoding to represent the relative position of grids [2]. When applying the methods in the literature, a decoding operation is required. A matrix encoding method is applied in this paper; therefore, there is no need to decode. In this method, the position of a grid is reliant upon its row index and column index. For example, a grid
In this matrix encoding method, the problem space is indicated in Figure 1. According to an arbitrary grid within an obstacle problem, its position can be obtained from its subscript, as well as the positions of eight neighbourhood grids. In this paper, visible space can be obtained according to the relative positions of grids.

An example using the matrix encoding method to represent the obstacle environment
2.3. Concept of visible space
As light travels in straight lines, no one can see the object behind the obstacles. Based on the Markov process, the position of a path waypoint only depends on its previous waypoint. An environment space
If an MR tries to obtain a path from the starting point to the target point, the path waypoint from current visible space
This concept seems similar to the visibility map method in [10], even though they are different concepts. The visibility map method can obtain globally optimal solutions; however, when the environment has changed, much time is required for re-calculation. Meanwhile, the method in this study is only concerned with obstacles in front of the MR, which means the complexity can be reduced.
2.4. Method to obtain visible space
In an obstacle environment, obstacles can be all kinds of shape, but only a small number of vertices play a decisive role in the line of sight. In Figure 2, there are three types of vertices in an obstacle, but only vertices marked with red circle 1 have an effect on visible space calculation.
To obtain visible space, three steps are required: first, the obstacles that impact on the line of sight most obviously need to be obtained (these obstacles are called the “outer envelope”); second, vertices that have an effect on calculation need to be obtained (the action is a further simplification process); and third, obstacle-free grids as visible space can be obtained.
2.4.1. Method to obtain the “outer envelope”
Before the optimization operations, the obstacle environment and the shape of each obstacle must be known. Owing to the matrix representation, the shapes and positions of obstacles can be obtained quickly. In this paper, a new concept of the “outer envelope” is proposed, which is important to visible space calculation; see Figure 2.
The “outer envelope” will be explained by the example in Figure 2. There exists an obstacle consisting of nine grids,
Steps to obtain an “outer envelope”
This is a general method to obtain an “outer envelope” of obstacles. No matter how complex or large it is, obstacles can be simplified by this method. “Outer envelopes” are always on the outside of obstacles, which means that this method can obtain them quickly.

An example of an “outer envelope”
Here is a simple example to illustrate how to get an “outer envelope” for an obstacle: the obstacle is in Figure 2 and the specific steps are in Table 3.
Instance of steps to obtain an “outer envelope” as shown in Figure 2
This method is also suitable for the concave polygon, as shown in Figure 3, in which the “outer envelope” is
2.4.2. Method to obtain effective vertices
The amount calculated is still large after “outer envelopes” are obtained. The next step is to obtain effective vertices of the grids. If
Lower left vertex:
Lower right vertex:
Upper left vertex:
Upper right vertex:
Centre:
This method can convert the subscript of a grid in a problem space to a 2D coordinate system in the xy-plane. At this moment, the four vertices of a grid can be obtained, but not all vertices have an effect on the visible space calculation. Therefore, further simplifying is necessary, such as grid

An example of a concave polygon
According to the relative positions of eight neighbourhood grids, the following equations can be obtained.
Eqs. (1) and (2) indicate that grids
In Eq. (9), N equals 0/1. If
Vertices and obstacle relations
Meanwhile, the effective vertices can be obtained by using the following equation:
2.4.3. Method to obtain the visible space of the current position
According to the above methods, every effective vertex in relation to obstacles can be obtained. When the centre of current point
Grids that are between the maximum angle
As Figure 2 illustrates, the visible space of current point
By choosing one point from
3. An Improved Genetic Algorithm
3.1. Chromosome encoding
The encoding method is one of the key steps in the design of a GA. The widely used encoding methods include binary encoding, the Gray code, the floating number code and the real number code.
A variant on the character encoding method with a variable length strategy is used in this paper.

Chromosome encoding strategy
As shown in Figure 4, there are two chromosomes, or paths:
3.2. Initialization of population
The population initialization in this paper is based on the concept of visible space. In an obstacle space, robots need to avoid obstacles.
When an MR moves from a starting point, a new waypoint can only be selected from the current visible space. After several iterations, the target point exists in the visible space. A new path is formed by the selected path points; the specific process is shown in Table 5.
In Table 6, a comparison of methods to acquire the initialization population is shown; the simulation scenario is Map 6 in section 4.1. According to the results, the method in this study can obtain an initialization population more quickly than that in [2].
Pseudocode of the initial solution
Comparison of the initial solution results information
3.3. Selection operation
The main principal of the GA is the survival of the fittest, which means chromosomes with the best fitness should survive and be transferred to future generations. The classical roulette selection method is adopted in this paper. If a chromosome has a larger fitness value, a higher likelihood will be selected.
3.4. Fitness function or evaluation function
The fitness function determines how good a chromosome is within a population. Generally speaking, a fitness function is transformed from the objective function. The selection of the fitness function influences the convergence of the algorithm.
The challenge implicit in the path planning problem is to obtain an optimal path, in which the final solution must be the shortest and most feasible.
In Eq. (11), i is the index of the path point in a chromosome.
3.5. Crossover operation
In the case of infeasible solutions in a population, some researchers have included punitive factors in these infeasible solutions. When the selection operator works, the infeasible solutions have an extremely low probability of being selected. Even if they are selected, their filial generation has a higher probability of being infeasible, which results in a decrease in population diversity.
Although initial solutions in this paper are all feasible, a few infeasible solutions may be obtained after a crossover or mutation operation. Where their parents are all feasible, the infeasible gene only appears at the crossover or mutation point.
Generally speaking, GAs use crossover to exchange genetic material. A single-point crossover operator is applied in this study, with genes of two chromosomes after the crossover point being swapped. The crossover operation is shown in Figure 5.

Crossover operation
As Figure 5 illustrates, the length of two parents used in a crossover operation can be different.
After the crossover operation, filial generations may contain infeasible genes; the method to solve this situation is given in section 3.8.
3.6. Mutation operator
Mutation, which is one of the most important operators in GAs, is used to maintain diversity in the population and avoid premature convergence.
In conventional GAs, random mutation is the most commonly used operator. However, random mutation can lead to infeasible paths, slowly converging and leading to local optimum.
Two new mutation methods are proposed in this paper, which can ensure converging towards the global optimum.

Comparison of mutation methods
Table 7 shows the steps of the mutation operation.
Steps of the mutation operation
In Figure 6 (a), a random mutation is described; 7 (b) is the mutation operator mentioned in-text; and (c) is the mutation method proposed in this paper.
In Figure 6 (c), a path is
This mutation method is different from other studies’ representations. Firstly, this function selects three waypoints, instead of selecting one waypoint, which increases the velocity of convergence; secondly, this function traverses grids crossed by path segments, such that more grids can be selected as new waypoints and guarantee that the best waypoints are obtained; and thirdly, this function can avoid obstacles and shorten the computing time.
This method is different from that in [25], with the difference being that this method can find an appropriate path point in the neighbourhood, rather than on a pathway, thereby avoiding local optimum. The theoretical basis of this operation can be interpreted in terms of geometric language, which states that the sum of any two sides of a triangle is greater than the third side.
3.7. Additional mutation
To avoid local convergence, an additional mutation operator is proposed in this study. The main idea of this mutation operation is to delete one path waypoint from a chromosome. The operation may cause intersection with obstacles. This additional mutation can increase diversity of population. Figure 7 shows how this additional mutation works.
In Figure 7, waypoint

Comparison of mutation operators
Table 8 shows the steps of an additional mutation operator.
Additional mutation operation
3.8. Infeasible gene modification method
After crossover or additional mutation, an infeasible gene may exist in a chromosome. But this situation only appears at the genetic operation point. The method to modify an infeasible chromosome only needs to amend genes at the genetic operation point. The function is shown in Figure 8 and the steps are in Table 9.
In Figure 8, path segment
Method to modify a genetic operation, which is infeasible

Method to modify an infeasible chromosome
Up to now, each chromosome in a population satisfies the condition of constraint and obstacle avoidance.
4. Simulation
In order to demonstrate the efficiency of the proposed algorithm, the results of three different obstacle environments are compared with other IGA studies. A hundred trials have been separately carried out in nine environments. The parameters of GA in this study are as follows:
where
4.1. Simulation results in a static environment
Simulations results in six different static maps are compared with other two IGAs. Each map consists of a 16×16 grid. To evaluate the efficiency of the proposed IGA, two performance metrics were assessed: the path length and the convergence generations. The path length can represent the shortest path obtained by algorithm. The convergence generation can represent the population diversity.
The six different maps are illustrated in Figure 9.

The trajectory of the best path obtained by the proposed IGA

Distribution of box plot generations for each map according to different IGAs
According to Table 10, the IGA in reference [26] obtains a shorter path than that in reference [2], while the proposed IGA obtains the best performance. The reason is that the proposed IGA adopts new waypoints from the neighbourhood of two adjacent path lines, resulting in a much higher likelihood for obtaining globally optimal solutions.
Figure 10 shows the box plot of the convergence generations and the different maps for each IGA, in which each map for each algorithm is repeated 20 times. In Figure 10(a), the results of an IGA in reference [2] on Map 1 show that a maximum convergence generation is 74 and a minimum convergence generation is 23. On Map 3, we can see the lowest generation value is 15, which constitutes a premature convergence explained by a lack of diversity in the population. In Figure 10(b), the results show that the IGA in reference [26] has a large convergence distribution, while the convergence is worse than the IGA in reference [2]. In Figure 10(c), the convergence is stable on each map, with the maximum difference (19) found on Map 3. The most convergent generations are less than 25.
Simulation results on two large-scale maps are compared with A* and D* algorithms: one map consists of a 200×200 grid in Figure 11, while another one consists of a 1000×1000 grid in Figure 12. Three performance metrics are: the path length, the calculation time and the number of waypoints. The results are as follows:

(a) The trajectory of the best path obtained by A*; (b) the trajectory of the best path obtained by D*; and (c) the trajectory of the best path obtained by the proposed IGA (scale 200 × 200)

(a) The trajectory of the best path obtained by A*; (b) the trajectory of the best path obtained by D*; and (c) the trajectory of the best path obtained by the proposed IGA (scale 1,000 × 1,000)
Comparison of results according to A*, D* and the proposed IGA
As shown in Figure 11 and Table 11, a map with the size200×200 is presented. The results indicate that A* and D* algorithms obtain optimal solutions rapidly, but the only drawback is that too many path points are stored; meanwhile, the proposed algorithm can obtain a shorter path in less time and with fewer path points.
In Figure 12, the A* algorithm takes more than 18 hours to obtain the optimized path, but the path has many jagged lines, which can cause more abrasion to the mechanics of the MR. The D* algorithm results in a shorter path than A* in less time. The proposed algorithm offers the best solution and in an acceptable time.
The only drawback of the proposed algorithm is that the time consumption is larger than A* and D* in small-scale maps. The reason is that the GA involves an optimization process based on population, while the total time is larger than A* and D* after the optimization operation. If the optimization operations are not applied, the time is almost the same for the A* and D* algorithms, while each chromosome in a population can be used as a path without considering its length.
4.2. Simulation results in a dynamic environment
In this section, simulation results obtained by the proposed IGA and the other two IGAs in three different dynamic environments are compared.
Figure 13 illustrates an initial static environment, which consists of 16 × 16 grids, and six obstacle regions formed by 57 grids [2]. Figure 14 shows a dynamic environment, which is changed after a robot moves to the third path waypoint.

Referenced static environments

Referenced dynamic environments
As Figures 13 and 14 illustrate, this algorithm can obtain a global optimal solution and performs better than other algorithms found in [2, 26].
In Table 12, this method converges towards the global optimal solution within 100 trials, and with less time consumed. The reason is that a concept of visible space is applied in this proposed method, such that every path waypoint only depends on its previous waypoint.
In Table 13, an optimal solution is found in 76 trials, while an approximate optimum is found in 24 trials; as such, the result is obviously better than in the literature. The time consumed is a little greater than in the literature. It is important to note, however, that the solution time contains the time consumed to handle infeasible paths.
Comparison of experimental results for the static environment in Figure 13
Comparison of experimental results for the modified environment in Figure 14
As Tables 12 and 13 illustrates, convergence results of different methods are compared. When an environment changes, both methods can converge rapidly, but this proposed method can converge towards a global optimal solution.
Another obstacle environment stated in [2] and [26]. Figure 15 shows a path that is found in a static environment. In Figure 16, an environment is changed after a robot moves to the fifth path waypoint.
In this experiment, as shown in Tables 14 and 15, results are compared not only with reference to the literature, but also with mutation operators in this study.
In a static environment, the optimal solution is obtained in 67 trials without additional mutation, while the optimal solution is obtained in 84 trials with additional mutation and the convergence generations, while the time consumed is a little more. The initial solution time, however, is less than the method in reference [2]. The method with an additional mutation operation consumes more time, but the convergence rate is improved.
In a dynamic environment, the optimal solution is obtained in 67 trials without additional mutation, while the optimal solution is obtained in 84 trials with additional mutation. Meanwhile, both mutation methods converge in the first generation, with more speed than stated in reference [2].
As Table 15 illustrates, the method in this study converges towards the optimal solution more rapidly than in the aforementioned reference when the environment changes.

Referenced static environments

Referenced dynamic environments
Comparison of experimental results for the modified environment in Figure 15
Comparison of experimental results for the modified environment in Figure 16
In Table 15, the optimal solution can be obtained in a dynamic environment when the optimal solution is obtained in a static environment.
This proposed method can rapidly converge towards the optimal solution. In a dynamic environment, if a path segment intersects an obstacle and its two end points are
To clarify, the method in this study can be used in irregular shapes; a new environment is modelled in Figure 17. In Figure 18, the environment is changed when a robot is going to move and the path needs to be replanned.
In Table 16, the consumed time of the initial solution is less than that in the reference. The optimal solution can be obtained in 100 trials, while the number of average convergence generations is 9.

An irregular static environment

An irregular dynamic environment
Comparison of experimental results for the modified environment in Figure 17
Comparison of experimental results for the modified environment in Figure 18
In a dynamic environment, the optimal solution can be obtained in 76 trials without additional mutation, while the optimal solution can be obtained in 91 trials with additional mutation. In Table 17, both these mutation methods can converge rapidly, but the method with additional mutation consumes more time than the other two methods.
In Table 17, the method in this study can obtain a better initial solution and faster convergence towards the optimal solution without an infeasible solution.
5. Experiments
In order to demonstrate the effectiveness of the method in this paper, experiments have been conducted.
The experiment system is divided into two parts: slave computer and host computer. The optimization algorithm was developed in the C# programming language using Microsoft Visual Studio. The program-running platform is a 2.9 GHz Intel Core Duo CPU E7500 with 2GB of memory. The slave computer is the MR, which uses uCOSII as the running system. The distance travelled is obtained from wheel odometry, while the information of the position and orientation is obtained from a GY953 AHRS module. The external dimensions of the robot are: length - 76 cm; and width - 35 cm. The results are presented in Figure 19 and Table 18.

An experiment was conducted
In this system, the host computer is used to compute and send a steering order. At the beginning of the experiment, the environmental parameters – such as the size of the map, the number, shape and position of obstacles (an irregular obstacle consists of regular obstacles), the starting position and the target position – need to be put into the host computer. Moreover, the unit length of a grid is 0.8 times the width of the MR. After the optimization is completed, the host computer sends the position of the path points and the angle information to the MR via Wi-Fi.
In the dynamic environment, the environment is changed after the MR starts moving. The host computer first sends a stop command to the MR, at which the MR returns to its current position and angle value. The host computer calculates the position change of the obstacles, while the optimum results are obtained through the proposed genetic optimization algorithm. The new path results containing the position of path points and angles are sent to the MR.
In this experiment, a static environment and a dynamic environment are created in an indoor environment, in which the size of the map is 3×3m2. Six obstacles are represented in the static map; in the dynamic environment, however, another obstacle is added to the map after the MR starts moving.
Comparison of experiment results according to three different IGAs
According to Table 18, we can see that, in a static environment, the MR travels the same path, although the difference in time is huge by almost 12%. The time difference is mainly in regard to the optimization calculation and the dynamic path replanning stage.
In a dynamic environment, the length that MR moves and the time consumed are different from each other. The method in this paper obtains the shortest path and the lowest time consumption.
That said, the mechanical structure and energy consumption of the moving MR are not taken into account here. Future work will concentrate on path-smoothing with a B-spline function.
6. Conclusions
In this paper, a conventional GA was discussed and an IGA with a series of improvements was proposed, including a concept of visible space, a new encoding form and new mutation operators.
A feasible path can be obtained rapidly based on visible space. Following genetic operations, infeasible paths can be modified quickly and with a high degree of efficiency by using visible space. By using new mutation operators, the method may rapidly converge towards a global optimal solution with higher probability than other methods, not only in static environments but also in dynamic environments. An additional benefit is that a feasible path can be obtained and population diversity increased. This method is more efficient in dynamic environments because, when environment changes, only the path segments that intersect with obstacles need to be reoptimized. Compared with other algorithms, this method can reduce calculating complexity.
Footnotes
7. Acknowledgements
This work was supported in part by the Natural Science Foundation of China under Grant 61233005 and National 973 Project under Grant 2014CB744200. The author would like to thank the reviewers whose critical analysis and suggestions brought insight into the final editing of this paper.
