Download presentation
Presentation is loading. Please wait.
1
1 Approximate Solution to an Exam Timetabling Problem Adam White Dept of Computing Science University of Alberta Adam White Dept of Computing Science University of Alberta
2
2 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 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
3
3 Outline Introduction Problem Motivation Related Work Two Phase Algorithm Constraint Programming Simulated Annealing Results Contribution Future Work Introduction Problem Motivation Related Work Two Phase Algorithm Constraint Programming Simulated Annealing Results Contribution Future Work
4
4 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 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
5
5 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 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
6
6 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 University of Alberta > 35,000 students > 90 buildings Number of exams??? 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 University of Alberta > 35,000 students > 90 buildings Number of exams???
7
7 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 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
8
8 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 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
9
9 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 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
10
10 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) 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)
11
11 Simulated Annealing Analogy: metal cools and freezes into a minimum energy crystalline structure search for a minimum in a system Analogy: metal cools and freezes into a minimum energy crystalline structure search for a minimum in a system
12
12 Phase II: SA s 0, t 0 > 0, loop until select s in N(s 0 ) ramdomly = cost(s) - cost(s 0 ) if < 0 then s 0 = s else x = rand(0,1) if x < e (- /t) then s 0 = s end if until count = max t = (t) until stop criteria s 0, t 0 > 0, loop until select s in N(s 0 ) ramdomly = cost(s) - cost(s 0 ) if < 0 then s 0 = s else x = rand(0,1) if x < e (- /t) then s 0 = s end if until count = max t = (t) until stop criteria
13
13 SA … s 0 - initial solution t 0 - 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 s 0 - initial solution t 0 - 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
14
14 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 F G & 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 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 F G & 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
15
15 Cost Function Time distance (F c ) t i, t j sessions for exam i and exam j Summed distance between each pair of exams Distance significant iff 1 |t i -t j | 5 Then penalty = 2 6 - |ti-tj| - shorter distance higher penalty Same day (F l ) Summed sessions that are adjacent and on same day If |t i -t j | = 1 then pen = 1 Both cases penalty = 0 otherwise Minimize F c + F l Time distance (F c ) t i, t j sessions for exam i and exam j Summed distance between each pair of exams Distance significant iff 1 |t i -t j | 5 Then penalty = 2 6 - |ti-tj| - shorter distance higher penalty Same day (F l ) Summed sessions that are adjacent and on same day If |t i -t j | = 1 then pen = 1 Both cases penalty = 0 otherwise Minimize F c + F l
16
16 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 T 0 --> T f = 1 - (ln(T 0 ) - ln(T f ))/N Where N is the desired number of SA steps 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 T 0 --> T f = 1 - (ln(T 0 ) - ln(T f ))/N Where N is the desired number of SA steps
17
17 Parameter Initialization Nrep - steps where T constant Tested 1, 4, 6, 10, 50, 5000 T 0 - starting temp Find T 0 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 T f - final temp Tested 0.5, 0.05, 0.005, 0.0005, 0.00005 Nrep - steps where T constant Tested 1, 4, 6, 10, 50, 5000 T 0 - starting temp Find T 0 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 T f - final temp Tested 0.5, 0.05, 0.005, 0.0005, 0.00005
18
18 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 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
19
19 Results… COST 6900000. 6200000 6100000 6000000 5900000 SA steps 70000. 30000 20000 10000 0
20
20 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 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
21
21 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 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
22
22 Questions
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.