© J. Christopher Beck Lecture 19: Timetabling with Operator Constraints
© J. Christopher Beck Outline Adding Operator/Tooling Constraints Graph coloring Heuristics – Brelaz Example Minimizing Timetabling Costs Algorithm Example 9.5.5
© J. Christopher Beck People are Different So far we have been assuming that we have W people that are all equivalent Any set of W j people could do activity j Obviously this isn’t true in many applications E.g., Medical or language specialties
© J. Christopher Beck Operator or Tool Constraints The operator has to have specific skills to do the activity Able to speak French, certified accountant A specific tool is needed 1/8” drill bit, refrigerator truck If two activities require the same operator or tool, they cannot be done at the same time
© J. Christopher Beck Restricted Problem Assume some set of specific people are needed to do each activity All activities have a duration of 1 Problem is still hard Equivalent to the graph coloring problem Aka “node coloring”, “vertex coloring”
© J. Christopher Beck Graph Coloring Color each node such that No two connected nodes have the same color Use the minimum number of colors
© J. Christopher Beck Mapping from Graph Coloring to Timetabling Nodes are activities Arcs mean the activities require the same operator Colors are time slots Minimizing the number of colors is minimizing makespan
© J. Christopher Beck Constraint Programming for Graph Coloring Remember CP Make heuristic decisions Color a node Propagate Remove that color from the domain of nodes connected to the node you just colored (This level of propagation is called “forward checking”)
© J. Christopher Beck CP for GC “Domain”
© J. Christopher Beck CP for GC Algorithm Step 0: Propagate Remove the color from all neighbors nodes Color nodes with singleton domains Step 1: Pick a node and color it Step 2: Propagate If a domain is empty, undo last color and assign a different color, goto 2 Else goto 1
© J. Christopher Beck Variable and Value Ordering Heuristics How do you pick a node (variable) to color next? Smallest domain first Maximum forward degree How do you pick a color (value) for that node? Randomly Lexicographically Order colors and assign the lowest possible
© J. Christopher Beck Brelaz Heuristic Choose node with smallest domain Break ties with maximum forward degree Forward degree: # arcs to uncolored nodes Choose colors lexicographically
© J. Christopher Beck Example Schedule 7 one-hour meetings in 4 hours Represent as a GC problem and use CP with Brelaz heuristic meeting Gary Hamilton Izak Reha
© J. Christopher Beck Other Examples To Look At Example OPL project mapgr.prj On ECF and Pinedo CDROM
© J. Christopher Beck A More General Problem There is a “slot cost”, c’ jt, if activity j is assigned to slot t There is a “changeover cost”, (a i,a j ), if a i and a j are scheduled close together E.g., (a i,a j ) = 5 * |slot(a i ) – slot(a j )| (a i,a j ) = 0, if a i and a j don’t conflict Objective is to minimize the sum of all slot and changeover costs See Algorithm 9.5.4!
© J. Christopher Beck And Another One: Multilingual Call Centre Assign calls to minimize makespan? Can this be represented as a GC problem? PersonLanguages AlexEnglish, French, German BarbaraGerman, Russian, Korean CharlesSerbo-Croatian, Polish DavidKorean, French, Polish EllenMandarin, Russian, English CallsLanguage 1English 2Korean 3 4French 5Russian 6Polish CallsLanguage 7German 8Russian 9Polish 10Mandarin 11French 12Russian
© J. Christopher Beck Modeling is VERY Important Remember back to Lec11 on CP If you have some solution technique (CP, GC, IP, …) an extremely important step is trying to fit your problem to the technique What do the nodes, arcs, colors represent? Is this a useful representation?