230 likes | 403 Views
Approximate Solution to an Exam Timetabling Problem. Adam White Dept of Computing Science University of Alberta. Combining Constraint Programming and Simulated Annealing on University ExamTimetableing Tuan-Anh Duong and Kim-Hoa Lam
E N D
Approximate Solution to an Exam Timetabling Problem Adam White Dept of Computing Science University of Alberta
Combining Constraint Programming and Simulated Annealing on University ExamTimetableing Tuan-Anh Duong and Kim-Hoa Lam International Conference for frenchspeaking and vietnemesse computer scientisits - 2004
Outline • Introduction • Problem • Motivation • Related Work • Two Phase Algorithm • Constraint Programming • Simulated Annealing • Results • Contribution • Future Work
Problem • Shedule a number of exams in a given set of time slots • Students are divided into subgroups • Hard Constraints • No student has 2 exams at one time • No more than 2 exams in one room • Worst possible solution • But still acceptable
Problem… • Soft Constraints • Student’s exams spread • Student subgroups have exams in near rooms • Some exams start after & end before regular • Room utilization is maximized • Some exams should be in special rooms • Improve the quality of the solution
Motivation • Exam scheduling is NP-Complete • Have a variety of courses and fields • Problem solved: • Chi Minh City University of Technology(China) • 100,000 students • 320 exams • 2.5 week period • More close to home • University of Alberta • > 35,000 students • > 90 buildings • Number of exams???
Solution Methods • Constraint programming • Constraint Logic programming - CHIP • Constraint Logic programming - ECLiPSe • Local repair - Constraint Satisfaction Problem • Tabu Search • 2 lists - 1 normal, 1 for most moved exams • Single list, exams stay in for random time • Genetic Algorithms • Automated timetabling
Approach • Two Phase algorithm • Solve hard constraints using Constraint Programming(CP) • Satisfy as much as possible soft constraints using Simulated Annealing(SA) • Optimization problem • Solution from CP is used as an initial solution for SA algorithm • In practice…very important • Solved - assigning sessions to exams • Not Solved - assigning student groups to exams
Phase I: Constraint Programming • Backtracking with forward checking(BTFC) • Consistency technique & chronological backtracking • Consistency: Arch-consistency • Pairs of yet initialized variables & instantiated vairables • Value assigned to current variable • Q: Any variable in domain of future variable conflicts? • A: remove from domain
CP… • Chronological: • Variable ordering heuristic or Value ordering heuristic • Value order: selection of next variable • Dynamic variable ordering • Select smallest number of values in current domain • Variable ordering: order of exams scheduled • Priorety scores for exams • Order based on remaining domain size(# students)
Simulated Annealing • Analogy: metal cools and freezes into a minimum energy crystalline structure • search for a minimum in a system
Phase II: SA s0, t0 > 0, loop until loop until select s in N(s0) ramdomly = cost(s) - cost(s0) if < 0 then s0 = s else x = rand(0,1) if x < e(- /t) then s0 = s end if until count = max t = (t) until stop criteria
SA … • s0 - initial solution • t0 - initial temperature • - temperature reduction function • N(s) - neighborhood of s • cost(s) - cost of a solution • What we are minimizing…related to soft constraints • N, cost and • Problem specific
Neighborhood • Variant of Kempe Chains • Exam i allocated to session t and t’ and t’ != t • G - set of exams allocated to t • G’ - set of exams allocated to t’ • Find unique minimum pair of G’s • FG & F’ G’ s.t. I F & (G\F)F & (G’\F’) F • Are conflict free • The timetable where we can find F and F’ s.t. • Reallocate all exams in F’ to session t • Reallocate all exams in F to session t’ • Is a neighbor of current solution
Cost Function • Time distance (Fc) • ti, tj sessions for exami and examj • Summed distance between each pair of exams • Distance significant iff 1|ti-tj| 5 • Then penalty = 26 - |ti-tj| - shorter distance higher penalty • Same day (Fl) • Summed sessions that are adjacent and on same day • If |ti-tj| = 1 then pen = 1 • Both cases penalty = 0 otherwise • Minimize Fc + Fl
Cooling Scheme • Lowering T • Size of T determines if higher cost neighbor solution is accepted x < e(- /t) • Climb out of local minima • Geometric cooling • Every nrep steps T is multiplyed by • set s.t. takes N steps from T0 --> Tf • = 1 - (ln(T0 ) - ln(Tf ))/N • Where N is the desired number of SA steps
Parameter Initialization • Nrep - steps where T constant • Tested 1, 4, 6, 10, 50, 5000 • T0 - starting temp • Find T0 s.t. starting probability of neighbor solution acceptance is [70%,80%] • Algorithm test all n*(n-1)/2 neighbors - n exams • Dynamic - run everytime scheduler is • Tf - final temp • Tested 0.5, 0.05, 0.005, 0.0005, 0.00005
Results • Microsoft Visual C++ 6.0 • PII 450 MHz PC • On … HCMC University of Technology • 30 exams sessions • 324 exams • 64,000 students • N - tested from 500 - 70,000 • Compared against? NOTHING
Results… COST 6900000 . . 6200000 6100000 6000000 5900000 SA steps 70000 . . 30000 20000 10000 0
Contribution • Impelemented on a real data set • Illustrated the importance of proper determination of SA parameters • Developed methods to select • Timetable cost decreases as N increases • Runtime, N = 70,000 • SA - 50min CP - 2min • Acceptable - run once a term
Future Work • Implement in smodels • Representation?? • Approximate soln to soft constraints?? • Aquire SA code • Empirical results for varying sizes • Compare solution methods • Accuracy • Speed • If time allows compare with dlv