AUTOMATED SCHEDULING OF UNIVERSITY EXAMS
E.K.Burke, D.G.Elliman, R.Weare
iIntroduction. iiiiiiiiii Timetabling is a problem that concerns every teaching institution. Every year a new timetable must be produced to take account of staff, student and course changes causing a necessarily large amount of work. Computer timetabling and administration systems do exist to ease this burden but each timetabling problem is as individual as the institution from which it originates. A generalized system, such as the one we wish to create, must take into account as many different requirements as possible. The problem, in its simplest form, is one of assigning courses or exams to periods and rooms such that either no conflicts or a minimum number of conflicts occur. By "conflicts", we mean when students or staff are scheduled to be in the same place or when a room is scheduled to be used by more than one group at the same time. Assigning courses or exams to time periods is equivalent to the graph colouring problem [6]. This is the model we use here. Also, room allocation can easily shown to be equivalent to knapsack filling. Because of this, we use a heuristic algorithm to perform the search for a timetable, this will allow us to take account of the other necessary conditions which do not directly fit into our model. The particular instance we are dealing with here is the university exam timetabling problem. Universities differ from schools in that generally, in schools, the classes are all of a similar size and rooms are sufficiently large to house any class. In universities, classes may range from four or five students up to about two hundred. Course scheduling differs from exam scheduling in that it is desirable that courses do not "student conflict" but in some cases, such a solution does not exist. This means that students would have to chose between conflicting courses. In exam scheduling no student can be assigned to two exams at once. The system we describe here may be extended to include other related timetabling problems. It is well known that the graph colouring problem is NP-complete[2]. Timetabling and the graph colouring problem were linked by Welsh and Powell[6] in 1967. It immediately follows that timetabling problems are in general NP-complete. The vertices of a graph are taken to be equivalent to exams while edges between the vertices represent conflicts. Colouring the vertices is then the same as partitioning the exams into periods, each colour representing a different period. We present a spreadsheet based system and the methods behind it as motivated by the need for automated assistance for university exam and course scheduling.
hhhhhhhhhhhhhhhhhh Dept. of Computer Science, University of Nottingham, University Park, Nottingham, NG7 2RD. e-mail:
[email protected]
ii Timetabling A iiiiiiiiii Method iiiiiii
Find A.M.I.S. Exams not fitted to a room Fit Exams into rooms
Any Exams unscheduled?
Yes
No
Figure 1 A heuristic algorithm based on graph colouring is used to split the exams up into groups which may be scheduled together. This is done one group at a time, the algorithm finding successive almost maximal independent sets (A.M.I.S.) within the graph. An independent set is a set of vertices such that none are adjacent. Once an independent set is found, another algorithm assigns each of the exams to a room as far as is possible. Any left over are used as the basis for the independent set to be used for the next period. This has the advantage that since these remaining exams are the only ones with no student-conflicts with the previous set, they will not cause any student to have to take two consecutive exams (A second order conflict). Minimizing the number of second order conflicts is a common requirement for timetabling systems. Finding Almost Maximal Independent Sets. Every period we start with the conflict-graph of the exams as yet unscheduled. The algorithm first picks a vertex of maximum degree in the graph and then successively chooses the vertex which has the most common adjacent vertices with the one already chosen. These are then merged together, repeating until all vertices are adjacent. If the graph has more than one component, this is repeated this for each component. Now, all the vertices merged together will be an almost maximal independent set and deleting this vertex leaves the conflict-graph for the next period. A
V
B
Figure 2
For instance, in figure 2, if V is the set already selected, B will be chosen before A because it has two adjacent vertices in common with V as opposed to A’s one. Fitting Exams into Rooms The previous algorithm provides us with a set of exams that may be scheduled together providing there is space to accommodate them. The next algorithm fits the exams into rooms as far as possible. With exams, it is possible for more than one to be in a room at the same time. The algorithm starts with the smallest exam, putting it in the smallest room it will fit in regardless of whether there are any other exams present. If there are now more exams in the room than it can hold, the smallest exam or group of exams is chosen that will relieve this situation and are moved into the room one bigger than the current one. If this is now full, exams are moved continuously up the list of rooms until they pop off the top. These are used at the start of the search for the next period’s exams. This is repeated with each exam in increasing size order until we have an assignment of exams to rooms and a set of exams not scheduled for the current period. By using separate algorithms, the algorithms may be customized to specific instances of the problem. For example, in exam scheduling more than one exam may be in a room at once but in course scheduling this obviously is not true so a different algorithm may be put in its place.
iThe ii Timetabling iiiiiiiiii System iiiiii A practical and useful timetabling system must, of course, be much more than just a series of algorithms. The system we envisage will be based around a spreadsheet idea with time on one axis and either classes, rooms, staff or students on the other, while windows will allow the user to view any particular part of it at once. Obviously, the more complete the system, the more useful it will be. The best being the one that incorporates all aspects of students and courses. Once the timetable has been completed, limited access may be allowed for students to see or test out possible timetables or for staff to keep track of what students are doing. Flexibility is also important, although the algorithms will produce a good attempt at a solution, inevitably there will be other factors which require small changes which are easier to effect by hand. Perhaps most important of all is the visualization, for large problems such as those the system is designed to handle, it is important to keep as much relevant information to hand as is possible. Computers are good at storing and manipulating large amounts of data very quickly but with NP-complete problems it is still often left to human intuition as to how to arrive at the best solution as no exact algorithm will run in a sensible time. The best compromise we can reach is for the computer to try to harness and develop this intuition, which in this case will probably already be based on years of timetabling experience. There are however areas where they can be used for direct advantage, for example the printing of individual timetables and general reports, these may even be automatically be posted by the system where electronic mail is widely used. They can also ensure consistency in the timetable and perform complex rescheduling operations at the touch of a button. A normal spreadsheet consists of a series of cells organized in rows and columns upon which standard form layouts maybe imposed and operations performed. In timetabling we already have a standard layout which we may use of periods vs days with lecturer, class and room linked together in each of the slots. This is a good model to use since it is already familiar to all timetablers though we aim to make the system more general. Each exam may be in any one of three states. It may be unselected, selected but not yet placed into a room or fully incorporated into the timetable. This divides our spreadsheet into three areas, the first two of which are used as feeders to the last as on the large wall mounted timetabling boards that could be and still are in some cases found in schools around the country. Each exam is represented by an icon which if selected will reveal details about the course and students, this can similarly be applied to rooms and lecturers. Each may be selected and moved between areas at will or by the invocation of one of the algorithms. In this way, it will be clearly visible which exams are left to place, also, if one is selected, the system will show which others would then cause a conflict. Conflicts may also exist in three forms, student, staff and room conflicts, indeed, the placing of a single exam may cause all three at once. Because of this it is useful to be able to see more than one "resource" at once mapped against time. If a clash is predicted then the conflicting elements may be brought up and viewed together along with any others required and the necessary moves made. The resources could of course be any element of other assignment type problems. The algorithms presented form the core of the system first selecting exams then placing those selected into rooms successively moving them through the feeder areas into the timetable. There are however still only
tools which may be used by the timetabler to speed the search for a solution. Other algorithmic tools also exist to place courses into rooms and to optimize various secondary constraints such as a preference for using fewer larger rooms instead of lots of small ones in exam scheduling. It has already been suggested that the system may be used to store other items of academic information or to possibly allow students to see possible timetables. In a University environment, where students are split into departments which are in turn split into faculties, there will be a large number of courses which only either conflict within faculty or department. Given the fact that the problem is so large and that complete knowledge by any one individual is unlikely, it may be desirable to decentralize the system with the university scheduling those that conflict between faculties, then the faculties taking responsibility for internal conflicts then the departments finishing the process off giving each as much control over their own domains as is possible. Such is easily within the scope of the system. The program is currently at the prototype stage with the algorithms running quickly and efficiently giving often optimal solutions to small test problems. Research is now directed towards developing further algorithms and to further widen the scope of the spreadsheet, possibly using probablistic search techniques to optimize several criteria relative to each other, criteria which may be chosen by the scheduler.
iiiiiiiii References [1]
DUTTON R.D. and BRIGHAM R.C. (1981) A New Graph Coloring Algorithm Comp. Jrnl. 24, 8586.
[2]
KARP R.M. (1972) Reducibility among Combinatorial Problems In Complexity of Computer Computations Plenum Press, New York.
[3]
MATHAISEL D.F.X. and COMMC.L. (1991) Course and classroom scheduling : An interactive computer graphics approach Jrnl. Sys. Software 15, 149-157.
[4]
SABIN G.C.W. and WINTER G.K. (1986) The Impact of Automated Timetabling on Universities A Case Study Jrnl. Opl. Res. Soc. 37, 689-693.
[5]
TEHRANI A. (1975) Un Algorithme de Coloration Cahiers du centre d’e´tudes do Recherche Ope´rationnelle" "17," "395-398."
[6]
WELSH D.J.A. and POWELL M.B. (1967) An Upper Bound for the Chromatic Number of a Graph and Its Application to Timetabling Problems Comp. Jrnl."10, 85-86.