Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 49 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
49
Dung lượng
350,03 KB
Nội dung
VIETNAM NATIONAL UNIVERSITY UNIVERSITY OF SCIENCE FACULTY OF MATHEMATICS , MECHANICS AND INFORMATICS Nguyen Anh Hoang TIMETABLING PROBLEM Undergraduate Thesis Advanced Undergraduate Program in Mathematics Hanoi - 2012 VIETNAM NATIONAL UNIVERSITY UNIVERSITY OF SCIENCE FACULTY OF MATHEMATICS , MECHANICS AND INFORMATICS Nguyen Anh Hoang TIMETABLING PROBLEM Undergraduate Thesis Advanced Undergraduate Program in Mathematics Thesis advisor: Dr. Hoang Nam Dung Hanoi - 2012 Contents Chapter 1. The Timetabling Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.2. Applications. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2.1. E x amination Timetabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2.2. Po st En rollment based Course Timetabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.2.3. Curriculum based Course Timetabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Chapter 2. Some General Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1. Genetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.1. In troduction and Some Fu n damentals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.1.2. Main Ideas of Genetic Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.2. Memetic Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2.1. Solution Representation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 2.2.2. Generating the First Popu lation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 2.2.3. The Evolutionary Operator s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Chapter 3. Specific Method for the International Timetabling Competition 19 3.1. Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.1. Cons truction Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 3.1.2. Hill Climbing Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 3.1.3. Great Deluge Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 3.1.4. Simulated Annealling Phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2. Applying to Competition Problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 3.2.1. Applying to Examination Timetabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 3.2.2. Applying to Post Enrollment based Course Timetabling . . . . . . . . . . . . . . . . . . . 24 3.2.3. Applying to Curriculum based Course Timetabling . . . . . . . . . . . . . . . . . . . . . . . 25 i Chapter 4. Applying to the University Timetabling Problem . . . . . . . . . . . . . . . 27 4.1. Definition of the Problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 4.2. Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.2.1. Deal with Hard Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4.2.2. Deal with Soft Constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 4.3. Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 4.3.1. Imp rove t h e Original Timetable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 4.3.2. Apply the Algorithm to Create a Brand New Timetable . . . . . . . . . . . . . . . . . . . . 33 4.3.3. Comparing Solution between Original Timetable and New Timet able. . . . . . 41 ii ACKNOWLEDGM ENTS I am grateful to all those who spent their time and support for this report. Foremost among this group is my advisor and instructor- Dr Hoang Nam Dung. Thank you for your dedication, patience, enthusiasim and encouragement to this report. Sincere thanks to spent hours to meet me and encourage me to continue this project and broad my knowledge. Second, sincere thanks to all professors and lecturers of Faculty of Mathe- matics, Mechanics and Informatics for their help throughout my university’s life at Hanoi University of Science. Finally, I would like to thank my family and friends who always support and give me advice during my career at school. iii Introduction Nowadays, the timetabling problems are widely common in the real world. They can be seen and considered in every university in any country. They often con- tain some constraints that needed to be satisfied, with the purpose to set an efficient timetable. Many algorithms are now gradually being constructed and developed , since finding the absolutely optimal solution is almost impossible. However, peo- ple’s attempts for seeking the best method to solve the timetabling problems are very important and meaning to the world. This thesis is organised as follows: Chapter 1 presents definitions of the timetabling problem and its applica- tions. It can be constructed weekly timetable for a university. Chapter 2 will give you some algorithms that can be used to solve this kind of problems. Up to now, people have found many ways to deal with scheduling problem, and some of those are quite effective. Chapter 3 is devoted for the specific methods that the winners of the Interna- tional Timetabling Competition 2007 used to solve the problems. At last, Chapter 4 will illustrates an application at Hanoi University of Sci- ence timetabling problem and some of writter’s ideas to tackle this problem. iv CHAPTER 1 The Timetabling Problem 1.1. Defin i tions In the context of a university, a typical timetabling problems generally in- volves assigning a set of events (lectures, exam, tutorials and so on) to a limited number of timeslots and rooms in such a way as to satisfy a set of constraints. The two most common forms of this problem are exam-timetabling problems and course-timetabling problems, and in reality, the constraints imposed upon these can often be quite similar. However, the crucial difference between them is usually con- sidered to be that in exam timetables, multiple events can take place in the same room at the same time (as long as the seating capacity is not exceeded), while in course-timetabling problems, we are generally only allowed one event in a room per timeslot [3]. In automated timetabling, the constraints for both types of timetabling prob- lems generally tend to be separated into two groups: the hard constraints and the soft constraints. Hard constraints have a higher priority than soft, and usually be mandatory in their satisfaction. Indeed, timetable will usually only be considered feasible if and only if all of the hard constraints of the problem have been satisfied. Soft constraints, meanwhile, are those that we want to obey if possible, and more often than not they will describe what it is for a timetable to be good with regards to the timetabling policies of the universities concerned, as well as the experiences of the people who will have to use it [3]. 1 1.2. Appli cations Timetabling problems and the methods to solve them have many applica- tions to the real world. For example, it can be used to schedule the weekly timetable in the universities, or schedule the worktime in some companies. To have a wider view, in this section, we are interested in the second International Timetabling com- petition and its problems. The second I nternational Timetabling competions consisted of three prob- lems, each representing a different problem in educational timetabling, name ly, ex- amination timetabling, post enrollment based course timetabling, and curriculum based course timetabling. This section provides a brief descriptscription of these problems. 1.2.1. Examination Timetabling 1 The examination timetabling problem model presented in this problem is an extension of the model commonly worked on. The fundame ntal problem involves timetabling exams into a set of periods within a defined examination session while satisfying a number of ha rd constraint. Like other areas of timetabling, a feasible solution is one in which all the hard constraints are satisfied. The quality of the solution is measured in terms of soft constraints satisfaction. The problem consists of the following: • A list of periods covering a specified length of time. The number and length of periods are provided. • A set of exams that are to be scheduled into these periods. • For each e xam, a set of enrolled students is provided. Each student is enrolled into a number of exams. • A set of rooms with individual capacities. 1 This section is cited from T.Muller (200 7) [5], page 2. 2 • A set of additional period (e.g., exam A after exam B ) and room (exam A must use room R) hard constraints. • Soft constraints which contribute to a penalty if they are violated (including details on weightings of these constraints). A feasible timetable is one in which all examinations have a period and a room assigned and the following hard constraints are satisfied: • No student sits for more than one examination at a time. • The capacity of individual rooms is not exceeded at any time during the ex- amination session. Note that, unlike course timetabling, exams are explicitly allowed to share rooms. • Period lengths are not violated. • Additional hard constraints must be satisfied. The problem includes the following soft constraints: • Two exams in a row: The number of occurrances when students have to sit for two exams in a row on the same day. • Two exams in a day: The number of occurrances when students have to sit for two exams on the same day. • Period spread: The number of occurances when students have to sit for more than one e xam during a time interval specified by the institution. This is often used in an attempt to be as fair as possible to all students taking exams. • Mixed durations: The number of occurrances of exams timetabled into rooms along with an exam with a different duration. • Larger exams constraints: The number of l arge exams appearing in the latter portion of the timetable. De finition of large and latter portion is a part of the descriptscription of a particular instance. • Room penalty: The number of times a room is used which has an associated penalty. This is multiplied by the actual penalty as different rooms may have the different associated weightings. 3 • Period penalty: The number of times a period is used which ha s an associated penalty. This is multiplied by the actual penalty as different periods may have the different associated weightings. 1.2.2. Post Enrollment based Course Timetabling 2 The timetabling problem in this problem is intended to simulate the real world situation when students are given a choice of lectures that they wish to at- tend, and the timetable then constructed according to these choices. The problem consists of the following: • A set of events that are scheduled into 45 timeslots (5 days and 9 hours each). • A set of rooms, each of which has a specific capa city, in which the events take place. • A set of features that are satisfied by rooms and which are required by events. • A set of students who attend various different combinations of events. • A set of available timeslots for each of the events. • A set of precedence requirements that state that certain events should occur before certain others. The aim is to try and insert each of the given events into timetable (that is, assign each event to one of the rooms and one of the 45 timeslot) while obeying following hard constraints: • No students should be required to attend more than one event at the same time. • In each case, the room should be big enough for all of the attending students and should satisfy all of the features required by the event. • Only one event is put into each room in any timeslot. 2 This section is cited from T.Muller (200 7) [5], page 3-4. 4