Presentation is loading. Please wait.

Presentation is loading. Please wait.

Optimizing Exam Schedules at Oklahoma State University

Similar presentations


Presentation on theme: "Optimizing Exam Schedules at Oklahoma State University"— Presentation transcript:

1 Optimizing Exam Schedules at Oklahoma State University
Thu Nguyen Oklahoma State University

2 SAS Programs and ProcedureS
Optimizing Exam Schedules at Oklahoma State University Thu Nguyen Oklahoma State University ABSTRACT OPTIMIZATION MODEL Oklahoma State University (OSU) schedules hundreds of exams according to the exams’ preferred times, preferred locations and the availability of rooms on campus. These requirements may change every semester. Manual scheduling is time consuming, which calls for an automation that allows non-programmer users to conveniently alter the inputs without changing the codes. The results need to be user-friendly so that a staff can determine if further adjustments are needed. This poster demonstrates a program that automatically extracts the inputs from a spreadsheet entered by users, automatically manipulates and feeds these inputs into an optimization model to produce optimized schedules. The results are then visualized using two dashboards. The employed techniques and software are SAS® macro programs, SAS/OR® PROC OPTMODEL, and SASViya® (SAS Visual Analytics). The benefits of this approach are: encouraging adoption from giving users more control over the program and minimizing data incompatibility issues as the datasets are moving solely between SAS products. The model’s objective is to maximize all exams’ assignment preferences by assigning exams to the room-time combinations with the highest preference weights. If a certain exam (i) is scheduled in a certain room (k) during a certain time block (j), the decision variable Assignment[i, j , k] is 1. Otherwise, it is 0. There are three fixed constraints (hard constraints). There are four types of user-defined (UD) constraints. Each UD constraint can be altered, add, or deleted over time and is exam-specific. Users can enter any of the four types in the Excel sheet presented in Table 1. The four UD constraint types are: room requirement, time requirement, room-time combination requirement, and proximity to other exams. These types are deduced from an analysis on OSU’s needs. Click here to see the details and programming codes of the model’s variables, objectives and constraints. DATA DESCRIPTION SAS Programs and ProcedureS The program proposed by this poster (referred to as the program) has two input datasets that contain the exams’ enrollment data and rooms’ capacity information. The program uses a third dataset that indicates how preferable each room-time combination is to each exam. These preferences are represented by the preference weights (i.e. the higher the more preferable). A user can adjust the general, time, room, and building preferences in this dataset or let the system assign these weights automatically. The last input source is from a data table imported from an Excel sheet. In this spreadsheet, a user can define the constraints specific to each exam and the exam(s) that the constraints are applied to. Table 1: User-Defined Excel Sheet Sample. Click here to see more details. A user will key in the desired time parameters (startT, endT, startD, endD, and blockD) which define the time period the user wishes to schedule the exams in and execute the main macro. A sample code line calling for execution is written as: %Macro Main (startT='12:00't, endT='16:00't, startD='7May2018’d, endD='11May2018'd, blockD='4:00’t); The main macro then calls other macros that create the input datasets, automatically create the user-defined constraint code lines, and automatically execute the procedure OPTMODEL with MIXLP solver option to produce a dataset containing the optimized schedules. Click here to see the codes used to create the automatic scripts and the procedure OPTMODEL. The resulting dataset from the model is joined back with the source files to obtain more information. Two dashboards are updated using this dataset to visualize the results. Exam1 ID Negative Req Req Category Exam2 ID Time Date Room ID 1 no locate in 9 2 at 12:00 5/11/2018 20 not locate next to 21

3 Result Visualization with SAS Viya – SAS Visual Analytics
Optimizing Exam Schedules at Oklahoma State University Thu Nguyen Oklahoma State University Result Visualization with SAS Viya – SAS Visual Analytics Solution Performance Exam Information Dashboard This dashboard shows the exam schedules in a calendar-like format. Users can see the overall schedules as in Figure 1 or drill down to certain exams as in Figure 2 by changing the options on the right panels. In this view, users can quickly identify issues, such as most exams are scheduled on May 8, Users can assess whether this is a desirable and may add a constraint or change a preference weight to avoid this assignment. The program executes much faster comparing to the old manual process. To schedule 83 classes into 40 rooms during 10 time blocks with 10 user-defined constraints, the main macro executes in under 15 minutes. With this project, the model has optimized 33,200 decision variables, which would be difficult for manual processing. Figure 1: All Schedules Figure 2: Drilled down. Click here to enlarge. references Rooms’ Utility Dashboard The bar shows the percentage of time a room is occupied while the line shows the room’s seat utilization rate, which measures whether the room is used for exams with enrollment appropriate for its capacity. Clicking on any department in Figure 3 will generate the drilled down view on each building (Figure 4) or each room (not shown). Users can identify rooms that are under or over utilized during a specific time by selecting the options on the left side panel and use this information to adjust the preferences on each room accordingly. SAS Institute Inc SAS/OR® 13.2 User’s Guide: Mathematical Programming. Cary, NC: SAS Institute Inc. Figure 3: Department View Figure 4: Building View. Click here to enlarge.

4 Table 1: User-Defined Excel Sheet Sample
Optimizing Exam Schedules at Oklahoma State University Enlarged Tables and Figures Thu Nguyen Table 1: User-Defined Excel Sheet Sample In this example, the user has defined three constraints: the first prohibits exam1 to locate in room9, the second prohibits exam2 to be at 12pm on May 11th, and the last prevents exam20 and exam21 to locate next to each other. Click here to return to the previous page. Exam1 ID Negative Req Req Category Exam2 ID Time Date Room ID 1 no locate in 9 2 at 12:00 5/11/2018 20 not locate next to 21

