Analysis of College Course Scheduling Problem Based on Ant Colony Algorithm

Ant colony algorithm is a new evolutionary algorithm, which is gradually applied due to its easy robustness with other methods and excellent distributed computing mechanism. Currently, the application field of ant colony algorithm has been infiltrated by a single TSP problem. Ant colony algorithm moves the algorithm toward the optimal solution through the combination of positive feedback and negative feedback. This paper briefly analyzes the basic characteristics of the basic idea and principle of the ant colony algorithm to apply it to the ant colony problem. Abstract the course scheduling problem, transform the course arrangement problem into the maximum matching problem of solving the bipartite diagram, and discharge the high-quality curriculum that basically meet the needs.


Background.
Class scheduling problem is a typical multiobjective combination optimization problem involving a variety of factors [1][2][3][4]. We should not only consider the learning effect of students, but also take care of the reasonable work arrangement of teachers and make full use of teaching equipment [5]. Scheduling the class schedule is a very important and very complicated task for the university academic affairs office. Due to the large amount of courses in each school, manual scheduling will inevitably appear all kinds of conflicts, and its shortcomings are more and more prominent. With the development of computer science and technology, the use of computer scheduling will solve the disadvantages of manual scheduling [1,6,7]. It is the computer method of simulating the human brain with the computer, discussing the thinking law and the choice method of arranging the class schedule. Automatic class scheduling has the advantages of short class scheduling time, high quality, and manpower saving [8]. At present, the methods to solve the scheduling problem include genetic algorithm, expert system, binary graph and coloring theory, simulated annealing algorithm, backtracking method, and so on.
However, from the actual use situation, the developed class scheduling software is not generally practical. On the one hand, the class scheduling system is a very complex system, and it is very difficult to solve all the constraints and aspects. On the other hand, because every kind of school or even every school has its own particularity, it is difficult to use the class scheduling software widely. erefore, the current practice is still to develop a different class scheduling software for different types of schools and then take a separate manual adjustment method for inappropriate scheduling methods.

Five Elements of the Lesson Scheduling Problem.
e scheduling process involves the five elements of curriculum, teacher, class, classroom, and time, which are defined as the following set [9,10]:   (1) Classes in the same class should be evenly distributed over a week [12]. (2) Mathematics courses or professional courses are arranged in the morning, and elective courses are installed in the evening or on weekends. (3) In continuous classes or teaching, the distance between classrooms should not be too far. (4) Physical education class is generally arranged in the afternoon, and no other classes are arranged after the physical education class. (5) e same class is arranged in the same class, at least one day apart, but not more than two days. (6) e same class is arranged in the same class, at least one day apart, but not more than two days. (7) Teachers' teaching tasks are evenly distributed within a week. (8) e same teacher teaches the same course and different classes, and on the same day, each class arranges the teaching content to ensure the continuity of teaching. in the process of foraging, and finally returns to the starting city. e ant can only arrive in each city once [13], What order does the ant enter the city to make the foraging journey shortest?

Building a Mathematical Model of the Ant Colony
Algorithm. Assuming the scale of the solving problem, where the foraging city number uses m instead, in the colony, the number of ants was n. en get the city set V � v 1 , v 2 , . . . , v m . en, the resulting set of paths between the cities is E � {(r,s)|r,s ∈ V}. At time t, if c i (t) (i � 1, . . ., m) is the number of ants located in the city i, the total number of ants is represented by n, and then n is calculated as below: (1) e concepts of taboo list, pheromone, and visibility emerged in the ant colony algorithm. Taboo list is a data structure that records the city that ants pass through in order to avoid ants entering the same city many times. Tubek is the taboo table of ant k, ant k passes through city i and adds city i to the taboo table Tubek. Tubek(q) is the q element in the taboo table of the ant k, indicating the q city through which the ant k passes. Pheromones are a substance released by ants whose concentrations are volatile over time. Visibility, also known as enlightening information, is defined as the reciprocal of the distance between two cities. e calculation formula is as follows: σ ij (t) is the enlightening information between cities i and cities j, and d ij is the distance between the two cities. e closer the distance between cities, the greater the enlightening information, and the more likely the path is to be selected. Enlightening information is fixed. p k ij (t) represents the probability of ant k moving from city i to city j at time t, and p k ij (t) is defined by the following formula: In the above formula, τ ij (t) is the residual pheromone on the two interurban paths (i, j) at time t, α is the information heuristic factor, the importance of the residual information, and β is the expected heuristic factor, which is the relative importance of the information. J k (i) represents the set of cities to which the next step allows transfer when ant k is in city i, defined as the following formula: After each ant foraging visits all cities, the pheromone concentration of the interurban path will change. e pheromone on the path should be updated, and the pheromone update is calculated as below: 2 Computational Intelligence and Neuroscience Δτ k ij (t) � Q L k , Ant K passes through the path between the two cities(i, j), where Δτ ij (t) is the added pheromone on the path at time t (i, j) and Δτ k ij (t) is the added pheromone of the ant k at time t on the path (i, j). ρ is the pheromone evaporation coefficient, and 1 − ρ is the persistence coefficient of the pheromone. e amount of pheromone released by the ants is Q. e L k is the total path length that the ant k passes through all cities.

