Upload
meryle
View
42
Download
0
Embed Size (px)
DESCRIPTION
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 - PowerPoint PPT Presentation
Citation preview
1
Approximate Solution to an Exam Timetabling Problem
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
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
OutlineOutline
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
ProblemProblem
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
Problem…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
MotivationMotivation
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???
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???
7
Solution MethodsSolution 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
ApproachApproach
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
Phase I: Constraint ProgrammingPhase 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
CP…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
Simulated AnnealingSimulated 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
Phase II: SAPhase II: SAs0, t0 > 0, loop until
loop until
select s in N(s0) ramdomly
= cost(s) - cost(s0)
if < 0 then s0 = selse
x = rand(0,1)
if x < e(- /t) then s0 = send if
until count = maxt = (t)
until stop criteria
s0, t0 > 0, loop until
loop until
select s in N(s0) ramdomly
= cost(s) - cost(s0)
if < 0 then s0 = selse
x = rand(0,1)
if x < e(- /t) then s0 = send if
until count = maxt = (t)
until stop criteria
13
SA …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
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
14
NeighborhoodNeighborhood
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
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
15
Cost FunctionCost 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
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
16
Cooling SchemeCooling 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
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
17
Parameter InitializationParameter 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
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
18
ResultsResults
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
Results…Results…COST
6900000
.
.
6200000
6100000
6000000
5900000
SA steps
70000
.
.
30000
20000
10000
0
20
ContributionContribution
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
Future WorkFuture 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
QuestionsQuestions