5 Optimizing Exam Schedules at Oklahoma State University Enlarged Tables and Figures Thu Nguyen
FIGURE 1: ALL EXAMS’ DETAILS FIGURE 2: DRILLED DOWN TO SPECIFIC EXAMS Click here to return to the previous page.

6 FIGURE 3: DEPARTMENT VIEW
Optimizing Exam Schedules at Oklahoma State University Enlarged Tables and Figures Thu Nguyen FIGURE 3: DEPARTMENT VIEW FIGURE 4: BUILDING VIEW Click here to return to the previous page.

7 Optimizing Exam Schedules at Oklahoma State University Details and Programming Codes of the Variables, Objectives, and Constraints Thu Nguyen Decision Variables User-Defined Constraints var Assignment {exams, times, rooms} binary; Type 1: An exam (i1) must be in a certain room (k1) but can be at any time (any j) (function 1). The negative version of this type is: an exam (i2) cannot be in a certain room (k2) at any time (any j) (function 2). Objective Function Function 1: con locCon: sum{j in times} Assignment[i1,j,k1] = 1; max TotalPreference = sum {i in exams, j in times, k in rooms} Function 2: con locCon: sum{j in times} Assignment[i2,j,k2] = 0; Preference[i,j,k] * Assignment[i,j,k]; Type 2: An exam (i1) must be at a certain time (j1) but can be in any room (any k) (function 3). The negative version is: an exam (i2) cannot be at a certain time (j2) regardless of its location (any k) (function 4). Constraint Functions Function 3: con timCon: sum{k in rooms} Assignment[i1,j1,k] = 1; Model Required (MR) Constraints Function 4: con timCon: sum{k in rooms} Assignment[i2,j2,k] = 0; MR constraint 1: An exam can only be assigned to rooms that have at least as many seats as the exam’s enrollment. Type 3: An exam (i1) must be in a certain room (k1) and at a certain time (j1) (function 5). The negative version is: an exam (i2) must not be in a certain room (k2) and not at a certain time (j2) (function 6). con req_cap {i in exams, k in rooms, j in times}: enrollment[i] * Assignment[i,j,k] <= capacity[k]; Function 5: fix Assignment[i1,j1,k1] = 1; Function 6: fix Assignment[i2,j2,k2] = 0; MR constraint 2: An exam is assigned to precisely one room and one time block. con req_exam {i in exams}: Type 4: An exam (i1) must not be located next to another exam (i2) if the two exams are scheduled at the same times. As rooms with adjacent IDs are next to each other, if exam i1 is assigned to room k, exam i2 must not be assigned to room k+1. sum {j in times, k in rooms} Assignment[i,j,k] = 1; MR constraint 3: Each room can host at most one exam during a time block. con nextCon {j in times, k in rooms: k < &Rcount}: con req_room {k in rooms, j in times}: Assignment[i1,j,k] + Assignment[i2,j,k+1]+ Assignment[i2,j,k] + Assignment[i1,j,k+1]<=1; sum {i in exams} Assignment[i,j,k] <= 1; Click here to return to the previous page.

8 Optimizing Exam Schedules at Oklahoma State University Codes Used to Create the Automatic Scripts and Procedure OPTMODEL Thu Nguyen Macro Creating Users-defined Code Lines /* Declare the model */ This macro checks if any of the three user-defined constraint types is specified in the Excel spreadsheet. If there is any, it calls the appropriate macro to process that constraint type. Then, it compiles the UserDefined macro that generates the scripts for existing user-defined constraints within the PROC OPTMODEL. var Assignment {exams, times, rooms} binary; /* Objective function */ max TotalPreference = sum {i in exams, j in times, k in rooms} Macro UserDefined preference [i,j,k] * Assignment[i,j,k]; %macro userdefined; /* If type 1 exists, write the macro variables with type 1 code lines */ /* Model-required constraint type 1 */ /* &LocCnt is the count of type 1 constraint(s) */ con req_cap {i in exams, k in rooms, j in times}: /* &&locCon&i is the macro that holds the code lines that defines each type 1 constraint */ enrollment[i] * Assignment[i,j,k] <= capacity[k]; %if &LocCnt ne 0 %then %do; /* Model-required constraint type 2 */ %Do i = 1 %to &LocCnt; con req_exam {i in exams}: &&locCon&i; sum {j in times, k in rooms} Assignment[i,j,k] = 1; %end; /* Model-required constraint type 3 */ / * Codes for other types are not shown* / con req_room {k in rooms, j in times}: sum {i in exams} Assignment[i,j,k] <= 1; %mend userdefined; /* User-defiend constraints code lines generated by macro UserDefined*/ Macro Executing the Optimization Model using PROC OPTMODEL %UserDefined; %Macro OptimizationModel; proc optmodel; /* Solve with Mix Integer LP algorithm */ solve with MILP; /* Declare index sets */ set exams; /* Write results into dataset solution*/ set <str> times; create data solution set rooms; from [exam time room] = {i in exams, j in times, k in rooms} assigned=Assignment; /* Declare parameters */ quit; num preference {exams, times, rooms}; %mend OptimizationModel; num enrollment {exams} init 0; Click here to return to the previous page. num capacity {rooms} init 0; /* Read the dataset of times – codes not shown */

9 Name: Thu Nguyen


Download ppt "Optimizing Exam Schedules at Oklahoma State University"

Similar presentations


Ads by Google