Abstraction of the Individual Ants.
Ant colony algorithm is a computer model of real ant foraging behavior, which is a mechanistic behavior. erefore, the "ants" in the ant colony algorithm are an abstraction of the real ants, and it is impossible and unnecessary to completely reproduce the individual real ants. Ant abstracted out is known as artificial ant. Artificial ant can be regarded as a simple agent, which can complete the construction process of the simple solution to the problem and can talk with other agents through a means.
Artificial ants and real ants have the following points in common: (1) ere is a mechanism in which individuals communicate in a group [14]: pheromone. (2) Complete the same task: to find the shortest path [15]. (3) Random selection strategies that use current information for path selection: probabilistic selection strategies.
e abstract artificial ants have their own personality.
(2) Artificial ants have the memory ability.
(3) Artificial ants have the corresponding enlightening information.
It is precisely because of these characteristics that artificial ants make ant colony algorithms have higher intelligence and make them more efficient [17].

Description of the Problem Space.
Although real ants in nature exist in a three-dimensional environment, we can completely abstract the ant foraging route on a plane or curved surface [18]. In other words, such a three-dimensional environment can be regarded as a special two-dimensional plane. In addition, if you want to use the ant colony algorithm on the computer, the abstract artificial ant must move in a discrete twodimensional plane [19,20]. Real ants forage on continuous paths, so the ant colony algorithm must abstract such continuity into discrete, and this abstraction is understandable. If the actual problem can be described by graphs, you can consider whether the problem can be solved with the ant colony algorithm [21].

Find an Abstraction of the Path.
Artificial ants move between nodes in a discrete two-dimensional plane, so through which path does the current node reach the next node? What to choose? In this case, the size of the pheromone on the path can be abstracted into the weights on the edge of the graph [22]. At each node, the artificial ant selects the next node based on the size of the weights on the path. By using this method, reaching the target node from the initial node obtains a feasible solution to the problem.

Abstraction of the Pheromone Volatilization.
Ants in nature always leave pheromones continuously along the path, which will gradually evaporate over time. Since the computer handles disengagement events, it can consider the discrete time of the pheromones (i.e., the weight (the pheromone) of the artificial ant) [23].

Introduction of Enlightening Information.
e above abstraction is just a computerized representation of the real ant colony foraging behavior, reflecting the very high selforganization of ant colony foraging behavior [24]. However, this self-organization takes a lot of time, often this timeconsuming is unacceptable, and we must improve the time utilization.
e ant colony algorithm is given a guide according to the specific features of the problem space. Introduce heuristic information within the probabilistic strategy that determines the direction of an ant walk, giving all ants a prior knowledge about the length of the path.

Design of the Ant Colony Algorithm
To solve the scheduling problem, the ant colony algorithm [25][26][27][28][29][30][31] needs to establish a special graphical structure. From the analysis of the scheduling problem, the relationship between the five elements of curriculum, teacher, class, classroom, and time in the scheduling process turns into the relationship between OTL "Courses, Teachers, Classes" and RI "Classroom, Time." Using the binary graph model can solve the maximum matching problem of two mutually disjoint OTL sets and RI sets. e structural course scheduling problem satisfies the hard constraints of the binary graph model, and can fulfill the basic requirements of the course scheduling problem, that is, the class plan is at the Computational Intelligence and Neuroscience 3 right vertex, the classroom meets the needs of all courses, and does not conflict with the teacher, class, and course time. However, to optimize the course scheduling, we need to use ant colony algorithm for further dynamic adjustment.

Bipartite
Model. e bipartite graph [32][33][34][35] is that for an undirected graph, the set of vertices can be divided into two disjoint subsets, and the two vertices attached to each edge belong to these two different subsets.

