A Course Scheduling Algorithm Based on Self-Adaptive Constrained Particle Swarm *

The automatic course scheduling in college is a complex constraint optimization problem. A kind of selfadaptive constraint particle swarm algorithm is proposed to avoid premature convergence of particle swarm optimization algorithm. A self-adaptive criterion is applied in different phases of algorithm execution to realize dynamic and adaptive switch between attractors and repellors during the algorithm’s running process, and inertia weight will change dynamically and adaptively with the number of iterations. The algorithm performance can be further improved with a higher convergence speed and stronger robustness.


Introduction
The course scheduling in college is a very important and rather complex work in teaching management.Its main function is summarizing course application forms of various teaching institutes and departments and then formulating class timetables for the whole college according to the professional talent cultivation plans so as to enable the whole teaching to proceed in a planned and ordered way.The course scheduling system must ensure that no conflicts occur to teachers, students and classrooms in the course arrangement and meet the constraint conditions such as the teachers' requirements and classroom resources.
Therefore, the course scheduling is a constrained, multi-objective combinational optimization problem.How to make use of various existing techniques to realize the automation, scientification and rationalization of formulating class timetables and improve the resource utilization rate as well as the satisfaction of teachers and students to class timetables is one of burning questions in college teaching management work at present.It is of great practical significance to present a self-adaptive algorithm for the course scheduling problem that can meet constraints and reduce calculated amount.
To reduce the time needed to judge constraints in the operational process of the course scheduling system, this paper presents a new method of solving constrained optimization problems, self-adaptive constrained particle swarm algorithm by overcoming the limitation of particle swarm optimization algorithm.The results show that the improved algorithm has stronger optimizing capability and efficiency to solve constrained optimization problems.

Particle Swarm Optimization
The particle swarm optimization is a new evolutionary algorithm that has been developed in recent years.It is a kind of evolutionary computation technique, derived from the research on the birds preying behavior, was proposed by Dr. Eberhart and Dr. Kennedy in 1995.This algorithm is a simplified model which was first enlightened by the regularity of birds' swarm activities and then was built with swarm intelligence.By making use of the information sharing of individuals in the swarm, the algorithm makes the movement of the whole swarm produce an evolutionary process from disorder to order in the problem solution space and then obtains the optimal solution.
The course scheduling problem mainly involves the five elements such as teacher, course, class, time and classroom, among which teacher, course and class are closely related.The five elements involved in the course scheduling problem are set as follows: Lesson Set: The Cartesian product of five elements constitutes the solution space of the course scheduling problem, and course scheduling is to find a solution that meets various constraints in this solutions space.

Constrained Swarm Coding
The constrained swarm coding is the key of self-adaptive constrained particle swarm optimization, and the coding quality determines the algorithm performance.In this algorithm, the constrained particle coding adopts decimal coding, whose structure is shown as Table 1.For example, the particle with the code "0401041101010000541000151" indicates such a course scheduling information: teaching building 04, classroom 0104, class 110101, the teacher with job number 000054 has course 10001 (appointed as Office Automation in our college) at the first two classes on Friday morning (time code is 51).
Every particle shows a possible course scheduling result, and the merit of particles can be evaluated according to the fitness function value.

Fitness Function
Let x be a feasible class timetable and X be the set of all feasible class timetables, and we build the fitness function as follows: (1) Among them, x is a feasible class timetable, X is the set constituted by all feasible class timetables,

The Description of Self-Adaptive Constrained Particle Swarm Optimization
Several methods have been proposed to overcome the premature convergence of continuous particle swarm optimization algorithm, yet at present there are not rather effective methods to solve the premature convergence problem of discrete particle swarm optimization algorithm.This paper has proposed a self-adaptive constrained particle swarm optimization algorithm based on constrained discrete particle swarm.To overcome the premature convergence of the algorithm, a criterion of controlling swarm diversity has been presented to measure the diversity of the current swarm, and a repulsive process has been introduced on the basis of the original algorithm to increase swarm diversity.When the swarm diversity is below the specified threshold, the repulsive process will be executed to make particles deviate from the worst solution of individuals and the optimal solution of the current swarm and search the unreached area until the swarm diversity exceeds the specified threshold, and then the attractive process will be executed to make individuals move towards the optional solution of the current swarm as well as individuals.To further improve the algorithm performance, a selfadaptive strategy has been defined in this paper to make the inertia weight change dynamically and adaptively with the iterations in the different executing phases of the algorithm, and several local search techniques have been introduced to speed up the convergence and improve the precision of the solution.
Thus, the two velocity updating formulas and position updating formulas of particles in the adaptive constrained particle optimization algorithm are defined as follows: The velocity updating formulas: Attractors: u Among them, Z denotes the inertia weight that is used to control the influence which the previous velocity has on the current velocity 1 I , 2 I denote the learning coefficients, whose values are random numbers between 0 and 1. Position updating formulas: It can be seen that, as for attractors, particles share the information of the current better solution and attract each other; as for repellors, particles share the information of the worst solution of individuals and the optimal solution of current swarm and move in the direction of deviating from these positions and search the potential optimal solution area that has not attained to increase the swarm diversity.
The discrete particle swarm optimization algorithm to solve the course scheduling problem proceeds as follows:

Experimental Result and Analysis
To verify the effectiveness of the self-adaptive constrained particle swarm optimization algorithm presented in this paper, the actual course scheduling from some college are chosen as the experimental data.The experimental environment is as follows: Intel(R)Pentium(R)D, CPU 3.00 GHz, 2.99 GHz 4.00 GB primary memory, Windows Server 2003, and Matlab7.0

Experimental Data
This paper takes the course scheduling in some semester from some college as the experimental data, including 292 teachers, 163 classes and 865 courses.The courses, classes and teaching times per week of each teacher are referred to the actual workload.

Experimental Result
The experiment generates 292 particles altogether, each of which is a two-dimensional matrix; w=0.9, c1=0.5, c2 =0.5; the maximum iteration times MaxDT =10.The analysis of the experimental result shows that the class timetables generated by the algorithm in this paper have no conflicts and all of them are arranged in the confined scope.The newly generated class timetables not only meet the conclusive condition but also appear more reasonable and humanized than the existing class timetables.

Conclusion
This paper has introduced a solution for the course scheduling problem in colleges by using the self-adaptive constrained particle swarm optimization algorithm.This solution introduces a repulsive process to prevent the swarm premature convergence, using attractive and repulsive processes to evolve the swarm constantly.To improve the algorithm performance, a strategy of dynamically and adaptively changing inertia weight has been proposed and local search techniques have been introduced.
The key point of the follow-up study is to further expand the experimental scope and introduce other intelligent algorithms to further improve the course scheduling system for the solution of the course scheduling problem in college.

1 Z 2 Z 3 Z 3 f
are the corresponding weights, are fitness functions which meet course dispersion degree, time utilization ratio and classroom utilization ratio respectively.

Table 1 .
Constrained Particle Coding Table