Research on algorithm of general university scheduling----3. Scheduling algorithm based on time slice priority class
3 description and analysis of scheduling algorithm based on time slice priority class
The problem of course scheduling is essentially the conflict of five-dimensional relationship between time, teacher, class, classroom and course, and to solve this problem, we must first understand some basic principles of the course and some essential requirements of the course.
3. The basic principles of the 1-row class
In the course of the arrangement of the rules should be followed, only according to the basic rules of the curriculum to reduce the occurrence of conflicts, these basic rules are mainly the following:
1) Students of the same class cannot arrange two courses at the same time (except for certain elective periods)
2) The same teacher can not arrange two courses at the same time
3) The same classroom can not arrange two courses at the same time
4) The total number of courses scheduled at the same time may not be greater than the total number of classrooms available
5) The total number of participants in a given course should not be greater than the number of seats in the classroom
6) The properties of the provided classrooms are consistent with the properties of the classroom required for the course
In the five-dimensional relationship of time, teacher, class, classroom and curriculum, there is a close relationship between time, teacher and class. In contrast, classrooms are less closely related to them.
3. 2 Basic requirements for class
The course arrangement is not arbitrary, in order to achieve the best teaching effect should follow certain requirements. The main requirements are:
1) Try to arrange the best time for this class for the classes you are arranging.
2) When the course is repeated several times a week, there must be a certain interval of
3) courses involving a wide range of subjects, such as classes, should be treated as a priority
4) for the same teacher, the same subject should try to choose a relatively fixed number of classrooms
5) A relatively fixed classroom should be selected for the course of the same class
6) The classroom selection of the attached class should not be too far apart
7) There are several classes on the same day to distract lessons as much as possible
8) Priority to meet some special requirements (such as some classrooms like the morning classes, can be prioritized)
3. 3 algorithm description based on time slice priority class scheduling
Before we describe the algorithm, we make some concepts clear first. Here we call the class from the administrative point of view called the natural class, the class in the same classroom classes called Schedule class. In the university some of the common course is a few row classes through the multimedia to come together, we put the sum of this class is called the public class. Classes, classrooms, teachers and courses all maintain a timetable for themselves. For each of the table elements of the timetable (e.g., the first lesson of the Monday), the time slice is called here.
Based on the time-slice priority scheduling algorithm, a time slice is chosen around the timetable of each pair of images (natural classes, classrooms, classrooms), in order to arrange classes.
<!--[if!supportlists]-->1. <!--[endif]--> algorithm flowchart
<!--[if!vml]--><!--[endif]-->
<!--[if!supportlists]-->2. Pseudo-code Description of <!--[endif]--> algorithm
Input: Teacher (teacher1,teacher2,................ Teachern)
Classroom (room1,room2,..................... roomn)
Class (Class1,class2,...................... classn)
Course (Course1,course2,.................. Coursen)
Priority of each teacher, classroom, class, course time slice
Schedule Class (SCHUDEL_CLASS1,SCHUDEL_CLASS2.........SCHUDEL_CLASSN)
Output: Teachers, classrooms, and classes that have already lined up the timetable
Procedure schudeling (Teacher,room,class,course,schudel_class,public_class)
Initializes an empty timesheet that initializes the priority/first level of each time slice of the timesheet to the advanced
Init time_table
To deal with the schedule class
For every schudel_class do:
If (! Check_have_despose (Schudel_class))//If the class has not yet been scheduled
Begin:
Time_table=time_table & Get_all_class_time_table (Schudel_class)
Time_table=time_table & Get_room (Schudel_class);
Time_table=time_table & Get_teacher (Schudel_class);
Course=get_course (Schudel_class);
Assuming that there are only two sections of the class
Int icount2=0;//the number of times that the class is connected to the church
Int icount3=0;//the number of times that the class was connected to the church
Get the course number of lessons per week
Int Course_count=get_couse_count (course);
Get a weekly lesson
Parse_couse_count (COURSE_COUNT,&ICOUNT2,&ICOUNT3);
According to Icount2,icount3, and time_table to select N for the class
(N=ICOUNT2+ICOUNT3) The appropriate time slice, stored in the CPoint variable
CPoint PO;
llist<cpoint>* CP
Int priority[7]=0;
Get the sum of the daily priorities
Loop:i=0 until i=6 do:
Loop:j=0 until j=6 do:
Begin:
Priority[i] =priority[i]+ Time_table.time_piece[i][j]
End Begin
Get the highest sum of priorities the day we think that time is the most idle
Suitable for arranging courses
int Number=get_number (priority[7]);
BOOL fail
While icount2>0 do:
Begin:
Fail=get_time_pieces (2,&NUMBER,PO);
if (!fail) then do
Begin
icount2--;
Cp->append_list (PO);
End begin
Else
Break
End Begin
While icount3>0 do:
Begin:
Fail=get_time_pieces (3,&NUMBER,PO);
if (!fail) then do:
Begin
icount3--;
Cp->append_list (PO);
End begin
Else
break;
End Begin
According to *CP data and schudel_class data to the Schudel_class in the natural classes, the resulting classrooms,
Teacher's schedule to write back
if (!fail) do
WriteBack (SCHUDEL_CLASS,CP);
Else Then
RollBack (SCHUDEL_CLASS,CP);//Put the previously selected classroom, the teacher to "erase" off
End Begin
End schudeling
Some of the functions explained in the algorithm are:
BOOL Check_for_dispose (Schudel_class): In order to arrange classes for the parameters, determine whether the class class has been lined up for the class, lined up to return to Treu, otherwise return false
' & ' Operation: This operation is for two timetable of operation, return a new timetable; the time slice of the given timetable is the smaller value of the time slice for the calculated timetable.
ctime_table& Get_all_class_time (Schudel_class): In order to arrange classes for the parameters, the class schedule of all natural classes are & The new timetable to be returned
ctime_table& Get_room (Schudel_class): In order to arrange classes as the parameters, for the class allocation of all suitable classrooms, and the resulting classroom timetable for & return to the new timetable
ctime_table& Get_teacher (Schudel_class): Take the schedule class as the parameter, select a suitable teacher for the class, and return to the teacher's timetable
Ccourse Get_course (Schudel_class): Take the schedule class as the parameter, get the course of the class, and return
Int Get_course_count (Ccourse): Take the course as a parameter, get the course number of lessons per week, and return
Parse_course_count (int&,int&,int&): Analyze the value returned by the Get_course_count and divide the value by 2 knots and 3 knots (assuming that there are only 2 knots and 3 even two cases)
Int GetNumber (int*): Passes in an integer array, gets the subscript of the largest value in the integer array, and returns the
WriteBack (schudel_class,llist<cpoint>*): Update the timesheet information for teachers, classes, and classrooms in public_class based on time slice values in llist<cpoint>*
RollBack (schudel_class,llist<cpoint>*): Erase the previous steps in class, teacher, class, classroom, write down the data
Computer scheduling is a complicated process, and it is very important to reach a reasonable schedule by artificial interference under the condition of large amount of data and many restrictive conditions. The artificial interference includes some data input work before arranging the course, the manual carries on the pre-arranging lesson, after the course completes the curriculum to carry on the appropriate adjustment lesson.
3. 4 Algorithm Analysis
This algorithm belongs to greedy algorithm. Every time the teacher, the classroom resource selection is to take the current optimal data. This algorithm is based on the priority of teachers, classrooms, classes to take the best value, so the specific requirements of each object will be clearly reflected in the teacher, classroom resources are not scarce, the algorithm can discharge relatively reasonable courses. Compared with the two algorithms introduced in the previous chapter, the ability to deal with various special requirements has obvious advantages.
Resources
Reference website :
Http://www.csdn.net
Http://www.vckbase.com
Http://www.codeproject.com
http://lib.hnu.net.cn
Reference documents:
[1] "An Average case approximation Bound for Course scheduling by greedy bipartite Matching" Gary Lewandowski1, Prakash Oj HA2, Jennifer Rizzo1, and Abigail walker1xavier University, Mathematics and computer science Department
[2] "A column generation scheme for faculty time-tabling" Paolo Sera.ni, University of Udine, Italy
[3] timetabling using a Steady state genetic algorithm Ender Ozcan, Alpay Alkan
Yeditepe University Department of Computer Engineering,
[4] Priority-based automatic scheduling algorithm PCSA design and implementation Chen Yi, Yang, Zhang Guorong, Wang Xiangzhong Computer College of Beijing University of Commerce and Technology
[5] algorithm based on curriculum meta-correlation arithmetic Dong Yanyun Chanxiao Zhang Yushu Southwest Jiaotong University
[6] Visual C + +. NET book, Tom Archer, Andrew Whitechapel, electronic industry Press
[7] Visual C + + 6.0 network and Interner Development Guide Li Boxuan Tsinghua University Press 2000
[8] Visual c++6.0 Project case navigator Yang Xiaoping Science Press
[9] Learning visual c++6.0 []davis Chapman Chang translation of Tsinghua University Press Simon and Shu Te International Publishing Co.
[6] Database system concept [US] Abraham Silberschatz Henry F.korth Machinery Industry Press
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
You can reprint the above text in any form, but must contain the following text
This article is writted By:liu zhen yuan
Copyed from:http://blog.csdn.net/kegao2741
If you had any problem about the artcile you'll feel free to contact me by mail "[Email protected]"
trackback:http://tb.blog.csdn.net/trackback.aspx?postid=651928
Research on algorithm of general university scheduling----3. Scheduling algorithm based on time slice priority class