Set of Vertices of the Model.
On the basis of analyzing the problem of class scheduling, it is found that before class scheduling, each department should provide <course, class and teacher> relationship to the general academic affairs office, and the academic affairs office of the general school should arrange the class <time and classroom>. Here, we reduce the scheduling problem to be searched in the solution space of O × T × L × R × I Cartesian product to solve the maximum matching problem formed by <course, class, teacher> relationship and <time, classroom> relationship.
Suppose < R OTL representative for course, class, teacher> relationship, <time, classroom> R RI All tuples in the R OTL relationship are regarded as all vertices on the left of the bipartite graph, actually the constituent vertex set G OTL , and all tuples in the R RI relationship are regarded as all vertices on the right of the bipartite graph, actually the constituent vertex set G RI . So, any two vertices belonging to set G OTL are independent between them. Similarly, any two vertices belonging to set G RI are also independent. In addition, the quantitative relationship between sets |G OTL | and |G RI | must meet |G OTL ||G OTL | < |G RI |; otherwise, the scheduling problem must not be solved. |G OTL | represents the number of courses to be scheduled, and |G RI | represents the number of time-space resources that can be provided. Not only that, but |G OTL | ＜ |G RI | should be guaranteed, so that enough <time-space> for students to selfstudy. Let N be a set of all vertices in the bipartite graph model of the scheduling problem with the following formula:

e Set of Edges of the Model.
First, because the curriculum must be arranged in the desired type of classroom, not all vertices in G OTL are full mapping to all vertices in G RI , and only classrooms that meet the requirements can be connected to the corresponding curriculum. So, the edges in the bipartite graph are the connections of all nodes in G OTL and all nodes in which matching the classroom type matches G RI . Secondly, the classroom capacity allocated during the schedule must meet the number of students in the class, so the second part diagram should not include the classroom capacity that does not meet the class size. irdly, the course of a class must be arranged in the campus where the class is located, so the edges of the two diagram must meet the same campus attributes of the left and right vertices. Assuming that S is a set of edges in the bipartite graph model of the scheduling problem, then S � {(n 1 ,n 2 )| n 1 ∈ G OTL (n 2 ∈ G RI ). e type of classrooms required in course n1 matches the type of classrooms provided by n 2 , the number of classes taught in course n 1 is <the number of seats provided by n 2 , and the campus attributes of the class in course n 1 match the campus where the classroom provided by n 2 is located.

e Weights of Each Side of the Bipartite
Graph. e weights on each edge can be constructed according to the expected degree of a specific course on the correlation <time, classroom> in the scheduling question. If in order to ensure the teaching effect, higher mathematics class had better be arranged in 1-2 morning. In this way, the weights (cost c ij ) of all the higher math classes in the left set G OTL in the bipartite graph and all the nodes in the 1-2 am set G RI are less than the weights of the nodes in the other time periods. In this way, these edges are selected to the better solution.

Bipartite Model.
e bipartite model for the scheduling problem, G � {N, S, C}, is shown in Figure 1.

Determine the Bipartite Graph.
e bipartite graph model of the scheduling problem is constructed into a graph as shown in Figure 2.

Structure of the Individual Ants. Every ant must have a memory ability
(1) Each ant can remember which <time, classroom> nodes in G RI have completed the schedule and which nodes are still in the waiting stage. e specific method is to assign each ant an RI allocation table, which records which <R, I> nodes the ant passes through during this tour, and updates every node. Also, the <R, I>allocation table needs to be emptied in time before the ant starts its next trip.
(2) In the process of a weekly tour, the distribution of all courses <time and classroom> can be used to compare with other ant results to select the optimal class scheduling method. e implementation was made by assigning a temporary schedule to each ant. For each course, a match is written into a temporary schedule. When you end the tour, compare the cost of all the ants' temporary schedules and find the one with the least cost. Clear out again as all the ants begin a new round of travel. (3) Ability to remember the closeness of course nodes and <time, classroom> nodes. All ants used the same weight information table, used to record this closeness.
Each ant should have a priori ability when choosing a path.
Ants have a full understanding that it is inappropriate to arrange a class in a certain classroom or in a certain period of time. e method is to make the generation value of the edge in the bipartite graph play a full role. Moreover, this generation value directly reflects the expected degree of correlation between the class nodes and <time and classroom> nodes. 4 Computational Intelligence and Neuroscience Each ant communicates with each other by the pheromone left on the path passing through.
With the process of ant optimization, the amount of information on some paths becomes more informative than others. e amount of information can guide the ants to find the optimal solution. e ants follow a probabilistic selection strategy to perform path selection. e probabilistic selection strategy also increases the possibility of random selection of paths and avoids the premature ending of algorithms in bad solutions.

A Weekly Tour by the Ants.
Ants complete a search for all the nodes in the graph, called a weekly walk. e global optimal route is the route that results the best of all the searches you have done. In the classic TSP problem, ants start from the initial city node and pass through each city node in the graph and only once. When all the nodes finish, the ant's one tour ends. e definition of ant travel in the scheduling problem is different in the bipartite model of the scheduling problem, and all ants start from a node in the left G OTL set of the bipartite graph to find the corresponding matching node in the right G RI set according to the state transition function. en, all the ants return to the next node in the G OTL set to start the next search for matches, logically regarded as a node at the beginning of the next one and the previous one. It was not until the ants matched all the courses in set G OTL that the weekly tour was over (of course, there must be some knots in G RI at the end of an ant's tour).

