An Optimization Model for Scheduling Classes in a Business School Department Robert Saltzman San Francisco State University, San Francisco, CA This article describes how an optimization model has been used recently to more effectively schedule classes in an average-sized business school department. Each semester this department offers approximately 46 classes taught by 20 different instructors in one of 32 time slots. A myriad of constraints must be satisfied while trying to maximize faculty preferences for courses and teaching times. Using the model has reduced the time needed to generate high-quality schedules from more than a day to less than three hours, and kept our schedule within the department s allocated time slots, eliminating the need for staff to find additional rooms. I. INTRODUCTION The Decision Sciences (DS) department is one of eight academic departments within the College of Business (COB) at San Francisco State University (SFSU). One of the main recurring duties of department chairs at SFSU and most other universities is to schedule their department s classes and assign faculty members to teach them. Historically, class scheduling at SFSU has been done one semester ahead of time, i.e., planning for courses to be offered in the next semester has occurred early in the current semester. Recently, though, SFSU administrators decided to schedule two semesters ahead of time to give students greater ability to plan their future coursework. This has proven difficult for chairs to satisfactorily accomplish due to the inherent uncertainty in the process (e.g., budgetary concerns and personnel availability), as well as the time-consuming nature of the scheduling task. As a compromise, chairs were asked to tentatively schedule Spring 2009 classes during July 2008 (rather than during Spring 2008), and to finalize the Spring 2009 schedule in October 2008. At present, it is unclear how far in advance chairs will be asked to provide schedules for the Fall 2009 semester. To initiate the scheduling process for a given semester, the central SFSU administration provides each department chair with a block allocation or set of openings at various times of the day and week called time slots or blocks during which courses may be offered on the main campus. Familiar blocks include the 9:10-10:00 AM slot on Mondays, Wednesdays and Fridays (abbreviated here as MWF0910 ) and the 12:35-13:50 PM slot on Tuesdays and Thursdays ( TTH1235 ). Cells B2:W3 of Figure 1 show all the standard blocks used on the main campus for the Spring 2009 semester. While department chairs in the COB are supposed to fit all of their undergraduate classes into these blocks, many end up offering a significant number of classes either in excess of their allocation (referred to as out of allotment ) or during non-standard blocks such as the two shown in cells X2:Y3 of Figure 1. In doing so, chairs create problems for staff and administrators (e.g., a shortage of rooms in which to house classes during standard blocks), as well as for students (e.g., conflicting times for classes and final exams). Class scheduling in the COB became further complicated in January 2007 by the relocation of all graduate business programs to a new downtown campus (DTC) situated Volume 7, Number 1, pp 84-92 California Journal of Operations Management 2009 CSU-POM
FIGURE 1: INSTRUCTOR PREFERENCES FOR BLOCKS IN SPRING 2009 approximately nine miles away from the main SFSU campus where undergraduate classes are held. In any semester, roughly half of the college s faculty members teach at both campuses. The COB Associate Dean provides each department chair with a block allocation for classes held at the DTC (see blocks in cells Z2:AG3 of Figure 1). Thus, department chairs must consider who s teaching in which program, and allow sufficient time to travel from one campus to another. Although possible to get from one campus to another in under an hour on public transportation, DS faculty requested a minimum of two hours between the end of a class taught on one campus and the beginning of the next class taught at the other campus to allow for transit breakdowns, heavy automobile traffic, student interaction, eating, and so on. Shortly after becoming department chair in August 2007, I needed to make some adjustments to the Spring 2008 schedule planned by the previous chair to account for recent work load changes for a few faculty members. Satisfactorily adjusting or rescheduling the existing Spring 2008 schedule was more difficult than I had anticipated. Soon thereafter, in October 2007, it was time to plan the Fall 2008 schedule from scratch. Based on guidelines given to me by my predecessor, such as how many sections of each course to offer and how many to offer at night, I began to manually plan out the Fall 2008 schedule and was immediately struck by the extraordinary number of factors that had to be considered to develop a good, feasible schedule. Even though our department offers only about 45 classes per semester, it took me at least a full day to prepare the initial schedule. Knowing that I d need to undertake scheduling and rescheduling tasks regularly during my tenure as department chair, I began to think about how these tasks might be formulated as a mathematical program and solved efficiently on a computer. 85
II. LITERATURE REVIEW The literature contains a wealth of articles that have examined variations of the class scheduling or timetabling problem, as documented in Schmidt and Strohlein (1980) and in Schaerf (1999), who subdivided the field into three categories: (1) school, (2) university course, and (3) exam timetabling problems. The problem analyzed here clearly falls into the second category because it addresses how a department chair at a university can appropriately assign instructors to teach courses during specific blocks. Some researchers, e.g., Deris, Omatu and Ohta (2000), have focused on heuristic algorithms to solve problems in the second category, while others, e.g., Burke and Petrovic (2002), have developed heuristics and metaheuristics to address problems in the third category. Dimopoulou and Miliotis (2001) addressed problems in both categories with a two-stage PC-based system; however, in the course scheduling stage of their system, they assigned courses to time slots and rooms, but did not consider instructors. Foulds and Johnson (2000) developed a decision support system to aid experienced timetablers at each stage of the process by pointing out scheduling conflicts, suggesting alternatives, and presenting a variety of reports. Shih and Sullivan (1977) used binary integer programming models first to assign courses to instructors, and then to assign courses to time slots, in each of possibly several terms. However, they reported no computational results on the second model, and apparently never implemented their work. Nonetheless, their relatively small models do share some common features with that reported here, such as a desire to maximize instructor preferences for courses and time slots. Ferland and Fleurent (1994) developed a decision support system for course scheduling when student registrations for courses are already known (not the case at SFSU). Their course scheduling process aims to reduce conflicts for students, instructors and rooms, e.g., when a common group of students needs to take two classes held at the same time. Likewise, Hinkin and Thompson (2002) helped eliminate problems such as conflicts among required core courses and among electives, as well as the use of non-standard time blocks. They took many factors into account, including room capacity, room features and building utilization (not a departmental concern at SFSU). Solving their large, nonlinear problem required the use of a simulated annealing (heuristic) algorithm, which took more than a year to develop fully. Once COB chairs have determined their own departmental schedules, the central SFSU administration takes the next step of assigning classes to classrooms, an important related problem addressed by Glassey and Mizrach (1986). Martin (2004) solved a mixed integer LP model to not only assign instructors to courses and time slots, but also to assign these to classrooms, for the entire College of Business at Ohio University. Our model and Martin s also have some features in common, such as concern for back-to-back teaching assignments and special course sets. Though more ambitious in scope, Martin s formulation is (surprisingly) smaller than ours in terms of number of variables and constraints. This article concentrates more on the formulation and unusual aspects of our class scheduling problem, which may be relevant for academic departments with similar characteristics. In particular, I address scheduling issues faced by an average-sized academic department that operates within the confines of a large business school, which itself is part of a large state university. The problem s formulation leads to an optimization model that is medium-sized by today s standards more than 8,300 binary variables and 10,000 constraints one not readily formulated or solved with Microsoft Excel. The problem has been successfully tackled with a widelyavailable software package (not specially-written 86
code) that can be adapted easily by others willing to use this or other similar optimization package. Since the model reads in several data files from Excel, much of the model maintenance can be done within the familiar environment of Excel. With both a linear objective function and linear constraints, the model solves quickly, allowing for fast experimentation. To date, the model has been used twice; over time, further refinements may be made as more experience is gained. III. PROBLEM DEFINITION AND MODEL FORMULATION The purpose of the DS class scheduling problem is to optimally assign a group of DS instructors to teach an array of DS courses during a set of standard time slots. Assignments must satisfy numerous constraints while maximizing the instructors collective preferences for courses and time blocks. The problem was formulated as an integer linear programming model and solved with OPL Studio 3.5 (ILOG 2001), an optimization package whose main features are reviewed by Skiscim (2001). In an OPL (Optimization Programming Language) model, one can combine elements of traditional mathematical programming with those of constraint programming, if desired. Lustig and Puget (2001) give a brief tutorial on constraint programming and how it complements the features of mathematical programming. The main components of any OPL model are its sets, variables, constraints and objective function, each of which is now described. Sets, which help make the model easier and more compact to specify, and the output more legible, include the names of the department s instructors, courses, and available blocks. In particular, the following indices and main sets are used in the model. i ε Instructor = {Azoury, Cholette,, Wing} c ε Course = {DS110, DS212,, BUS786} b ε Block={MWF0810, MWF0910,,TH1900} The model also employs a number of subsets of these main sets in various situations, such as CourseUG (CourseGR), a set containing only the undergraduate (graduate) courses. Another useful subset is InstructorTTT, a list of only the tenured/tenure track faculty. Other subsets will be introduced as the constraints are described below. The model s decisions variables are a set of binary variables {X i,c,b }, where X i,c,b = 1, if instructor i is assigned to teach course c during block b, and X i,c,b = 0, otherwise, for all i ε Instructor, all c ε Course, and all b ε Block. In planning for the Spring 2009 semester, for example, there were 20 instructors, 13 distinct courses (several of which are multi-section) and 32 blocks, leading a total of 8,320 decision variables. Feasible schedules must satisfy a large number constraints and sets of constraints. The first type of constraint requires that our department offer multiple sections of certain core business classes such as DS 412 (Operations Management): 12 i b X i,ds412,b 14. Similar constraints, with different upper and lower bounds, are required for the other multi-section courses, namely, DS 212, DS 411, DS 412, BUS 786 and BUS 856. An obvious requirement of any feasible schedule is that instructors teach at most one course per block: c X i,c,b 1, for all i ε Instructor and b ε Block. Several pre-assignments (Schaerf 1999) are needed to impose specific instructorcourse-block combinations. For example, Professor Eng is preassigned to teach an intermediate statistics course, DS 312, which is her specialty: b X Eng,DS312,b = 1. In this example, the block is not preassigned. Other decision variables can be preassigned to zero by recognizing that undergraduate courses cannot be offered during 87
graduate blocks, and graduate courses cannot be offered during undergraduate blocks: X i,c,b = 0, for all i ε Instructor, c ε CourseUG, b ε BlockGR, and X i,c,b = 0, for all i ε Instructor, c ε CourseGR, b ε BlockUG, where BlockUG (BlockGR) is the set of all undergraduate (graduate) blocks. As stated in the introduction, the number of undergraduate courses must not exceed the block allocations set by the administration; likewise, the number of graduate courses offered at the DTC cannot exceed the allocations set by the COB Associate Dean: i ccourseug X i,c,b AllocationUG b, for all b ε BlockUG, and i ccoursegr X i,c,b AllocationGR b, for all b ε BlockGR, where AllocationUG b and AllocationGR b are the maximum number of undergraduate and graduate sections, respectively, that the department may offer during block b. To serve students who work during the day, we endeavor to offer sections of some undergraduate courses, such as DS 212, at night: 1 i bblocknight X i,ds212,b 3. Similar constraints, with potentially different upper bounds, are in place for the undergraduate core courses DS 110 and DS 412. Night-time sections of some courses, such as DS 110, should be offered on different nights to give non-traditional students the most chance to take the course: i X i,ds110,b 1, for all b ε BlockNight. Similar constraints exist for evening sections of DS 212, DS 412, DS 856 and BUS 786. Some undergraduate concentration courses, such as DS 312 and DS 601, ought to be taught on different nights so that DS majors can take both courses in the same semester, if desired: i (X i,ds312,b + X i,ds601,b ) 1, for all b ε BlockNight. Faculty-Oriented Constraints First, a set of constraints is needed to enforce faculty teaching loads: c b X i,c,b = Load i, for all i ε Instructor, where Load i is the number of classes instructor i is supposed to teach in the semester. In the DS department the typical load is three classes per semester for full-time faculty, and one or two for part-time lecturers. The model also contains constraints that improve the overall quality of life for the faculty. For instance, to reduce monotony, no tenured/tenure track instructor is asked to teach three sections of the same course: b X i,c,b 2, for all i InstructorTTT, c ε Course. DS faculty members often one night class per week, but never more than two: c bblocknight X i,c,b 2, for all i ε Instructor. Good, coherent schedules (Burke and Petrovic, 2002, p. 267) avoid requiring instructors to teach classes on both MWF and TTH: c (X i,c,b1 + X i,c,b2 ) 1, for all i ε Instructor, b 1 ε BlocksMWF, b 2 ε BlocksTTH. Travel Time Considerations Sufficient time must be allowed for instructors to travel from the main campus to the DTC. For example, an instructor who teaches a graduate class at the DTC on Mondays at 1400 must not be assigned a class on the main campus on Mondays that finishes after 1200: c (X i,c,b + X i,c,m1400 ) 1, for all i ε Instructor, b ε MBEA1200, where MBEA1200 is the set of blocks ending after 1200 on Monday on the main campus, i.e., 88
{MWF1210, MWF1310, MWF1410, MWF1510, M1610, MW1410, MW1535, M1900}. The model contains a related constraint set to allow an instructor at least two hours to get from the main campus to the DTC for a class that starts at 1830 on Monday. Similar constraint sets are in place for the other days of the week. All told, the model used to plan the Spring 2009 schedule included more than 10,000 constraints. The Objective Function The DS class scheduling problem s objective function is to maximize instructors total preferences for the courses assigned to them and the blocks during which these courses are offered, along with terms that try to keep multiple sections of one course taught by an instructor close together. In particular, the weighted linear objective function contains four components: w 1 CoursePrefs + w 2 BlockPrefs + w 3 TotalProxMWF + w 4 TotalProxTTH, where user-adjustable weights w 1, w 2, w 3, and w 4 reflect the relative importance of the associated quantities. The first two terms each require a distinct set of input data. One input is a matrix of instructor course preferences (ICP), while the other is a matrix consisting of instructor block preferences (IBP). Prior to developing the schedule, DS instructors are asked to provide positive integer weights summing to 10 for two or more courses that they wish to teach. The greater instructor i s preference for teaching course c, the higher the weight ICP i,c. The term CoursePrefs is calculated as i c b ICP i,c X i,c,b. Before the schedule is developed, DS faculty are also asked to submit a list of hard and soft constraints regarding their availability and preferences for teaching at specific times, which I then translate into primarily ones and zeros (see Figure 1). In particular, IBP i,b is the preference value of instructor i for teaching during block b. If an instructor has an especially strong affinity for or aversion to a particular block, IBP i,b can be further adjusted up or down. While most instructors prefer to teach on a TTH schedule rather than a MWF schedule, some DS courses simply must be offered on MWF to make better use of our allocated blocks and to give students more options. Consequently, we ve devised a rotation system to achieve this in a balanced way over time. Instructors whose turn it is to teach on MWF are given values of 1 for the MWF blocks, and 0s for the TTH blocks, while the opposite is true for those instructors who need not teach on MWF. The term BlockPrefs is found as i c b IBP i,b X i,c,b. DS department tenure/tenure-track faculty members typically teach two sections of a core undergraduate class, and a third class for either graduate or undergraduate students each semester. In such cases, instructors almost always wish to teach two sections of the same core course back-to-back, i.e., in consecutive blocks such as TTH0935 and TTH1100. One way to achieve back-to-back course assignments is by adding a series of hard constraints, as in Shih and Sullivan (1977). I chose to treat this desire as a soft constraint and try to satisfy it by incorporating appropriate terms into the objective function. Note that an instructor has been assigned to teach during two blocks b 1 and b 2 if the value of X i,c,b1 X i,c,b2 is one. However, this nonlinear approach cannot be handled by my version of OPL Studio, so I developed an additive linear approach involving (X i,c,b1 +X i,c,b2 ). This required finding two matrices ProxMWF (the proximity of MWF blocks) and ProxTTH (the proximity of TTH blocks) such that the quantities TotalProxMFW and TotalProxTTH increase when an instructor is assigned to teach during consecutive blocks and decrease when assigned to teach during nonconsecutive blocks. Determining appropriate elements for these matrices is itself an interesting problem, but will not be covered here. The terms measuring proximity of assigned courses are: 89
TotalProxMWF = i c b1 BlocksMWF b2 BlocksMWF (X i,c,b1 +X i,c,b2 )ProxMWF b1,b 2, and TotalProxTTH = i c b1 BlocksTTH b2 BlocksTTH (X i,c,b1 +X i,c,b2 )ProxTTH b1,b 2. While this linear approach works reasonably well and helps to model to solve quickly, it sometimes leads to schedules in which an instructor s two core class sections are not back-to-back. Fortunately, it is usually not difficult to manually interchange courses or instructors to achieve back-to-back classes for all instructors who desire it. To briefly summarize, the DS class scheduling problem can be formulated as a fairly large assignment-type integer linear program, which is highly constrained. The only substantial assumption made is that all required data must be placed in spreadsheet files prior to model execution. In particular, the model reads in lists of the blocks, instructors, and courses involved in the upcoming semester s schedule, along with instructor course loads; block allocation quantities for all undergraduate and graduate blocks; and course and block preference information from instructors. IV. RESULTS An OPL script was written to run the DS class scheduling model and format the resulting schedule by course and by instructor (e.g., see Figure 2 below). Model output also shows the number of sections of each course offered and how the usage of blocks compares to the department s allocation. Some of this output is copied into Excel and given to the department FIGURE 2: THE OUTPUT SPRING 2009 SCHEDULE, BY INSTRUCTOR Instructor Course Block Instructor Course Block AZOURY DS212 MWF1010 ROEDER DS408 TH1900 AZOURY DS212 MWF1110 ROEDER DS411 TTH0935 AZOURY DS411 W1610 SALTZMAN DS851 W1830 CHOLETTE DS412 TTH0810 UDAYABHANU DS412 TTH1100 CHOLETTE DS412 TTH0935 UDAYABHANU DS412 TTH1235 CHOLETTE DS856 W1830 UDAYABHANU BUS786 W1400 ELIMAM DS412 T1900 Carter DS110 T1535 ELIMAM DS412 TTH1410 Carter DS110 TH1535 ELIMAM DS856 TH1830 Chan DS212 M1900 ENG DS212 TTH0935 Danko DS712 W1830 ENG DS212 TTH1100 Danko DS712 TH1830 ENG DS853 M1830 Klimkovskaia DS212 TTH0810 MEHROTRA DS624 M1900 Klimkovskaia DS212 TTH0935 MEHROTRA DS854 T1830 Lee DS212 TH1900 MIYAOKA DS412 MWF1210 Rainaldi DS710 T1830 MIYAOKA DS412 MWF1110 Sepah DS412 TH1900 MIYAOKA DS604 W1900 Shibuya DS110 T1900 OZLUK DS412 TTH1100 Shibuya DS710 M1830 OZLUK DS412 TTH1235 Wing DS110 MWF0810 OZLUK DS212 T1900 Wing DS110 MWF0910 OZSEN DS412 TTH1235 Wing DS110 MWF1010 OZSEN DS412 TTH1410 Wing DS110 MWF1110 OZSEN BUS786 T1830 Wing DS110 MWF1210 90
office manager in a format she prefers for input to the university s scheduling system. The model was first run on the Fall 2008 schedule, even though I had already planned that semester s schedule out manually, in order to test the quality of the model s solutions and make improvements to the model. The Spring 2009 schedule was planned primarily by running the model, with only a few manual adjustments made later. Because the model generally solves in less than 30 seconds on a Dell Inspiron 6400 laptop, several schedules can be tried out quickly with, say, alternate course preference values. For instance, I can try to modify the schedule for a particular junior faculty member by changing his or her preference values (or someone else s) for a specific course. All told, preparing this schedule took less than three hours, including data entry and making minor changes to the Fall 2008 model. As more experienced is gained with the process, it may take even less time to prepare a high-quality schedule in the future. Besides reducing the time required to generate high-quality schedules, running the model has had other benefits. First, it has kept our schedule completely within the department s block allocation (a claim not many other departments can make), eliminating the need for staff to spend time looking for additional rooms to accommodate our classes. Second, it s made the scheduling process more transparent to DS faculty, who now better appreciate how difficult it really is to develop a feasible schedule. They may even perceive the scheduling process as more objective and fair than the previous manual approach. V. CONCLUSION AND FUTURE WORK One possible area to investigate further is whether or not a nonlinear objective function (a more natural choice to ensure back-to-back assignments of courses) would actually improve the quality of the schedules found. If I had a nonlinear solver, I could determine whether or not the improvement is worth the longer computational time most-likely required. Perhaps more importantly, much greater effort would be required to get this planning tool adopted by other departments within the COB or elsewhere who face issues similar to those of the Decision Sciences department. I have found that the other COB department chairs have devised their own manual processes to plan their schedules, with at least one making limited use of Excel to partially check the feasibility of their schedules. However, getting other chairs to actually adopt an optimization-based approach such as the one presented here would be a major challenge for several reasons: (1) they don t understand or trust mathematical models; (2) they can t afford to buy an expensive software package such as OPL Studio; (3) they fear losing control of the scheduling process; and/or (4) they prefer not to share the details of their scheduling process with someone outside of their own department. In the future, it would also be desirable to examine the rescheduling problem, i.e., how to alter an existing schedule after something has changed, such as a tenured or tenure-track faculty member being awarded a sabbatical or a course release late in the planning cycle. What is the best way to repair the current schedule so as to minimize changes from the current schedule? Should change be defined in terms of the number of instructors whose schedule changes, the number of classes that are assigned to a different instructor or block, or some other measure? The answer may depend on whether the rescheduling is done before or after students have registered for classes, and will likely require considerable discussion and experimentation. VI. REFERENCES Burke, E. K., and S. Petrovic, Recent Research Directions in Automated Timetabling, European Journal of Operational Research, Vol. 140 (2), 2002, 266-280. 91
Deris, S., Omatu, S., and H. Ohta, Timetable Planning Using the Constraint-Based Reasoning, Computers and Operations Research, Vol. 27 (9), 2000, 819-840. Dimopoulou, M. and P. Miliotis, Implementation of a University Course and Examination Timetabling System, European Journal of Operational Research, Vol. 130 (1), 2001, 202-213. Ferland, J. A. and C. Fleurent, SAPHIR: A Decision Support System for Course Scheduling, Interfaces, Vol. 24 (2), 1994, 105-115. Foulds, L. R. and D. G. Johnson, SlotManager: A Microcomputer-Based Decision Support System for University Timetabling, Decision Support Systems, Vol. 27 (4), 2000, 367-381. Glassey, C. R. and M. Mizrach, A Decision Support System for Assigning Classes to Rooms, Interfaces, Vol. 16 (5), 1986, 92-100. Hinkin, T. R. and G. M. Thompson, SchedulExpert: Scheduling Courses in the Cornell University School of Hotel Administration, Interfaces, Vol. 32 (6), 2002, 45-57. ILOG, ILOG OPL Studio 3.5 User s Manual, ILOG, Gentilly, France, 2001. Lustig, I. and Puget, J., Program Does Not Equal Program: Constraint Programming and its Relationship to Mathematical Programming, Interfaces, Vol. 31 (6), 2001, 29-53. Martin, C. H., Ohio University s College of Business Uses Integer Programming to Schedule Classes, Interfaces, Vol. 34 (6), 2004, 460-465. Schaerf, A., A Survey of Automated Timetabling, Artificial Intelligence Review, Vol. 13 (2), 1999, 87-127. Schmidt, G. and T. Strohlein, Timetable Construction - An Annotated Bibliography, The Computer Journal, Vol. 23 (4), 1980, 307-316. Shih, W. and J. Sullivan, Dynamic Course Scheduling for College Faculty via Zero-One Programming, Decision Sciences, Vol. 8 (4), 1977, 711-721. Skiscim, C., OPL Studio 3.1, OR/MS Today, Vol. 28 (2), 2001, 70-72. 92