# Design of College Scheduling Algorithm Based on Improved Genetic Ant Colony Hybrid Optimization

Authors: Ting Li; Qiang Xie; Hua Zhang
Journal: Security and Communication Networks
 (2022)

---

## Abstract

With the gradual expansion of college scale, the professional categories in colleges and universities are becoming more and more complete, and the volume of courses is becoming more and more huge. In the meantime, the number of students is growing by leaps and bounds, and the teaching resources are subject to more and more complicated teaching tasks. The workload and the difficulty of scheduling in teaching management are also on the rise year by year. This paper proposes a design of a college scheduling algorithm based on an improved genetic ant colony hybrid optimization algorithm. Firstly, the fitness-enhanced elimination law is proposed to improve the selection process of traditional genetic algorithms. Subsequently, the gene infection crossover method is proposed to ensure the increase of the average fitness value in the evolutionary process. Next, the unnecessary replication operation in the traditional genetic algorithm is removed to enhance the operation speed of the algorithm. Finally, the parallel mechanism of fuzzy adaptive is introduced to improve the convergence and stability of the algorithm. For the ant colony optimization algorithm, a nonuniform pheromone distribution is used according to the position of the current raster relative to the starting point, which makes the initial pheromone concentration of the dominant raster higher and avoids blind search by ants. The ant movement rules are redefined by the directional neighborhood expansion strategy to further shorten the path. The experimental results indicate that the hybrid optimization algorithm outperforms other algorithms in terms of performance in terms of scheduling success and scheduling time, and it can be applied in practical scheduling because of the high quality of courses schedule.


---

## Body

## 1. Introduction

Education is a fundamental part of the sustainable development of the country and society, and it is also a long-term basic national policy of China to develop the country through science and education. Education is an important means to improve the education level of society and the quality of the nation, especially higher education. Hence, China’s colleges have been expanding their enrollment scale each year and continuously increasing the number of people receiving higher education [1, 2]. In the meantime, the level of scientific research and management is constantly improved and gradually transformed from quantitative change to qualitative change. The process of education and training of talents with high precision technology and skills is long and strict, and each link needs reasonable planning and arrangement. With the continuous refinement of college majors, colleges and universities are constantly developing and innovating in the talent training system. In terms of course categories and link settings, they all strive to cultivate personalized talents with both professional depth and professional span, which undoubtedly has new requirements and challenges for the scheduling work in colleges and universities [3–5]. In-depth research and discussion on the scheduling system of colleges and universities is the basic work of implementing the national talent cultivation strategy and plays a significant role in the teaching management of colleges and universities.Scheduling work is essentially the optimal use of various teaching resources in universities to ensure that basic teaching can be carried out in an orderly manner [6]. It is a proposition that needs to solve how to arrive at an optimal solution under multidimensional constraints. That is, various constraints such as time, space, and people need to be satisfied simultaneously in the system design to ensure that no conflicts arise between various constraints in the process of classroom teaching [7]. Avoiding various types of conflict problems such as the same batch of students needing to appear at different teaching sites at the same time or a particular classroom teacher being assigned different teaching tasks at the same time results in the classroom teaching work not being carried out properly [8, 9]. The more humane demands such as not too many hours of classes in a day for one teacher and not too many hours of classes in the same course for the same batch of students are also a challenge to the newer scheduling work. At present, the traditional manual scheduling method commonly used in domestic universities is mainly based on the previous scheduling experience. However, because the traditional manual scheduling method does not have complete systematic theoretical support, let alone data modeling by computer, it often has disadvantages in actual operation such as multiple involvement, large communication volume, slow speed, low efficiency, and error-prone and strong subjective consciousness. This approach is obviously no longer applicable to contemporary higher education institutions. For multiple departments and multiple course categories (basic courses, specialized courses, compulsory and elective courses, etc.), a large number of students need to complete various types of teaching schedule arrangements each semester. If the course arrangement is carried out manually, the workload is so large that it will definitely take a lot of effort and time of teaching administrators, and it is difficult to give a better schedule that is reasonable and feasible and can make full use of teaching resources [10, 11].Multidimensional information collection and high-speed data processing are realized and gradually popularized and applied currently. Before the scheduling process in colleges and universities, the courses are mathematically modeled, and constraints such as courses, instructors, teaching locations, and number of students are set, and computer algorithms are used to complete the solution in order to realize computer-aided decision-making automated scheduling. It not only solves the rationality and feasibility of course arrangement in space and time and improves the efficiency of scheduling work, but also enhances the level of informationalization of teaching management, which is of great importance.Algorithms for computer-aided decision scheduling systems are commonly used in domestic universities presently. These methods include graph coloring [12], which transforms the university course scheduling problem into a graph with vertices representing courses and edges representing constraints. The number of colors corresponds to feasible time slots. The graph coloring method assigns a finite number of colors to vertices, and no two adjacent vertices that are linked by an edge are of the same color. Genetic Algorithms (GA) and improved GA [13–15] assess course satisfaction with penalty function by genetically coding course scheduling constraints. Linear programming [16], simulated annealing (SA) algorithm [17], taboo search (TS) algorithm [18], etc., these algorithms are very popular now. The shortcoming of these algorithms is that they have difficulty in dealing with the constraints of the course scheduling process and can only produce feasible solutions with unsatisfactory results. There are also course scheduling methods on deep learning [19, 20], but the computational complexity of deep learning is high and takes longer time.Several studies have shown that hybrid algorithms show better results in solving college course scheduling problems. Integration of local search algorithm (LS) into particle swarm optimization algorithm (PSO) [21, 22] was used to construct the optimal solution for college course scheduling. Constraint propagation is integrated with genetic algorithm to obtain the approximate optimal solution for college course scheduling. The disadvantage of genetic algorithm is the long computational time. The particle swarm optimization algorithm converges faster than the genetic algorithm and does not require much parameter adjustment. PSO alone cannot solve the constraint satisfaction problem. The curriculum scheduling problem is a constraint satisfaction problem, so it is necessary to find a way to deal with the constraint conflicts in the control curriculum scheduling problem.This paper proposes an improved genetic ant colony based hybrid optimization algorithm for college scheduling. The algorithm gives constraints on the scheduling problem and applies the improved genetic ant colony hybrid optimization algorithm to solve the scheduling problem. The empirical verification demonstrates that the proposed algorithm achieves good results in practical scheduling problems.Section2 of this paper is the state of the art of the problem of scheduling. Section 3 is the methodology of proposed algorithm. Section 4 is the implementation of the scheduling algorithm. Section 5 is the result analysis and discussion, and Section 6 is the conclusion.


## 2. State of the Art

The core task is to arrange courses, classes, teachers, and classrooms without conflicts in each lecture period and to ensure that they meet the constraints set by teachers in advance. The introduction of the class system in universities has made the scheduling problem more complicated. The constraints of class scheduling are further increased, and the lack of teaching resources in schools is further highlighted.The scheduling problem is described as follows: the courses setSC=s1,s2,⋯,ss. The class set CC=c1,c2,⋯,cc. The set of teachers TC=n1,n2,⋯,nn. The classroom set RC=r1,r2,⋯,rr. The time period set PC=u1,u2,⋯,uu. Before scheduling a course, it is necessary to set up a schedule for different grades and classes and to determine the relationship between courses, classes, teachers, and classrooms.There are two types of constraints to consider when scheduling classes. The hard constraints are the conditions that must be followed in the scheduling process, and the schedule can only be arranged in accordance with the hard constraints to ensure that the scheduling resources do not conflict with each other, as follows:(1)
Only 1 course can be scheduled for the same class in the same teaching period:(1)∑w=1CC∑x=1PC∑y=1SCcwuxsyntrz≤1.Formula (1) indicates that in the same class cm in the same class period pi only 1 course can be scheduled at most sy, by the teacher nt in the classroom rz classroom.(2)
Only a maximum of one course can be scheduled in the same classroom during the same teaching period:(2)∑z=1RC∑x=1PC∑y=1SCcwuxsyntrz≤1.Formula (2) denotes the same classroom rz in the same lecture period ux only 1 course can be scheduled at most sy, by the teacher nt in the class cw class.(3)
A maximum of 1 course can be scheduled by the same instructor in the meantime, i.e.,(3)∑t=1TC∑x=1PC∑y=1SCcwuxsyntrz≤1.Formula (3) indicates that the same instructor nt in the same class period ux can only be assigned at most 1 course sy and in the classroom rz for the class cw classroom.Soft constraints are nonmandatory rules before scheduling a class. These rules are not necessary to be met, but they can have a significant impact on the rationality of the schedule and user satisfaction, as follows:①
The weekly class schedule of the same course is spread out as much as possible②
If a course is scheduled to have a priority, the course should be scheduled in the session that has the highest priority, such as the main course in the morning③
Teacher continuity setting is the maximum number of consecutive lessons that can be taught by one teacher④
Some courses are offered and others are not scheduled afterwards