e Pheromone Strategy-e MMAS Pheromone Strategy Was Used
(1) Only the ants with the least cost perform pheromone updates in each iteration, a practice that enables the algorithm faster convergence to the better solution.
(2) e premature stagnation of the algorithm appears because pheromones are too concentrated on several better paths, while other paths are because no ants pass by for a long time, and pheromones are gradually volatile, resulting in the pheromone concentration on the path to 0. Exploring new paths is almost impossible. To reduce the possibility of stagnation in the early algorithm search, pheromones are restricted to range [τ min , τ max ], which can easily avoid pheromones becoming too large or too small in the course of the algorithm running. Clearly point out τ ij ∈[τ min , τ max ]. In the process of ant optimization, if τ ij ≥ τ max , then make τ ij � τ max ; if over τ ij ≤ τ min , the order τ ij � τ min . is effectively avoids premature stagnation and expands the search space of the algorithm.
(3) Each path initializes the pheromone concentration to τ max , and doing so can increase the search range of the solution in the beginning of the algorithm.
(4) e simultaneous introduction of a pheromone smoothing processing mechanism, namely, Δτ ∝ (τ max − τ ij (t)), the pheromone enhancement obtained by paths with already high pheromone concentration, will facilitate efficient path search for paths smaller than the pheromone concentration.

Scheduling Steps
(1) Refer to the course schedule, divide the five elements of the scheduling problem into two vertex sets OTL and RI, then connect the vertices in the OTL and RI sets that meet the conditions, build the common weight information table of vertices on both sides, and establish a binary graph model.

Conclusion
With the gradual expansion of college enrollment scale and the more and more popularization of computer in teaching, it has become one of the urgent research topics to be solved in teaching management to replace the manual class scheduling with high labor intensity and low work efficiency in teaching management. According to the characteristics of the scheduling problem, the paper abstracts it into a bipartite graph model and applies the ant colony algorithm to match the bipartite graph to find the better arrangement method of the course. e main achievements are as follows: (1) e constraints of the scheduling problem are discussed systematically, and we describe the scheduling problem and its constraints with a mathematical model. (2) e scheduling problem is transformed into a bipartite graph model, and the memory ability, ability to master prior knowledge, adaptation ability, and collaboration ability are applied to move back and forth in the two sets of the bipartite graph to complete the schedule arrangement with higher quality. (3) Adaptive selection strategy combining deterministic selection and random selection, dynamically adjusting the probability of deterministic selection and random selection use, maximum and minimalistic pheromone strategy, and pheromone smoothing processing mechanism are applied to the scheduling ant colony algorithm. Experimental results show that this method guarantees the quality of the efficiency and reconciliation of the algorithm. (4) When solving the constraints of the scheduling problem, the ants are endowed with a lot of memory ability and necessary prior knowledge mastery ability, effectively satisfying most of the individual Computational Intelligence and Neuroscience inspired information strategies introduced at the same time, and well solving the problem of a certain time interval in the course arrangement of more than 2 weeks. e scheduling problem is a complete NP problem, and this paper establishes a bipartite graph model for the scheduling problem. e proposed model is able to greatly reduce the complexity of the algorithm and reduce the solution time from exponential growth to polynomial growth. e experimental results show that the scheduling results using this paper method are ideal, solving all the hard conflicts mentioned here, and also satisfying some soft constraints to the maximum. However, many practical problems are combined classes, special weeks, elective courses, and time constraints on different campuses. erefore, the algorithm needs to be further improved. I hope my research can provide a new idea for the solution of class scheduling algorithm and contribute to the application of ant colony algorithm.
Data Availability e dataset can be accessed from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.