Scheuduling. Operating System Examples Solaris scheduling Windows XP scheduling Linux scheduling.
Scheduling
-
Upload
stathis-grigoropoulos -
Category
Technology
-
view
164 -
download
0
description
Transcript of Scheduling
Constraint programming approach for school timetabling
Stathis Grigoropoulos
Timetabling & Scheduling
29-06-2012
Christos Valouxis , Efthymios Housos∗
Outline
• Constraint Programming• Context/Problem• Constraints• Lower Bound estimation• Solution• Optimization• The Algorithm• Practical results• Conclusion
• Consist of:– a set of variables X={x1,…,xn}
– variables’ domains Di (finite set of possible values)
– a set of constraints
Example:• X::{1,2}, Y::{1,2}, Z::{1,2}• X = Y, X Z, Y > Z
• Solution of CSP (constraint satisfaction problem)– assignment of value from its domain to every variable satisfying
all the constraints
Example:• X=2, Y=2, Z=1
Constraint Programming
• A rich constraint language– Arithmetic, higher-order, logical constraints– Global constraints for natural substructures
• Specification of a search procedure– Definition of search tree to explore– Specification of search strategy
Constraint Programming
Constraint Programming
• Branch and Prune– Prune: eliminate
infeasible configurations– Branch: decompose into
subproblems• Prune
– Carefully examine constraints to reduce possible variable values
• Branch– Use heuristics based on
feasibility info• Main focus:constraints
and feasibility
• Branch and Bound– Bound: eliminate
suboptimal solutions– Branch: decompose into
subproblems• Bound
– Use (linear) relaxation of problem (+ cuts)
• Branch– Use information from
relaxation• Main focus: objective
function and optimality
CP VS IP
• systematic search only => no efficient• consistency only => no complete• combination of search (backtracking) with
consistency techniques• methods:
– look back (restoring from conflicts)– look ahead (preventing conflicts)
look back
Labelling order
look ahead
Constraint Programming/Constraint Propagation
Context• Typical Greek High School• A number of teachers with various educational
specializations are available.• Every teacher is qualified to teach a certain number of
courses. • Every year has a number of class sections. Typically around
four class sections• The teaching days are Monday–Friday• The daily teaching hours for the students are either six or
seven. • Every class section has its own permanent room => no room
constraint• The teachers are assigned to the class sections before the
creation of the timetable• The courses are the same for all High Schools
Parameters and Sets
Constraints• In every class section and for each day and hour only one
teacher is teaching:
• A teacher cannot be present at more than one class section at the same instance:
• Balanced distribution of teaching hours:
– the variable ShiftT[t][d] has the value h => that teacher t at day d and at hour h is teaching in some class section.
Constraints• Class section balanced weekly distribution for the teaching
load of every teacher:
• Every class section must have in the timetable the specified number of lectures by the proper teachers.
• Every teacher must have in the timetable the specified lectures for the proper class sections and working days.
• The teaching schedule of every class section must be continuous and always starting on the first hour of the day. Any non-teaching period is allowed only in the last hour of the day
Quality Constraints/Objective Function• An effort should be made to respect the teacher preferences
for early in the morning or later in the day teaching hours, for all teachers(cost1= desirability of the assigned teaching hours)
• There must exist a minimum number of non-teaching hours (idle hours) in the middle of a sequence of daily teaching hours(cost2)
• Objective Function: Min(cost1 + cost2)
hours. It is calculated using the variables ShiftT of every teacher. are
• {0; 2; 5; 10; 20; 50; 100}.
Lower Bound estimation• Cost2: Lower
Bound = 0• Cost1: relaxation
and minimum cost matching
• Gabow's algorithm
For optimum solution
Solution• ILOG solver library• Searching systematically through all the possible
assignments of values to variables• Solution is found when values have been assigned to all the
variables ProgrC• Trick
– Assign the teachers first, they affect the quality of the solution!– sequentially for all teacher, a graph and minimum cost matching!
• After the definition of a single ShiftD[d][h], check variables ProgrC that are afected
• CP framework is allowed to further search for better solutions by adding a new artificial constraint to the problem that basically
• forces the CP system to suggest solutions with improved cost at all times• BUT still, search space to big
Optimization
• Space reduction search strategies– If the best solution up to this point does contain idle hours and the term cost1
is equal or very close to the lower bound of cost1, the search is allowed to proceed only to areas where the total idle hours of the current solution are reduced beyond the ones of the best solution
– When during the search the total idle hours of the current solution are greater than the idle hours of the best solution, the search stops investigating this area of solutions, because a solution with less idle hours is always more desirable
• Local Search– for 1 and 2 days restrict the variables to find optimal solution
The Algorithm
Results
• Solved the teacher, class timetable with the same formulation
Conclusion
• CP can be very efficient in timetabling problems• CP + Local Search = Good• Would be nice to see CP + Column Generation• Would be nice to see CP + IP
Thank You!
• Questions?