## 3. Methodology

### 3.1. Enhanced Infection Genetic Algorithm

#### 3.1.1. Enhancement of the Law of Elimination

Conventional genetic algorithms have small differences in fitness values among individuals in the late evolutionary stage, and the selection process is weakly competitive, resulting in stagnant population evolution, low accuracy in finding superiority, and slow convergence. After obtaining the individual fitness value, the average fitness of the population is calculated and then the average fitness of the individual and the population is compared. This operation enables quickly eliminating more individuals with low fitness in the early stage of population evolution. The culling criterion varies with the number of generations. At later stages of evolution, this enhances competition among similar individuals and prevents the population from stagnating. The mathematical description of the fitness value enhanced elimination law is as follows.Let there ben individuals in a population, and the phenotype of the xth individual in the ath generation is x and the fitness value is faix. The mean fitness value of the ath generation is 1/t∑x=1tfaix. The recalculated fitness value of the xth individual is(4)ftix=faix−1t∑x=1tfaixz,faix>1t∑x=1tfaix,0,faix≤1t∑x=1tfaix,where z is the reinforcement competition coefficient. z directly affects the evolution speed and the accuracy of the algorithm for finding the best performance; in order to study the influence of z value on the value of individual fitness, the curves are plotted based on j=izi≥0 function based on z = 0.3, 0.2, 1, 2, 3, respectively.From the experimental results it is clear that the functiony is convex when 0<z≤1. And as the value of k decreases, the curve trend tends to flatten. When z>1, the function y is concave and the curve tends to steepen as the value of z increases. It can be seen that, for the enhanced elimination law, a smaller value of z decreases the difference in fitness values between individuals and retards population evolution. A larger value of z increases the difference in fitness values between individuals and accelerates population evolution. Therefore, the larger the z value, the greater the difference in fitness values among similar individuals at the later stage of population evolution, the more intense the competition, and the better the search accuracy.


#### 3.1.2. Genetic Infection Crossover Method

Conventional genetic algorithms use crossover and mutation for random search. When the chromosomes of two individuals are crossed over to produce new individuals, this approach is likely to produce offspring with lower fitness values when the fitness value of the parent individual is larger, thus reducing the average fitness of the population and deviating from the optimal solution. In contrast, gene infection crossover effectively prevents the reduction of fitness of new individuals by replacing most of the genes of the parent with those of individuals with low fitness. As shown in Figure1, the gene infection crossover method is described as follows:Step 1. The fitness values of individuals are recalculated using the augmented elimination law such that individuals with lower fitness are not selected when the selection operation is performed.Step 2. For each individual in the selected population, a parent is selected according to the principle of proportional selection, and the fitness of the individual is compared with the fitness of the parent. When the individual’s fitness is less than the parent’s fitness, a lower point in the parent’s chromosome is selected and the corresponding gene segment in the individual’s chromosome is replaced with the higher gene infection before this point. When the individual’s fitness is greater than the parent’s, no further crossover of gene infection is performed.Figure 1
Genetic infection cross-operation.In the linear problem, when the parent replaces most of the high genes with infected individual genes, the individual’s phenotype will rapidly approach the parent, preventing the generation of individuals with lower fitness values and thus preventing the reduction of the average fitness value of the population. Moreover, by retaining their own low genes, individuals retain a certain search ability and are able to search near the parent’s phenotype, increasing the probability of searching for the optimal solution. In contrast, in nonlinear problems, a search based solely on the parent’s phenotype can easily lead to a local optimal solution. Therefore, when performing gene crossover, the principle of proportional selection is applied to each individual to select the parent to ensure that the parental phenotypes can be adequately selected and compared. This ensures the speed of search, while preserving the diversity of parental expressions and preventing the emergence of local optimal solutions.


#### 3.1.3. Enhanced Infection Genetic Algorithm

Step 1: the algorithm first sets parameters such as crossover rate and variance rate and initializes the population. Initialize the population; i.e., based on the selected coding method, a coding set with completed individual coding is generated based on the selected population size as the initial value for the algorithm to run. The commonly used encoding methods are binary encoding and gray code encoding.Step 2: calculate the new fitness value. That is, the fitness value is calculated based on the original fitness function, and then the fitness value of individuals in the population is updated by the enhanced infection rule.Step 3: determine whether the conditions for stopping evolution are satisfied. When the conditions for stopping evolution are satisfied, exit the program and give the result; otherwise proceed to the next step. Commonly used control conditions of the algorithm are evolutionary algebra, planning error, etc.Step 4: perform gene infection crossover operation, and after that, perform mutation operation to move to step 2. Using the principle of proportional selection to crossover individuals of the population, the evolutionary speed is enhanced while ensuring the computational accuracy.Compared with the conventional genetic algorithm, the enhanced infection genetic algorithm is improved in two main aspects: first, after obtaining the fitness value of each individual, the fitness value is recalculated according to the enhanced elimination law. It enhances the competition of different genes, increases the elimination of individuals with small fitness values in the early evolutionary stage, and speeds up the convergence rate. It increases the competition of similar chromosomes in the late evolutionary stage and improves the convergence accuracy. Second, by improving the crossover method of gene infection, it ensures that the fitness value of offspring individuals is higher than that of their parents, avoiding the generation of individuals with lower fitness values and preventing the decrease of the average fitness value of the population.


### 3.2. Adaptive Parallelism Mechanism

The introduction of parallel mechanism in genetic algorithm can effectively combine the natural parallelism of GA and the fast concurrency of computer, which is an important direction to improve the performance of algorithm proposed in recent years. Currently, there are four basic types of parallel mechanism models for genetic algorithms: Master-slave model, fine-grained model, coarse-grained model, and hybrid model. The parallel mechanism proposed in this paper adopts a coarse-grained model.


#### 3.2.1. Evolutionary Strategies for Parallel Mechanisms

The existing genetic algorithm improvements can be summarized as coding, microgenetic strategy (improvement of genetic operator and parameter selection), and macrogenetic strategy (improvement of algorithm operation mechanism). In this paper, macroscopic multigroup parallelism mechanisms are studied rather than specific evolutionary strategies. Specifically, the larger value ofPm and the smaller value of Pc are called the exploration strategy, and the genetic operation is chosen to perform the mutation operation first and then the crossover operation, and finally the selection replication operation is performed. This evolutionary strategy facilitates the population to jump out of the local optimum and explore the new solution space. The smaller value of Pm and the larger value of Pc are called development strategy. This strategy first performs crossover operations, then mutation operations, and finally selective replication operations. This strategy can recombine existing genes to produce new individuals in anticipation of better trait changes. The normal strategy uses Pc and Pm, which are in between the developmental strategy and the exploration strategy, and uses the GA selection replication, crossover, and mutation operations in the evolutionary operation, and this strategy has the functions of both. In addition, the parallel mechanism of the evolutionary strategy of GA uses the public population as a container to continuously receive outstanding individuals passed from other populations and further develop them. First, the definition of evolutionary potential is given:Definition 1.
The evolutionary potential of individualxi exhibited by local search is defined by formula (5):(5)Vix=ω1−Zλf′ix−fmax,where ω denotes the weight of evolutionary potential. Z denotes the temperature decay coefficient. λ denotes the number of new solution searches. f′ix denotes the optimal solution of chromosome xi after local search. fmax denotes the population fitness maximum. The evolutionary potential of an individual is related to the number of searches for new solutions and the fitness of the optimal solution. The lower the number of searches, the higher the evolutionary potential.
The public population first performs crossover operations on the best individuals. After the crossover is finished all individuals are searched and evolutionary potential is calculated according to the local search strategy, and then the fitness is updated according to formula (6). Finally, the chromosomes with the population size number are selected according to the fitness into the next generation.(6)fix=fix+Vix.
The purpose of a public population is to enable the population to explore the solution space around individuals, to explore individuals with evolutionary potential, and to discover new solutions. Individuals with high evolutionary potential have a higher probability of being selected for the next generation. On the one hand, it can enrich the population diversity and maintain the search range of the population, and on the other hand, crossover with other good individuals can hopefully produce new and better individuals.


#### 3.2.2. Probability of Adaptive Determination Strategy Transformation

