**5. Model Solving**

In this paper, a GA-ACO algorithm is used to solve the model. The genetic algorithm mimics the generation and evolution process of all life intelligences. Using group search technology, through the genetic manipulation of selection, crossover and mutation of the current population, new groups are generated, and the population is gradually evolved to a state containing, or close to, the optimal solution. The ant colony algorithm searches for optimal solutions by simulating the processes that ant colonies use to search for food. Ants leave pheromones on the path they walk. The more ants that pass along the path, the more pheromones they leave, and the greater the probability that later ants will choose the path, thus forming a positive feedback mechanism, and finding the optimal solution.

The genetic algorithm has a large-scale and diverse initial population, so that global optimization is performed at the beginning of the algorithm, and the genetic algorithm is scalable and easy to combine with other algorithms. However, in the late stage of the genetic algorithm, the feedback information cannot be easily used, and a large number of redundant iterations are generated, which affects the convergence speed and accuracy of the algorithm. The ant colony algorithm has a fast convergence rate and good global convergence. In particular, when the pheromone is accumulated to a certain extent, the algorithm can quickly find the optimal solution. However, the disadvantage is

that the accumulation of pheromones is slow at first, and it is easy to fall into the local optimum at the beginning.

Based on the advantages and disadvantages of the above two algorithms, the two algorithms can be combined to make up for their respective shortcomings. In this paper, the genetic algorithm is used to generate the initial solution, then these initial solutions are transformed into the pheromone distribution in the ant colony algorithm. Finally, the positive feedback mechanism of the ant colony algorithm is used to search for the optimal solution. The GA-ACO algorithm solution flow chart is *Appl. Sci.*  shown in Figure **2019** 6. , *9*, x FOR PEER REVIEW 9 of 16

**Figure 6.** Algorithm flow chart. **Figure 6.** Algorithm flow chart.

## *5.1. Genetic Algorithm Solving 5.1. Genetic Algorithm Solving*

In this paper, we use binary coding. Each chromosome is regarded as a planning scheme. Each chromosome contains *N*DG elements. The first *N*MT elements represent the installed number of MT. The intermediate *N*pv elements represent the number of PV installations at each PV node to be selected; the last *N*wg elements represent the number of WG installed at each WG node to be selected. In this paper, we use binary coding. Each chromosome is regarded as a planning scheme. Each chromosome contains *N*DG elements. The first *N*MT elements represent the installed number of MT. The intermediate *N*pv elements represent the number of PV installations at each PV node to be selected; the last *N*wg elements represent the number of WG installed at each WG node to be selected.

### (1) Initial Population (1) Initial Population

(3) Crossover Operator

The initial population of the genetic algorithm is randomly generated. To solve this model, a certain chromosome in the initial population does not meet the constraints. Combined with the planning model, the initial population is required to fully satisfy the system capacity constraints. Therefore, it is necessary to carry out innate elimination, and the individuals who do not satisfy the constraints are eliminated and regenerated until the number of individuals satisfy the constraints and reach the requirements of the initial population. (2) Selection Operator The initial population of the genetic algorithm is randomly generated. To solve this model, a certain chromosome in the initial population does not meet the constraints. Combined with the planning model, the initial population is required to fully satisfy the system capacity constraints. Therefore, it is necessary to carry out innate elimination, and the individuals who do not satisfy the constraints are eliminated and regenerated until the number of individuals satisfy the constraints and reach the requirements of the initial population.

retained individual. That is, the more it satisfies the target condition, the easier it is to be inherited by the offspring, but other individuals have offspring with a small probability to prevent the algorithm

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

from falling into local optimum and guarantee global convergence.

According to the fitness value, the individuals in the population are selected to obtain the parent
