(3) Crossover Operator

For individuals in the population, cross operations are performed according to a certain crossover probability, and corresponding mutation operations are performed according to the probability of a certain mutation generating a next generation population. In this paper, the crossover operation uses a two-point crossover operator, and the mutation operation uses a single-point mutation operator. *Appl. Sci.* **2019**, *9*, x FOR PEER REVIEW 10 of 16 *Appl. Sci.* **2019**, *9*, x FOR PEER REVIEW 10 of 16

### (4) Eliminate operation uses a two-point crossover operator, and the mutation operation uses a single-point operation uses a two-point crossover operator, and the mutation operation uses a single-point

Because the genetic algorithm generates the randomness of the individual, the generated offspring may not satisfy the constraint. This paper sets a penalty function. When the mismatching of the offspring is higher, the degree of the penalty is larger, making the gene of the offspring difficult for the next generation to inherit, thus ensuring the innate superiority of the population. mutation operator. (4) Eliminate Because the genetic algorithm generates the randomness of the individual, the generated offspring may not satisfy the constraint. This paper sets a penalty function. When the mismatching of the offspring is higher, the degree of the penalty is larger, making the gene of the offspring difficult mutation operator. (4) Eliminate Because the genetic algorithm generates the randomness of the individual, the generated offspring may not satisfy the constraint. This paper sets a penalty function. When the mismatching of the offspring is higher, the degree of the penalty is larger, making the gene of the offspring difficult

### *5.2. Ant Colony Algorithm Solving* for the next generation to inherit, thus ensuring the innate superiority of the population. for the next generation to inherit, thus ensuring the innate superiority of the population.

### (1) Pheromone Initialization *5.2. Ant Colony Algorithm Solving 5.2. Ant Colony Algorithm Solving*

(2) Loop Iteration

(2) Loop Iteration

*t*:

*t*:

α

α

According to the location selection of the DGs, assuming that there are *N* installable DGs nodes, and the DGs capacity that may be installed on the node *i* is *n<sup>i</sup>* , then a similar matrix as shown in Figure 7 can be generated. (1) Pheromone Initialization According to the location selection of the DGs, assuming that there are *N* installable DGs nodes, and the DGs capacity that may be installed on the node *i* is *ni*, then a similar matrix as shown in Figure 7 can be generated. (1) Pheromone Initialization According to the location selection of the DGs, assuming that there are *N* installable DGs nodes, and the DGs capacity that may be installed on the node *i* is *ni*, then a similar matrix as shown in Figure 7 can be generated.


**Figure 7.** Ant colony algorithm search path diagram. **Figure 7.** Ant colony algorithm search path diagram. **Figure 7.** Ant colony algorithm search path diagram.

After *T* generation genetic optimization by genetic algorithm, *m* better solutions are obtained. Then the *m* preferred solutions are converted into the location and capacity of the ant colony algorithm, as shown in Figure 8. These location capacities are connected to form *m* paths, and update the pheromones on those paths. The number of ants is also set to *m*. *M* slaves are placed on *m* paths and the previous update pheromone are used as the initial value of the pheromone. After *T* generation genetic optimization by genetic algorithm, *m* better solutions are obtained. Then the *m* preferred solutions are converted into the location and capacity of the ant colony algorithm, as shown in Figure 8. These location capacities are connected to form *m* paths, and update the pheromones on those paths. The number of ants is also set to *m*. *M* slaves are placed on *m* paths and the previous update pheromone are used as the initial value of the pheromone. After *T* generation genetic optimization by genetic algorithm, *m* better solutions are obtained. Then the *m* preferred solutions are converted into the location and capacity of the ant colony algorithm, as shown in Figure 8. These location capacities are connected to form *m* paths, and update the pheromones on those paths. The number of ants is also set to *m*. *M* slaves are placed on *m* paths and the previous update pheromone are used as the initial value of the pheromone.

1 2 3 4 N-1

N

(26)

(26)

**Figure 8.** Genetic algorithm result conversion. **Figure 8.** Genetic algorithm result conversion. **Figure 8.** Genetic algorithm result conversion.

ant determines the transition probability based on the pheromone and path heuristic information on each path. *Pij*(*t*) represents the probability that ant *k* is transferred from position *i* to position *j* at time

pheromone on each path. The tabu table, *tabuk* is used to record the location capacity of the ants. The ant determines the transition probability based on the pheromone and path heuristic information on each path. *Pij*(*t*) represents the probability that ant *k* is transferred from position *i* to position *j* at time

[ ( )] [ ]

 η

 η

α β

*t p j allowed*

*t p j allowed*

*<sup>k</sup> is is ij k s allowed*

α β

[ ( )] [ ]

*<sup>k</sup> is is ij k s allowed*

[ ( )] [ ]

[ ( )] [ ]

*t*

*t*

τ

τ

τ

τ

∈

∈

 

 

 

  *ij ij*

*ij ij*

α β

α β

= ∈

= ∈

 η

 η

0 *k*

0 *k*

where *allowed C tabu k k* = − { } (*k*=1,2,3…,*m*) represents the position that the ant *k* next allows to select.

where *allowed C tabu k k* = − { } (*k*=1,2,3…,*m*) represents the position that the ant *k* next allows to select.

is a heuristic information factor, and represents the importance of the motion trajectory, that

is a heuristic information factor, and represents the importance of the motion trajectory, that