If the population evolution process is in stagnation or caught in the local optimal solution, the evolutionary strategy should be changed according to the population evolution. The evolutionary algebraAf, in which the optimal solution is maintained constant, is introduced to measure the evolutionary state of the population, and the probability of the population changing its strategy is calculated by the following formula:(7)Ucb=A−AnA−11+expβ2Af/Amax−1,where An is the current evolutionary generation. A is the total evolutionary generation. β is the control parameter with a value of 6 in the text. Af indicates the number of generations of population stagnation. Amax is the maximum number of generations of stagnation.The nonlinear probability can more reasonably control the population to change the evolutionary strategy.Ucb grows slowly in the early stage of evolutionary stagnation, allowing some time for the population to escape from stagnation by relying on the existing evolutionary strategy. As the number of generations of stagnation increases, the algorithm determines that the population is in stagnation. Compared with the probability of linear control, Ucb is significantly improved to avoid the population wasting time on the existing evolutionary strategy. Finally, to maintain a balance between population exploration and algorithm convergence rate, Ucb shows a linear decrease with further increase in evolutionary generations when the number of stagnation generations is constant.


#### 3.2.3. Evolutionary Strategy of Fuzzy Inference

This paper draws on the idea of fuzzy control and applies fuzzy inference to adjust the evolutionary strategy of the population according to the individual variability and evolutionary status of the population. Formula (8) is used to represent the evolutionary status of the population.(8)E1=fmax−favgfmax∈0,1.The size offmax−favg is often used to measure the degree of evolution of a population. The method is indeed valid. However, the shortcoming is that the fitness function is designed based on a specific problem and its value varies with the specific problem. Moreover, during the calculation of the algorithm, the maximum and minimum fitness of the population also change continuously, so it is difficult to determine the appropriate threshold to judge the evolutionary degree of the population. The smaller the value of E1, the closer the average fitness of the population to the optimal fitness of the population, which means that the population is more evolved. On the contrary, it means that the population is less evolved. Formula (9) indicates the variability of the population individuals.(9)E2=1T∑x=1Tfix−fminfmax−fmin∈0,1.The smaller the value ofE2, the more dispersed the population adaptation, the greater the population variation, and the better the diversity, and vice versa, the poorer the population diversity.In formulae (8) and (9), fix denotes the fitness of individual ix. fmax is the maximum value of population fitness. fmin is the minimum value of population fitness. favg is the average value of population fitness. T is the number of population chromosomes.Crossover arithmetic is used to obtain superior individuals by recombinant development of existing genes. If all individuals in the population do not have a certain gene, the missing gene cannot be obtained by crossover arithmetic in any way. If the population only generates new genes without further exploration, the good individuals in the population will be destroyed continuously, and convergence will be delayed. When the population is in a stagnant state, the population convergence is higher if the population is more concentrated in terms of adaptation. This will lead to more similarity between chromosomes and poor population diversity. In this case, it is necessary to replace the evolutionary strategy that can generate new genes to expand the population diversity. If the population fitness is more dispersed, the population convergence is low, the similarity between chromosomes is low, and the genes of chromosomes are more abundant in the population. At this time, the main focus should be on exploring the solution space of the current individual and the need to replace the evolutionary strategy that can exploit the existing genes.


### 3.3. Multistrategy Ant Colony Algorithm

#### 3.3.1. Initial Pheromone Nonuniform Distribution Strategy

In the solution process, one of the main bases for path selection by ants is the pheromone content of intergrid paths. In the original ant colony algorithm, the initial pheromone of each intergrid path is uniformly distributed and is a constant value. The value of the heuristic function of the ants will determine the magnitude of the state transfer probability, which is known by its calculation method. The difference in the heuristic function values of different grids is small, and without pheromone guidance, the blindness of the ant search is large, and the quality of the solution obtained from the search is low. Nonuniformization of the initial pheromone of the intergrid path is beneficial to accelerate the convergence speed of the algorithm. The heuristic function idea ofA∗ algorithm is used to differentially process the pheromones of different interraster paths. The corresponding pheromone concentrations are assigned according to their coordinates, and the calculation process is as follows:(10)τxy0=τ0+Δτxy,Δτxy=c1fx⋅1fy,fi=ε⋅ai+1−ε⋅bi,where τ0 is the original initial pheromone value. Δτxy is the additional pheromone added to the (x, y) path. c is a constant value, taken according to the empirical value and the raster scale. ε is the weighted value. ai is the spacing between the starting point and the current point. bi is the spacing between the current point and the end point.Based on the shortest distance between two points, the closer the ant’s path is to the starting and ending line, the better the path is. When the next grid to be selected is closer to the end point, the path is better. Therefore,ε should be taken as a small value so that the end point plays a dominant role. Besides, for the overall effect of the algorithm, if the gap between the nonuniform pheromone values is too large, it will cause the algorithm to converge too early and lead to local optimum problems, and if it is too small, the strategy will have limited effect. Therefore, the values of c and ε were experimentally compared several times, and the final values were determined as c = 2 × 4 × 4 = 32, ε = 0.1.


#### 3.3.2. Directional Neighborhood Expansion Strategy

In the original raster map-based algorithm, ants can only select the next path node in four or eight neighboring raster grids around them. The search direction is limited, and the optimal path length found due to the step length limitation is also long. The idea of this extended neighborhood is introduced, and the neighborhood is extended directionally according to the relative positions of the starting and ending points of the map, as shown in Figure2.Figure 2
Feasible raster after directional neighborhood expansion.The solid line represents the feasible raster of the original ant colony algorithm. The dashed line represents the feasible grid added after the directed neighborhood expansion. Using the directed neighborhood expansion strategy not only enriches the search direction of ants and achieves the purpose of finding shorter paths through one search, but also reduces the computational effort of the algorithm and speeds up the operation of the algorithm. Due to the increase of the searchable grid range of ants in the improved algorithm, the search method of ants is reset. In the eight surrounding grids of the current grid, ants may not select an obstacle grid (hard constraint) as the next move path node in the extended neighborhood grid.


### 3.4. Genetic Ant Colony Hybrid Optimization Algorithm Process

The improved genetic ant colony algorithm flow is given in Figure3. By using the ant colony algorithm, a better set of solutions is generated after one iteration, which is used as the initial population of the genetic algorithm. This is an effective way to reduce the number of times the genetic algorithm seeks to find the optimal course scheduling result quickly.Figure 3
Improved genetic ant colony algorithm flow.Figure 4
Example diagram of gene structure.


## 3.1. Enhanced Infection Genetic Algorithm

### 3.1.1. Enhancement of the Law of Elimination

Conventional genetic algorithms have small differences in fitness values among individuals in the late evolutionary stage, and the selection process is weakly competitive, resulting in stagnant population evolution, low accuracy in finding superiority, and slow convergence. After obtaining the individual fitness value, the average fitness of the population is calculated and then the average fitness of the individual and the population is compared. This operation enables quickly eliminating more individuals with low fitness in the early stage of population evolution. The culling criterion varies with the number of generations. At later stages of evolution, this enhances competition among similar individuals and prevents the population from stagnating. The mathematical description of the fitness value enhanced elimination law is as follows.Let there ben individuals in a population, and the phenotype of the xth individual in the ath generation is x and the fitness value is faix. The mean fitness value of the ath generation is 1/t∑x=1tfaix. The recalculated fitness value of the xth individual is(4)ftix=faix−1t∑x=1tfaixz,faix>1t∑x=1tfaix,0,faix≤1t∑x=1tfaix,where z is the reinforcement competition coefficient. z directly affects the evolution speed and the accuracy of the algorithm for finding the best performance; in order to study the influence of z value on the value of individual fitness, the curves are plotted based on j=izi≥0 function based on z = 0.3, 0.2, 1, 2, 3, respectively.From the experimental results it is clear that the functiony is convex when 0<z≤1. And as the value of k decreases, the curve trend tends to flatten. When z>1, the function y is concave and the curve tends to steepen as the value of z increases. It can be seen that, for the enhanced elimination law, a smaller value of z decreases the difference in fitness values between individuals and retards population evolution. A larger value of z increases the difference in fitness values between individuals and accelerates population evolution. Therefore, the larger the z value, the greater the difference in fitness values among similar individuals at the later stage of population evolution, the more intense the competition, and the better the search accuracy.


### 3.1.2. Genetic Infection Crossover Method

Conventional genetic algorithms use crossover and mutation for random search. When the chromosomes of two individuals are crossed over to produce new individuals, this approach is likely to produce offspring with lower fitness values when the fitness value of the parent individual is larger, thus reducing the average fitness of the population and deviating from the optimal solution. In contrast, gene infection crossover effectively prevents the reduction of fitness of new individuals by replacing most of the genes of the parent with those of individuals with low fitness. As shown in Figure1, the gene infection crossover method is described as follows:Step 1. The fitness values of individuals are recalculated using the augmented elimination law such that individuals with lower fitness are not selected when the selection operation is performed.Step 2. For each individual in the selected population, a parent is selected according to the principle of proportional selection, and the fitness of the individual is compared with the fitness of the parent. When the individual’s fitness is less than the parent’s fitness, a lower point in the parent’s chromosome is selected and the corresponding gene segment in the individual’s chromosome is replaced with the higher gene infection before this point. When the individual’s fitness is greater than the parent’s, no further crossover of gene infection is performed.Figure 1
Genetic infection cross-operation.In the linear problem, when the parent replaces most of the high genes with infected individual genes, the individual’s phenotype will rapidly approach the parent, preventing the generation of individuals with lower fitness values and thus preventing the reduction of the average fitness value of the population. Moreover, by retaining their own low genes, individuals retain a certain search ability and are able to search near the parent’s phenotype, increasing the probability of searching for the optimal solution. In contrast, in nonlinear problems, a search based solely on the parent’s phenotype can easily lead to a local optimal solution. Therefore, when performing gene crossover, the principle of proportional selection is applied to each individual to select the parent to ensure that the parental phenotypes can be adequately selected and compared. This ensures the speed of search, while preserving the diversity of parental expressions and preventing the emergence of local optimal solutions.


### 3.1.3. Enhanced Infection Genetic Algorithm

Step 1: the algorithm first sets parameters such as crossover rate and variance rate and initializes the population. Initialize the population; i.e., based on the selected coding method, a coding set with completed individual coding is generated based on the selected population size as the initial value for the algorithm to run. The commonly used encoding methods are binary encoding and gray code encoding.Step 2: calculate the new fitness value. That is, the fitness value is calculated based on the original fitness function, and then the fitness value of individuals in the population is updated by the enhanced infection rule.Step 3: determine whether the conditions for stopping evolution are satisfied. When the conditions for stopping evolution are satisfied, exit the program and give the result; otherwise proceed to the next step. Commonly used control conditions of the algorithm are evolutionary algebra, planning error, etc.Step 4: perform gene infection crossover operation, and after that, perform mutation operation to move to step 2. Using the principle of proportional selection to crossover individuals of the population, the evolutionary speed is enhanced while ensuring the computational accuracy.Compared with the conventional genetic algorithm, the enhanced infection genetic algorithm is improved in two main aspects: first, after obtaining the fitness value of each individual, the fitness value is recalculated according to the enhanced elimination law. It enhances the competition of different genes, increases the elimination of individuals with small fitness values in the early evolutionary stage, and speeds up the convergence rate. It increases the competition of similar chromosomes in the late evolutionary stage and improves the convergence accuracy. Second, by improving the crossover method of gene infection, it ensures that the fitness value of offspring individuals is higher than that of their parents, avoiding the generation of individuals with lower fitness values and preventing the decrease of the average fitness value of the population.


## 3.1.1. Enhancement of the Law of Elimination

Conventional genetic algorithms have small differences in fitness values among individuals in the late evolutionary stage, and the selection process is weakly competitive, resulting in stagnant population evolution, low accuracy in finding superiority, and slow convergence. After obtaining the individual fitness value, the average fitness of the population is calculated and then the average fitness of the individual and the population is compared. This operation enables quickly eliminating more individuals with low fitness in the early stage of population evolution. The culling criterion varies with the number of generations. At later stages of evolution, this enhances competition among similar individuals and prevents the population from stagnating. The mathematical description of the fitness value enhanced elimination law is as follows.Let there ben individuals in a population, and the phenotype of the xth individual in the ath generation is x and the fitness value is faix. The mean fitness value of the ath generation is 1/t∑x=1tfaix. The recalculated fitness value of the xth individual is(4)ftix=faix−1t∑x=1tfaixz,faix>1t∑x=1tfaix,0,faix≤1t∑x=1tfaix,where z is the reinforcement competition coefficient. z directly affects the evolution speed and the accuracy of the algorithm for finding the best performance; in order to study the influence of z value on the value of individual fitness, the curves are plotted based on j=izi≥0 function based on z = 0.3, 0.2, 1, 2, 3, respectively.From the experimental results it is clear that the functiony is convex when 0<z≤1. And as the value of k decreases, the curve trend tends to flatten. When z>1, the function y is concave and the curve tends to steepen as the value of z increases. It can be seen that, for the enhanced elimination law, a smaller value of z decreases the difference in fitness values between individuals and retards population evolution. A larger value of z increases the difference in fitness values between individuals and accelerates population evolution. Therefore, the larger the z value, the greater the difference in fitness values among similar individuals at the later stage of population evolution, the more intense the competition, and the better the search accuracy.


## 3.1.2. Genetic Infection Crossover Method

Conventional genetic algorithms use crossover and mutation for random search. When the chromosomes of two individuals are crossed over to produce new individuals, this approach is likely to produce offspring with lower fitness values when the fitness value of the parent individual is larger, thus reducing the average fitness of the population and deviating from the optimal solution. In contrast, gene infection crossover effectively prevents the reduction of fitness of new individuals by replacing most of the genes of the parent with those of individuals with low fitness. As shown in Figure1, the gene infection crossover method is described as follows:Step 1. The fitness values of individuals are recalculated using the augmented elimination law such that individuals with lower fitness are not selected when the selection operation is performed.Step 2. For each individual in the selected population, a parent is selected according to the principle of proportional selection, and the fitness of the individual is compared with the fitness of the parent. When the individual’s fitness is less than the parent’s fitness, a lower point in the parent’s chromosome is selected and the corresponding gene segment in the individual’s chromosome is replaced with the higher gene infection before this point. When the individual’s fitness is greater than the parent’s, no further crossover of gene infection is performed.Figure 1
Genetic infection cross-operation.In the linear problem, when the parent replaces most of the high genes with infected individual genes, the individual’s phenotype will rapidly approach the parent, preventing the generation of individuals with lower fitness values and thus preventing the reduction of the average fitness value of the population. Moreover, by retaining their own low genes, individuals retain a certain search ability and are able to search near the parent’s phenotype, increasing the probability of searching for the optimal solution. In contrast, in nonlinear problems, a search based solely on the parent’s phenotype can easily lead to a local optimal solution. Therefore, when performing gene crossover, the principle of proportional selection is applied to each individual to select the parent to ensure that the parental phenotypes can be adequately selected and compared. This ensures the speed of search, while preserving the diversity of parental expressions and preventing the emergence of local optimal solutions.


## 3.1.3. Enhanced Infection Genetic Algorithm

Step 1: the algorithm first sets parameters such as crossover rate and variance rate and initializes the population. Initialize the population; i.e., based on the selected coding method, a coding set with completed individual coding is generated based on the selected population size as the initial value for the algorithm to run. The commonly used encoding methods are binary encoding and gray code encoding.Step 2: calculate the new fitness value. That is, the fitness value is calculated based on the original fitness function, and then the fitness value of individuals in the population is updated by the enhanced infection rule.Step 3: determine whether the conditions for stopping evolution are satisfied. When the conditions for stopping evolution are satisfied, exit the program and give the result; otherwise proceed to the next step. Commonly used control conditions of the algorithm are evolutionary algebra, planning error, etc.Step 4: perform gene infection crossover operation, and after that, perform mutation operation to move to step 2. Using the principle of proportional selection to crossover individuals of the population, the evolutionary speed is enhanced while ensuring the computational accuracy.Compared with the conventional genetic algorithm, the enhanced infection genetic algorithm is improved in two main aspects: first, after obtaining the fitness value of each individual, the fitness value is recalculated according to the enhanced elimination law. It enhances the competition of different genes, increases the elimination of individuals with small fitness values in the early evolutionary stage, and speeds up the convergence rate. It increases the competition of similar chromosomes in the late evolutionary stage and improves the convergence accuracy. Second, by improving the crossover method of gene infection, it ensures that the fitness value of offspring individuals is higher than that of their parents, avoiding the generation of individuals with lower fitness values and preventing the decrease of the average fitness value of the population.


## 3.2. Adaptive Parallelism Mechanism

The introduction of parallel mechanism in genetic algorithm can effectively combine the natural parallelism of GA and the fast concurrency of computer, which is an important direction to improve the performance of algorithm proposed in recent years. Currently, there are four basic types of parallel mechanism models for genetic algorithms: Master-slave model, fine-grained model, coarse-grained model, and hybrid model. The parallel mechanism proposed in this paper adopts a coarse-grained model.


### 3.2.1. Evolutionary Strategies for Parallel Mechanisms

The existing genetic algorithm improvements can be summarized as coding, microgenetic strategy (improvement of genetic operator and parameter selection), and macrogenetic strategy (improvement of algorithm operation mechanism). In this paper, macroscopic multigroup parallelism mechanisms are studied rather than specific evolutionary strategies. Specifically, the larger value ofPm and the smaller value of Pc are called the exploration strategy, and the genetic operation is chosen to perform the mutation operation first and then the crossover operation, and finally the selection replication operation is performed. This evolutionary strategy facilitates the population to jump out of the local optimum and explore the new solution space. The smaller value of Pm and the larger value of Pc are called development strategy. This strategy first performs crossover operations, then mutation operations, and finally selective replication operations. This strategy can recombine existing genes to produce new individuals in anticipation of better trait changes. The normal strategy uses Pc and Pm, which are in between the developmental strategy and the exploration strategy, and uses the GA selection replication, crossover, and mutation operations in the evolutionary operation, and this strategy has the functions of both. In addition, the parallel mechanism of the evolutionary strategy of GA uses the public population as a container to continuously receive outstanding individuals passed from other populations and further develop them. First, the definition of evolutionary potential is given:Definition 1.
The evolutionary potential of individualxi exhibited by local search is defined by formula (5):(5)Vix=ω1−Zλf′ix−fmax,where ω denotes the weight of evolutionary potential. Z denotes the temperature decay coefficient. λ denotes the number of new solution searches. f′ix denotes the optimal solution of chromosome xi after local search. fmax denotes the population fitness maximum. The evolutionary potential of an individual is related to the number of searches for new solutions and the fitness of the optimal solution. The lower the number of searches, the higher the evolutionary potential.
The public population first performs crossover operations on the best individuals. After the crossover is finished all individuals are searched and evolutionary potential is calculated according to the local search strategy, and then the fitness is updated according to formula (6). Finally, the chromosomes with the population size number are selected according to the fitness into the next generation.(6)fix=fix+Vix.
The purpose of a public population is to enable the population to explore the solution space around individuals, to explore individuals with evolutionary potential, and to discover new solutions. Individuals with high evolutionary potential have a higher probability of being selected for the next generation. On the one hand, it can enrich the population diversity and maintain the search range of the population, and on the other hand, crossover with other good individuals can hopefully produce new and better individuals.


### 3.2.2. Probability of Adaptive Determination Strategy Transformation

If the population evolution process is in stagnation or caught in the local optimal solution, the evolutionary strategy should be changed according to the population evolution. The evolutionary algebraAf, in which the optimal solution is maintained constant, is introduced to measure the evolutionary state of the population, and the probability of the population changing its strategy is calculated by the following formula:(7)Ucb=A−AnA−11+expβ2Af/Amax−1,where An is the current evolutionary generation. A is the total evolutionary generation. β is the control parameter with a value of 6 in the text. Af indicates the number of generations of population stagnation. Amax is the maximum number of generations of stagnation.The nonlinear probability can more reasonably control the population to change the evolutionary strategy.Ucb grows slowly in the early stage of evolutionary stagnation, allowing some time for the population to escape from stagnation by relying on the existing evolutionary strategy. As the number of generations of stagnation increases, the algorithm determines that the population is in stagnation. Compared with the probability of linear control, Ucb is significantly improved to avoid the population wasting time on the existing evolutionary strategy. Finally, to maintain a balance between population exploration and algorithm convergence rate, Ucb shows a linear decrease with further increase in evolutionary generations when the number of stagnation generations is constant.


### 3.2.3. Evolutionary Strategy of Fuzzy Inference

This paper draws on the idea of fuzzy control and applies fuzzy inference to adjust the evolutionary strategy of the population according to the individual variability and evolutionary status of the population. Formula (8) is used to represent the evolutionary status of the population.(8)E1=fmax−favgfmax∈0,1.The size offmax−favg is often used to measure the degree of evolution of a population. The method is indeed valid. However, the shortcoming is that the fitness function is designed based on a specific problem and its value varies with the specific problem. Moreover, during the calculation of the algorithm, the maximum and minimum fitness of the population also change continuously, so it is difficult to determine the appropriate threshold to judge the evolutionary degree of the population. The smaller the value of E1, the closer the average fitness of the population to the optimal fitness of the population, which means that the population is more evolved. On the contrary, it means that the population is less evolved. Formula (9) indicates the variability of the population individuals.(9)E2=1T∑x=1Tfix−fminfmax−fmin∈0,1.The smaller the value ofE2, the more dispersed the population adaptation, the greater the population variation, and the better the diversity, and vice versa, the poorer the population diversity.In formulae (8) and (9), fix denotes the fitness of individual ix. fmax is the maximum value of population fitness. fmin is the minimum value of population fitness. favg is the average value of population fitness. T is the number of population chromosomes.Crossover arithmetic is used to obtain superior individuals by recombinant development of existing genes. If all individuals in the population do not have a certain gene, the missing gene cannot be obtained by crossover arithmetic in any way. If the population only generates new genes without further exploration, the good individuals in the population will be destroyed continuously, and convergence will be delayed. When the population is in a stagnant state, the population convergence is higher if the population is more concentrated in terms of adaptation. This will lead to more similarity between chromosomes and poor population diversity. In this case, it is necessary to replace the evolutionary strategy that can generate new genes to expand the population diversity. If the population fitness is more dispersed, the population convergence is low, the similarity between chromosomes is low, and the genes of chromosomes are more abundant in the population. At this time, the main focus should be on exploring the solution space of the current individual and the need to replace the evolutionary strategy that can exploit the existing genes.


## 3.2.1. Evolutionary Strategies for Parallel Mechanisms

The existing genetic algorithm improvements can be summarized as coding, microgenetic strategy (improvement of genetic operator and parameter selection), and macrogenetic strategy (improvement of algorithm operation mechanism). In this paper, macroscopic multigroup parallelism mechanisms are studied rather than specific evolutionary strategies. Specifically, the larger value ofPm and the smaller value of Pc are called the exploration strategy, and the genetic operation is chosen to perform the mutation operation first and then the crossover operation, and finally the selection replication operation is performed. This evolutionary strategy facilitates the population to jump out of the local optimum and explore the new solution space. The smaller value of Pm and the larger value of Pc are called development strategy. This strategy first performs crossover operations, then mutation operations, and finally selective replication operations. This strategy can recombine existing genes to produce new individuals in anticipation of better trait changes. The normal strategy uses Pc and Pm, which are in between the developmental strategy and the exploration strategy, and uses the GA selection replication, crossover, and mutation operations in the evolutionary operation, and this strategy has the functions of both. In addition, the parallel mechanism of the evolutionary strategy of GA uses the public population as a container to continuously receive outstanding individuals passed from other populations and further develop them. First, the definition of evolutionary potential is given:Definition 1.
The evolutionary potential of individualxi exhibited by local search is defined by formula (5):(5)Vix=ω1−Zλf′ix−fmax,where ω denotes the weight of evolutionary potential. Z denotes the temperature decay coefficient. λ denotes the number of new solution searches. f′ix denotes the optimal solution of chromosome xi after local search. fmax denotes the population fitness maximum. The evolutionary potential of an individual is related to the number of searches for new solutions and the fitness of the optimal solution. The lower the number of searches, the higher the evolutionary potential.
The public population first performs crossover operations on the best individuals. After the crossover is finished all individuals are searched and evolutionary potential is calculated according to the local search strategy, and then the fitness is updated according to formula (6). Finally, the chromosomes with the population size number are selected according to the fitness into the next generation.(6)fix=fix+Vix.
The purpose of a public population is to enable the population to explore the solution space around individuals, to explore individuals with evolutionary potential, and to discover new solutions. Individuals with high evolutionary potential have a higher probability of being selected for the next generation. On the one hand, it can enrich the population diversity and maintain the search range of the population, and on the other hand, crossover with other good individuals can hopefully produce new and better individuals.


## 3.2.2. Probability of Adaptive Determination Strategy Transformation

If the population evolution process is in stagnation or caught in the local optimal solution, the evolutionary strategy should be changed according to the population evolution. The evolutionary algebraAf, in which the optimal solution is maintained constant, is introduced to measure the evolutionary state of the population, and the probability of the population changing its strategy is calculated by the following formula:(7)Ucb=A−AnA−11+expβ2Af/Amax−1,where An is the current evolutionary generation. A is the total evolutionary generation. β is the control parameter with a value of 6 in the text. Af indicates the number of generations of population stagnation. Amax is the maximum number of generations of stagnation.The nonlinear probability can more reasonably control the population to change the evolutionary strategy.Ucb grows slowly in the early stage of evolutionary stagnation, allowing some time for the population to escape from stagnation by relying on the existing evolutionary strategy. As the number of generations of stagnation increases, the algorithm determines that the population is in stagnation. Compared with the probability of linear control, Ucb is significantly improved to avoid the population wasting time on the existing evolutionary strategy. Finally, to maintain a balance between population exploration and algorithm convergence rate, Ucb shows a linear decrease with further increase in evolutionary generations when the number of stagnation generations is constant.


## 3.2.3. Evolutionary Strategy of Fuzzy Inference

This paper draws on the idea of fuzzy control and applies fuzzy inference to adjust the evolutionary strategy of the population according to the individual variability and evolutionary status of the population. Formula (8) is used to represent the evolutionary status of the population.(8)E1=fmax−favgfmax∈0,1.The size offmax−favg is often used to measure the degree of evolution of a population. The method is indeed valid. However, the shortcoming is that the fitness function is designed based on a specific problem and its value varies with the specific problem. Moreover, during the calculation of the algorithm, the maximum and minimum fitness of the population also change continuously, so it is difficult to determine the appropriate threshold to judge the evolutionary degree of the population. The smaller the value of E1, the closer the average fitness of the population to the optimal fitness of the population, which means that the population is more evolved. On the contrary, it means that the population is less evolved. Formula (9) indicates the variability of the population individuals.(9)E2=1T∑x=1Tfix−fminfmax−fmin∈0,1.The smaller the value ofE2, the more dispersed the population adaptation, the greater the population variation, and the better the diversity, and vice versa, the poorer the population diversity.In formulae (8) and (9), fix denotes the fitness of individual ix. fmax is the maximum value of population fitness. fmin is the minimum value of population fitness. favg is the average value of population fitness. T is the number of population chromosomes.Crossover arithmetic is used to obtain superior individuals by recombinant development of existing genes. If all individuals in the population do not have a certain gene, the missing gene cannot be obtained by crossover arithmetic in any way. If the population only generates new genes without further exploration, the good individuals in the population will be destroyed continuously, and convergence will be delayed. When the population is in a stagnant state, the population convergence is higher if the population is more concentrated in terms of adaptation. This will lead to more similarity between chromosomes and poor population diversity. In this case, it is necessary to replace the evolutionary strategy that can generate new genes to expand the population diversity. If the population fitness is more dispersed, the population convergence is low, the similarity between chromosomes is low, and the genes of chromosomes are more abundant in the population. At this time, the main focus should be on exploring the solution space of the current individual and the need to replace the evolutionary strategy that can exploit the existing genes.


## 3.3. Multistrategy Ant Colony Algorithm

### 3.3.1. Initial Pheromone Nonuniform Distribution Strategy

In the solution process, one of the main bases for path selection by ants is the pheromone content of intergrid paths. In the original ant colony algorithm, the initial pheromone of each intergrid path is uniformly distributed and is a constant value. The value of the heuristic function of the ants will determine the magnitude of the state transfer probability, which is known by its calculation method. The difference in the heuristic function values of different grids is small, and without pheromone guidance, the blindness of the ant search is large, and the quality of the solution obtained from the search is low. Nonuniformization of the initial pheromone of the intergrid path is beneficial to accelerate the convergence speed of the algorithm. The heuristic function idea ofA∗ algorithm is used to differentially process the pheromones of different interraster paths. The corresponding pheromone concentrations are assigned according to their coordinates, and the calculation process is as follows:(10)τxy0=τ0+Δτxy,Δτxy=c1fx⋅1fy,fi=ε⋅ai+1−ε⋅bi,where τ0 is the original initial pheromone value. Δτxy is the additional pheromone added to the (x, y) path. c is a constant value, taken according to the empirical value and the raster scale. ε is the weighted value. ai is the spacing between the starting point and the current point. bi is the spacing between the current point and the end point.Based on the shortest distance between two points, the closer the ant’s path is to the starting and ending line, the better the path is. When the next grid to be selected is closer to the end point, the path is better. Therefore,ε should be taken as a small value so that the end point plays a dominant role. Besides, for the overall effect of the algorithm, if the gap between the nonuniform pheromone values is too large, it will cause the algorithm to converge too early and lead to local optimum problems, and if it is too small, the strategy will have limited effect. Therefore, the values of c and ε were experimentally compared several times, and the final values were determined as c = 2 × 4 × 4 = 32, ε = 0.1.


### 3.3.2. Directional Neighborhood Expansion Strategy

In the original raster map-based algorithm, ants can only select the next path node in four or eight neighboring raster grids around them. The search direction is limited, and the optimal path length found due to the step length limitation is also long. The idea of this extended neighborhood is introduced, and the neighborhood is extended directionally according to the relative positions of the starting and ending points of the map, as shown in Figure2.Figure 2
Feasible raster after directional neighborhood expansion.The solid line represents the feasible raster of the original ant colony algorithm. The dashed line represents the feasible grid added after the directed neighborhood expansion. Using the directed neighborhood expansion strategy not only enriches the search direction of ants and achieves the purpose of finding shorter paths through one search, but also reduces the computational effort of the algorithm and speeds up the operation of the algorithm. Due to the increase of the searchable grid range of ants in the improved algorithm, the search method of ants is reset. In the eight surrounding grids of the current grid, ants may not select an obstacle grid (hard constraint) as the next move path node in the extended neighborhood grid.


## 3.3.1. Initial Pheromone Nonuniform Distribution Strategy

In the solution process, one of the main bases for path selection by ants is the pheromone content of intergrid paths. In the original ant colony algorithm, the initial pheromone of each intergrid path is uniformly distributed and is a constant value. The value of the heuristic function of the ants will determine the magnitude of the state transfer probability, which is known by its calculation method. The difference in the heuristic function values of different grids is small, and without pheromone guidance, the blindness of the ant search is large, and the quality of the solution obtained from the search is low. Nonuniformization of the initial pheromone of the intergrid path is beneficial to accelerate the convergence speed of the algorithm. The heuristic function idea ofA∗ algorithm is used to differentially process the pheromones of different interraster paths. The corresponding pheromone concentrations are assigned according to their coordinates, and the calculation process is as follows:(10)τxy0=τ0+Δτxy,Δτxy=c1fx⋅1fy,fi=ε⋅ai+1−ε⋅bi,where τ0 is the original initial pheromone value. Δτxy is the additional pheromone added to the (x, y) path. c is a constant value, taken according to the empirical value and the raster scale. ε is the weighted value. ai is the spacing between the starting point and the current point. bi is the spacing between the current point and the end point.Based on the shortest distance between two points, the closer the ant’s path is to the starting and ending line, the better the path is. When the next grid to be selected is closer to the end point, the path is better. Therefore,ε should be taken as a small value so that the end point plays a dominant role. Besides, for the overall effect of the algorithm, if the gap between the nonuniform pheromone values is too large, it will cause the algorithm to converge too early and lead to local optimum problems, and if it is too small, the strategy will have limited effect. Therefore, the values of c and ε were experimentally compared several times, and the final values were determined as c = 2 × 4 × 4 = 32, ε = 0.1.


## 3.3.2. Directional Neighborhood Expansion Strategy

In the original raster map-based algorithm, ants can only select the next path node in four or eight neighboring raster grids around them. The search direction is limited, and the optimal path length found due to the step length limitation is also long. The idea of this extended neighborhood is introduced, and the neighborhood is extended directionally according to the relative positions of the starting and ending points of the map, as shown in Figure2.Figure 2
Feasible raster after directional neighborhood expansion.The solid line represents the feasible raster of the original ant colony algorithm. The dashed line represents the feasible grid added after the directed neighborhood expansion. Using the directed neighborhood expansion strategy not only enriches the search direction of ants and achieves the purpose of finding shorter paths through one search, but also reduces the computational effort of the algorithm and speeds up the operation of the algorithm. Due to the increase of the searchable grid range of ants in the improved algorithm, the search method of ants is reset. In the eight surrounding grids of the current grid, ants may not select an obstacle grid (hard constraint) as the next move path node in the extended neighborhood grid.


## 3.4. Genetic Ant Colony Hybrid Optimization Algorithm Process

The improved genetic ant colony algorithm flow is given in Figure3. By using the ant colony algorithm, a better set of solutions is generated after one iteration, which is used as the initial population of the genetic algorithm. This is an effective way to reduce the number of times the genetic algorithm seeks to find the optimal course scheduling result quickly.Figure 3
Improved genetic ant colony algorithm flow.Figure 4
Example diagram of gene structure.


## 4. Course Scheduling Implementation

### 4.1. Gene Coding and Chromosome Construction

(1)
The teacher number, course number, class number, classroom number, and class period form a tuple, which is the gene of the genetic algorithm. Each gene can be regarded as a classroom unit in the class schedule, and the gene structure is shown in Figure4. For example, in gene code 1001_2001_3001_4001_0-1-0, it means that teacher 1001 is teaching class 3001 in classroom 4001 during lesson period 0-1-0. The course number is 2001. ux=day,division,section. The day indicates the day of the week; division indicates the hour (AM, PM); section indicates the class period.In practice, the instructor needs to set up the schedule for each semester before scheduling; i.e., the relationship between courses, classes, teachers, and classrooms is determined.(2)
Construction of chromosomes on the basis of gene coding. The class schedule units (genes) of all classes form 1 chromosome (individual). The CourseInfo object represents the course information of each course in the schedule, including the course, class, instructor, classroom, campus, and weekly class hours. Each CourseInfo corresponds to one or more genes. This is determined by the number of weekly sessions under the CourseInfo. Each individual has the same number of genes.


### 4.2. Adaptation Function

In this paper, the fitness function is considered in terms of the priority and uniformity of the course sessions, and punishment degree is added to reduce the violation of constraints.In summary, the fitness function in this paper is given by(11)f=ω1⋅f1+ω2⋅f2⋅β,where ω1 and ω2 are the weights, and ω1 + ω2 = 1. β=α1hard_vios⋅α2soft_vios is punishment degree. α1 and α2 are the penalty factor, α1<1, α2<1, and α1<α2.


### 4.3. Design of Crossover and Mutation Operations in Scheduling System

The crossover strategy in this paper is as follows: individuals Individual_1 and Individual_2 are selected by the roulette algorithm based on individual adaptation. 1 grade is randomly selected, and the set of gene objects is collated. Exchange the gene objects of the classes involved in these 2 individuals.The idea of gene editing is introduced in the mutation operation in this paper.Step 1: 1 class is randomly selected and all gene objects related to the class are obtained from the individuals to be mutated.Step 2: determine whether the set of gene objects has conflicts. If the constraint is violated, step 3 is executed; otherwise step 5 is executed directly.Step 3: identify if the course schedule has a conflict (2 or more courses are scheduled for the same class period). If there is, only 1 class is reserved for that period, and the rest of the classes are scheduled for the free period. That is, select (i − 1) gene objects from the i conflicting gene objects and set their arrangeTime property value to the unscheduled free period, ignoring whether it will cause other conflicts. If there is no class conflict, then step 4 is executed; otherwise, the current mutation operation is exited.Step 4: identify if the teachers and classrooms schedule has a conflict. If yes, swap the conflicting course schedule with another schedule. After step 4, save the mutated individuals and exit the mutation operation.Step 5
: randomly select 2 courses and swap them.The overall flowchart of each mutation operation is shown in Figure5, where Mutation_rate is the mutation probability and Modi_rate is the genetic modification probability.Figure 5
Flowchart of mutation operation.


### 4.4. Termination Conditions

When the class size is large, the individuals obtained from 1,000 iterations of the population may still have a certain gap with the optimal solution, so the maximum number of genetic iterations should be automatically adjusted according to the class size. The termination conditions of evolution are given:(1)
The population is iterated to 125 × classNum times, where classNum denotes the number of classes in the school.(2)
The best individual in the population is conflict-free, and the ratio of the average fitness of the individuals in the population to the fitness of the best individual is greater than 0.9.(3)
The best individual in the population is maintained continuously for 5 × classNum generations.


## 4.1. Gene Coding and Chromosome Construction

(1)
The teacher number, course number, class number, classroom number, and class period form a tuple, which is the gene of the genetic algorithm. Each gene can be regarded as a classroom unit in the class schedule, and the gene structure is shown in Figure4. For example, in gene code 1001_2001_3001_4001_0-1-0, it means that teacher 1001 is teaching class 3001 in classroom 4001 during lesson period 0-1-0. The course number is 2001. ux=day,division,section. The day indicates the day of the week; division indicates the hour (AM, PM); section indicates the class period.In practice, the instructor needs to set up the schedule for each semester before scheduling; i.e., the relationship between courses, classes, teachers, and classrooms is determined.(2)
Construction of chromosomes on the basis of gene coding. The class schedule units (genes) of all classes form 1 chromosome (individual). The CourseInfo object represents the course information of each course in the schedule, including the course, class, instructor, classroom, campus, and weekly class hours. Each CourseInfo corresponds to one or more genes. This is determined by the number of weekly sessions under the CourseInfo. Each individual has the same number of genes.


## 4.2. Adaptation Function

In this paper, the fitness function is considered in terms of the priority and uniformity of the course sessions, and punishment degree is added to reduce the violation of constraints.In summary, the fitness function in this paper is given by(11)f=ω1⋅f1+ω2⋅f2⋅β,where ω1 and ω2 are the weights, and ω1 + ω2 = 1. β=α1hard_vios⋅α2soft_vios is punishment degree. α1 and α2 are the penalty factor, α1<1, α2<1, and α1<α2.


## 4.3. Design of Crossover and Mutation Operations in Scheduling System

The crossover strategy in this paper is as follows: individuals Individual_1 and Individual_2 are selected by the roulette algorithm based on individual adaptation. 1 grade is randomly selected, and the set of gene objects is collated. Exchange the gene objects of the classes involved in these 2 individuals.The idea of gene editing is introduced in the mutation operation in this paper.Step 1: 1 class is randomly selected and all gene objects related to the class are obtained from the individuals to be mutated.Step 2: determine whether the set of gene objects has conflicts. If the constraint is violated, step 3 is executed; otherwise step 5 is executed directly.Step 3: identify if the course schedule has a conflict (2 or more courses are scheduled for the same class period). If there is, only 1 class is reserved for that period, and the rest of the classes are scheduled for the free period. That is, select (i − 1) gene objects from the i conflicting gene objects and set their arrangeTime property value to the unscheduled free period, ignoring whether it will cause other conflicts. If there is no class conflict, then step 4 is executed; otherwise, the current mutation operation is exited.Step 4: identify if the teachers and classrooms schedule has a conflict. If yes, swap the conflicting course schedule with another schedule. After step 4, save the mutated individuals and exit the mutation operation.Step 5
: randomly select 2 courses and swap them.The overall flowchart of each mutation operation is shown in Figure5, where Mutation_rate is the mutation probability and Modi_rate is the genetic modification probability.Figure 5
Flowchart of mutation operation.


## 4.4. Termination Conditions

When the class size is large, the individuals obtained from 1,000 iterations of the population may still have a certain gap with the optimal solution, so the maximum number of genetic iterations should be automatically adjusted according to the class size. The termination conditions of evolution are given:(1)
The population is iterated to 125 × classNum times, where classNum denotes the number of classes in the school.(2)
The best individual in the population is conflict-free, and the ratio of the average fitness of the individuals in the population to the fitness of the best individual is greater than 0.9.(3)
The best individual in the population is maintained continuously for 5 × classNum generations.


## 5. Result Analysis and Discussion

### 5.1. Parameter Setting

The university scheduling algorithm based on improved genetic ant colony hybrid optimization was performed in a microcomputer environment with 2 GB RAM, Core 2 Duo2.2 GHz CPU, Windows 7, Visual C++2008. The proposed algorithm was tested using data from the School of Mathematics and Information Systems of a university.Time slots: Classes are held 5 days a week, with 5 classes scheduled each day, for a total of 25 slots.Classrooms: 56 (including all scheduled classrooms and computer rooms).Practical training room: 25.Teachers (including external teachers): 180.Classes: 63 (maximum number of students per class is 50).Students: 3620.According to the principle of genetic algorithm to search for optimal solutions, the following factors were considered experimentally.First, the effect of population size on scheduling: the main reference is the time required to find the optimal solution. How large the population size is moderate, so that it is more cost-effective for scheduling. Therefore, it is important to find a moderate population size.Second, the impact of crossover probability on scheduling: the size of the crossover probability affects the convergence of the search for the optimal solution; the larger the value the faster the convergence, but too large will converge too early for a better global search. Therefore, it is important to find a moderate value of crossover probability.Third, the impact of variance probability of scheduling: too large variance probability will cause the genetic algorithm to be unstable. Too small variation probability will in turn make the global search difficult. Therefore, it is important to find a moderate value of variation probability.Fourth is the number of generations of genetic evolution at convergence.


### 5.2. Experimental Comparison

The effect of population size on scheduling is given in Figure6. The population size was tentatively set at 50, 100, and 150, and three groups were tested, with six results recorded for each set of experiments. Obviously, in agreement with the common knowledge and prediction of this problem in this paper, the smaller the population size, the shorter the time to find a suitable solution. However, the population size is too small to find the optimal solution within a limited number of genetic generations. From the experiment in Figure 6, it can be seen that population size 100 is a more moderate result.Figure 6
Effect of population size on scheduling time.The effect of crossover probability on scheduling is given in Figure7. In this paper, experiments were conducted for crossover probabilities of 0.7, 0.8, and 0.9.Figure 7
Effect of crossover probability on scheduling time.From the above experimental data in Figure7, it can see that the larger the crossover probability is, the less time it takes to find a joint solution, which is actually the faster the search process converges. However, too large will converge too early to perform a better global search. Therefore, in this paper, the crossover probability is taken as 0.8, which is a more moderate result.The effect of mutation probability on scheduling is given in Figure8. If the mutation probability is too high, the algorithm will be unstable. According to genetic knowledge, too much variation does not produce good individuals but makes each chromosome unstable and produces a lot of conflicting results. Mutation probability is too small, too few new individuals are generated, and global search is difficult to carry out. In this paper, the probability of variation is 0.01, 0.02, and 0.04. From the experimental results in Figure 8, the difference between the experimental results of different mutation probability can be seen. The mutation probability of this system is 0.02, which is a moderate result.Figure 8
Effect of mutation probability on scheduling.Based on the original scheduling data, experiments were conducted for different penalty factors parameters. It can be obtained that when the probability of variation is 0.02, the penalty factorα1 is 0.88, and the penalty factor α2 is 0.94, and the fitness of the final result is the highest, reaching 0.83729.


### 5.3. Other Performance Analyses

Experimental simulations were conducted to compare with the greedy algorithm, genetic algorithm, ant colony algorithm, genetic ant colony algorithm, annealing algorithm, and the proposed algorithm to derive the performance differences of each algorithm in terms of conflict rate, success rate, running time, and scalable soft constraints for the metrics. The algorithm in this paper performs 20 simulation experiments with certain course weights, and the average performance values are shown in Table1. It can be seen that the performance of the scheduling algorithm in this paper is better.Table 1
Comparison of metric performance of several algorithms.
AlgorithmConflict rate (%)Success rate (%)Run time (s)Scalable soft constraintProposed algorithms010036YESGreedy algorithm445794NOGenetic algorithm2972164NOAnt colony algorithm1885127NOGenetic ant colony algorithm1391113NOAnnealing algorithm5249234NODifferent scheduling units such as 66, 124, 239, 528, and 849 were set and the adaptation values were compared under the above different scheduling units to obtain the results in Table2.Table 2
Comparison of algorithm adaptability.
Scheduling unitGenetic algorithmAnt colony algorithmProposed algorithm66178.9197.6210.4124200.6219.8227.5239229.5247.5269.7528268.6283.9319.6849297.4317.8353.8The results in Table2 show that the fitness values of the three algorithms increase simultaneously with the increase in the number of scheduling units. After the number of scheduling units reaches a certain level, the fitness of the three algorithms tends to stabilize. Keeping the number of scheduling units constant, the fitness value of the hybrid algorithm is higher than that of the single algorithm, which indicates that the hybrid algorithm is feasible and effective in the application.


## 5.1. Parameter Setting

The university scheduling algorithm based on improved genetic ant colony hybrid optimization was performed in a microcomputer environment with 2 GB RAM, Core 2 Duo2.2 GHz CPU, Windows 7, Visual C++2008. The proposed algorithm was tested using data from the School of Mathematics and Information Systems of a university.Time slots: Classes are held 5 days a week, with 5 classes scheduled each day, for a total of 25 slots.Classrooms: 56 (including all scheduled classrooms and computer rooms).Practical training room: 25.Teachers (including external teachers): 180.Classes: 63 (maximum number of students per class is 50).Students: 3620.According to the principle of genetic algorithm to search for optimal solutions, the following factors were considered experimentally.First, the effect of population size on scheduling: the main reference is the time required to find the optimal solution. How large the population size is moderate, so that it is more cost-effective for scheduling. Therefore, it is important to find a moderate population size.Second, the impact of crossover probability on scheduling: the size of the crossover probability affects the convergence of the search for the optimal solution; the larger the value the faster the convergence, but too large will converge too early for a better global search. Therefore, it is important to find a moderate value of crossover probability.Third, the impact of variance probability of scheduling: too large variance probability will cause the genetic algorithm to be unstable. Too small variation probability will in turn make the global search difficult. Therefore, it is important to find a moderate value of variation probability.Fourth is the number of generations of genetic evolution at convergence.


## 5.2. Experimental Comparison

The effect of population size on scheduling is given in Figure6. The population size was tentatively set at 50, 100, and 150, and three groups were tested, with six results recorded for each set of experiments. Obviously, in agreement with the common knowledge and prediction of this problem in this paper, the smaller the population size, the shorter the time to find a suitable solution. However, the population size is too small to find the optimal solution within a limited number of genetic generations. From the experiment in Figure 6, it can be seen that population size 100 is a more moderate result.Figure 6
Effect of population size on scheduling time.The effect of crossover probability on scheduling is given in Figure7. In this paper, experiments were conducted for crossover probabilities of 0.7, 0.8, and 0.9.Figure 7
Effect of crossover probability on scheduling time.From the above experimental data in Figure7, it can see that the larger the crossover probability is, the less time it takes to find a joint solution, which is actually the faster the search process converges. However, too large will converge too early to perform a better global search. Therefore, in this paper, the crossover probability is taken as 0.8, which is a more moderate result.The effect of mutation probability on scheduling is given in Figure8. If the mutation probability is too high, the algorithm will be unstable. According to genetic knowledge, too much variation does not produce good individuals but makes each chromosome unstable and produces a lot of conflicting results. Mutation probability is too small, too few new individuals are generated, and global search is difficult to carry out. In this paper, the probability of variation is 0.01, 0.02, and 0.04. From the experimental results in Figure 8, the difference between the experimental results of different mutation probability can be seen. The mutation probability of this system is 0.02, which is a moderate result.Figure 8
Effect of mutation probability on scheduling.Based on the original scheduling data, experiments were conducted for different penalty factors parameters. It can be obtained that when the probability of variation is 0.02, the penalty factorα1 is 0.88, and the penalty factor α2 is 0.94, and the fitness of the final result is the highest, reaching 0.83729.


## 5.3. Other Performance Analyses

Experimental simulations were conducted to compare with the greedy algorithm, genetic algorithm, ant colony algorithm, genetic ant colony algorithm, annealing algorithm, and the proposed algorithm to derive the performance differences of each algorithm in terms of conflict rate, success rate, running time, and scalable soft constraints for the metrics. The algorithm in this paper performs 20 simulation experiments with certain course weights, and the average performance values are shown in Table1. It can be seen that the performance of the scheduling algorithm in this paper is better.Table 1
Comparison of metric performance of several algorithms.
AlgorithmConflict rate (%)Success rate (%)Run time (s)Scalable soft constraintProposed algorithms010036YESGreedy algorithm445794NOGenetic algorithm2972164NOAnt colony algorithm1885127NOGenetic ant colony algorithm1391113NOAnnealing algorithm5249234NODifferent scheduling units such as 66, 124, 239, 528, and 849 were set and the adaptation values were compared under the above different scheduling units to obtain the results in Table2.Table 2
Comparison of algorithm adaptability.
Scheduling unitGenetic algorithmAnt colony algorithmProposed algorithm66178.9197.6210.4124200.6219.8227.5239229.5247.5269.7528268.6283.9319.6849297.4317.8353.8The results in Table2 show that the fitness values of the three algorithms increase simultaneously with the increase in the number of scheduling units. After the number of scheduling units reaches a certain level, the fitness of the three algorithms tends to stabilize. Keeping the number of scheduling units constant, the fitness value of the hybrid algorithm is higher than that of the single algorithm, which indicates that the hybrid algorithm is feasible and effective in the application.


## 6. Conclusion

The structural design and functional perfection of the scheduling system are increasingly demanding in view of the trend of diversity in university curriculum. Administrators should study the theory and practice of scheduling system design from the practical operational level. More intelligent, effective, and feasible algorithms are continuously explored to solve the problems encountered in the process of system development and actual operation. This paper presents a college scheduling algorithm based on improved genetic ant colony hybrid optimization. The algorithm proposes an enhanced infection genetic algorithm, a directed neighborhood expansion strategy, and a penalty mechanism and innovatively introduces the idea of gene editing in the genetic operator of the genetic algorithm. All these enhance the scheduling performance. This paper is based on the actual needs of universities to solve the scheduling problem, and the innovation points are mainly in the following four aspects:(1)
The enhanced infection genetic algorithm is proposed, which removes the unnecessary replication operation in the traditional genetic algorithm and improves the convergence speed, convergence accuracy, and operation speed of the algorithm.(2)
The ant movement rules are redefined using a directed neighborhood expansion strategy in the ant colony optimization algorithm to further shorten the path and improve the search efficiency.(3)
The genetic operator in the genetic algorithm innovatively introduces the idea of gene editing to automatically locate a conflict in the class schedule with a certain probability and eliminate the conflict, which greatly improves the evolutionary effect of the genetic algorithm.(4)
For the initial population generation strategy of the genetic algorithm proposed in this paper, a penalty degree design is introduced into the fitness function, which also improves the evolutionary effect of the genetic algorithm to a certain extent.Experimental results show that the algorithm proposed in this paper outperforms other algorithms in terms of scheduling conflict rate, success rate, running time, and fitness value. Therefore, the general framework and ideas of the improved genetic ant colony hybrid optimization algorithm for solving the scheduling problem proposed lead to an effective solution to the colleges and university scheduling problem. The future work is to improve the college scheduling algorithm to further improve the efficiency of scheduling.



---

*Source: 2565639-2022-06-14.xml*