560 likes | 635 Views
Reservation Systems TimeTabling. 1. Reservation Systems without Slack 2. Reservation Systems with Slack 3. Timetabling with Tooling Constraints 4. Timetabling with Recourse Constraints 5. Scheduling flights at the airport. Relation between these problems.
E N D
Reservation SystemsTimeTabling 1. Reservation Systems without Slack 2. Reservation Systems with Slack 3. Timetabling with Tooling Constraints 4. Timetabling with Recourse Constraints 5. Scheduling flights at the airport
Relation between these problems 1. Reservation Systems without Slack (timing of job is fixed) • m Parallel machines, n jobs (fixed in time; interval scheduling) 2. Reservation Systems with Slack • m Parallel machines, n jobs (more flexible in time) 3. Timetabling with Tooling Constraints • Enough identical machines in parallel, n jobs, tools (only 1 of each avail.) 4. Timetabling with Resource Constraints • Enough identical machines in parallel, n jobs, one resource
Topic 1 Reservation Systems without Slack (Interval Scheduling)
Reservation without Slack • Reservation system with m machines, n jobs • Release date rj (integer), due date dj (integer), weight wj • No slack If accepted, job starts at time rj • Can we accept all jobs? Do we need all machines? objective1:Maximize number of jobs processed OR objective2: Minimize number of machines needed for all jobs
Job requiring processing in periodl Jl ={j| rj l dj } ILP Problem Formulation e.g. at car-rental: hi pj • Integer Program • Fixed time periods, assume H periods • Binary variables xij (=1 if job jassigned to i th machine, 0 otherwise) Exercise 1: How to adapt model for: do all jobs, but on a minimum number of machines
Maximizing value of processed jobs • In general is NP-hard (when both pj andwij free) • Two special cases with exact algorithms • each of these algorithms sorts the jobs to increasing rj • Case 1: processing times pj = 1 • decompose into separate time units • assign in each time unit most valuable jobs first
Case 2: Identical Weights and Machines • Mj = {1,2,…,m} with wij = 1 • objective: maximize #jobs taken • (No time decomposition, but still) an exact, simple algorithm: • Dispatch jobs, tentatively, in order of increasing release date • when next job has no machine while being earlier completed, select it at the expense of the later completed scheduled job
Algorithm (case 2: Identical Weights and Machines) • Step 1 • Set J = and j = 1 // J as set of accepted jobs • Step 2 • If available at time rj assign job j to a machine, include j in J, go to Step 4 • Step 3 • Of scheduled job set J, select j* with latest finish • If do not include j in J and go to Step 4 Else delete job j* from J, assign j to freed machine & include in J • Step 4 • If j = N STOP, select next job j = j+1 and go back to Step 2
Minimizing #machines used • No slack, arbitrary processing times, equal weights, infinitely many identical machines in parallel • Easily solved, as follows • Order jobs as before to earliest release date • Assign job 1 to machine 1 • Suppose first j-1 jobs have been assigned for processing • Try to assign j th job to a machine i ( j-1) as already used • If not possible assign to a new machine • Special case of node coloring problem • Why special case? (to be discussed later..)
Summary Reservation Systems without Slack Maximize # of jobs processed: simple algorithm Minimize # of machines needed: simple algorithm Topic 2 Reservation Systems with Slack
Reservation with Slack • Now allow slack (time slots) • Considering three cases with identical machines and objective: maximize #jobs Case 0. All processing times pj= 1 (trivial solution) Case 1. All processing times pj = p 2 , identical weights Case 2. General processing times, weights wj
Case 1: Equal Processing Times • Now assume processing times all equal to some p 2 • NOTE: slack can be different • Interaction between time units • Method: Barriers algorithm • wait for critical jobs to be released • start the job with the earliest deadline • Slot number l = l th job to start • S(l) starting time of l th slot
Barriers Algorithm • Barriers Algorithm (again open, whether this algorithm is exact!) • Barrier • ordered pair (l, r) • Expresses waiting constraint • Approach: Starting with a k-partial schedule • construct a (k+1)-partial schedule • or add a new barrier to the barrier list Lb and start over from scratch Slot number Release time
Earliest Deadline with Barriers • Selects machine h for job in (k+1)th slot • Compute the starting time
Computing the Starting Time • t is defined as the earliest time that the next job can start • Claim: Minimum release date of jobs left
Crisis Routine • Backtrack l=k, k-1, .. seeking 'pull-job' jl with dj(l) > dj' • (most recently scheduled with later deadline than job j' ) • If no pull-job is found, then exclude the crisis job • Otherwise: • Addbarrier (l, r*) in Lb, with r* min. release time in restricted set Jr , of jobs in part. sched. after pull job • Start anew with the updated barrier list Job in (k+1)th slot, can be a crisis job • Choose for (k+1)th slot: among available jobs, j ’ with earliest dj’ • The creation of (k+1)-partial-schedule is successful if • Otherwise, job j ’ is a ‘crisis job’and one calls upon the
Crisis job 1 3 Machine 1 Machine 2 Pull job (d2 > d3) 2 0 10 20 30 Barriers Algorithm: an example (all pj=10)
An example (cont’d) • Slot k=3 gives crisis job j=3 with pull job 2 in slot l=2 • Setup restricted set: Jr={3} (min. release date r* = r3= 5) • Include new barrier: (l, r*) =(2,5)Lb • Restart with updated list Lb from scratch (with extra wait command) Crisis job Now at k=2, wait till M 1 M 2 1 2 1 3 3 4 2 Pull job (d2 > d3) Optimal schedule 0 10 20 0 10 20 t
CASE 2: General processing times • Reservation with slack: processing times pj and weights wj NP-hard No efficient algorithm Heuristic needed • Composite dispatching rule • Preprocessing: determine flexibility of jobs and machines • Dispatch least flexible job first on the least flexible machine, etc
Defining priority indices • yik := # candidate jobs on machine i in time slot [k-1,k] • |Mj|= # machines suitable for job j • Priority index Ijfor jobs (lower index =higher priority): • more value | less proc. | less machines lower index Ij • Priority index gi k j of using machine i for job j in interval [k, k+pj]
Algorithm 1: - Calculate both priority indices Ij and yik - Order jobs according to job priority index (Ij) - Set j = 1 2: - Among available machines and time slots assign j to the combination <machine i , [k,k+pj] >with lowest value gikj - Discard job j if it cannot be processed at all 3: -If j = n then STOP, otherwise go back to Step 2 with j = j+1
Summary Reservation Systems with Slack Equal processing times: Barrier algorithm General processing times : Composite dispatching rule Topic 3 Timetabling with Tooling Constraints
Timetabling • (All given) n jobs must be processed • enough (e.g. >= n) identical machines in parallel • Minimizing Makespan • Tooling Constraints • Set of different available tools k (sayin set K ): of each k, only one available (for use by one job at a time) • Job j requires tools of subset Kjduring its processing • Timetabling is Special Case of RCPSP : • no precedence constraints • Rk = 1; rjk=1 or 0 depending on k being part of Kj
1 7 2 6 3 5 4 Why Timetabling = Node coloring Example: all jobs take one time unit • Job = node; • Jobs need same tool arc between nodes • Makespan <= H time units ? Can graph be colored with H colors ?
Heuristic for Node Coloring • Terminology • degree of node = number of arcs connected to node • saturation level = number of colors connected to node • Intuition • Color high degree nodes first • Color high saturation level nodes first
Heuristic Algorithm for Node Coloring Step 1: Order nodes in decreasing order of degree Step 2: Use color 1 for first node Step 3: Choose uncolored node with maximum saturation level, breaking ties according to degree Step 4: Color using the lowest possible color-number Step 5: If all nodes colored, STOP; otherwise go back to Step 3
Example book Nodes 1 2 3 4 5 6 7 Degree 5 2 5 4 5 2 3 1 7 2 6 3 5 4
Example book Saturation + Degree in uncolored subgraph = Degree original graph Nodes 1 2 3 4 5 6 7 Degree sub 4 2 4 3 - 1 2 Saturation 1 0 1 1 - 1 1 1 7 2 6 3 5 4
Example book Nodes 1 2 3 4 5 6 7 Degree sub 3 1 - 2 - 0 2 Saturation 2 1 - 2 - 2 1 1 7 2 6 3 5 4
Example book Nodes 1 2 3 4 5 6 7 Degree sub - 0 - 1 - 0 1 Saturation - 2 - 3 - 2 2 1 7 2 6 3 5 4
Example book Nodes 1 2 3 4 5 6 7 Degree sub - 0 - - - 0 0 Saturation - 2 - - - 2 3 1 Result 4 colors e.g. 7: blue 2: red or green 6: yellow or green 7 2 6 3 5 4
Degree sub 5 2 5 4 4 2 3 6 Worse: a reverse method Nodes 1 2 3 4 5 6 7 Degree 5 2 5 4 5 2 3 1 1 7 2 7 2 6 3 3 5 4 4
Example of Timetabling with tools • For solution: see previous node coloring example. Job 1: yellow Job 3: blue Job 7: blue Job 4: green Job 5: red Job 2: red or green Job 6: yellow or green
Relation to Reservation Models • Closely related to reservation problem with zero slack and arbitrary processing times (interval scheduling) • Interval scheduling = Special case of timetabling problem • jobs with common time periods unary (pj=1) jobs with common tools • new color = new machine new color = extra period • job occupies adjacent time periods (creating easy solvable color problem) jobs occupy tools ‘that need not be adjacent’
Job 1 must be processed in time [0,2] Job 2 must be processed in time [2,5] Example • Suppose now we have a reservation system • Here we transform to time-tabling:
Other example • Adjusted example of Timetabling with tools • Rearrange and rename tools jobs 1 2 3 4 5 6 7 Tool 1 1 0 1 1 1 0 1 1 Tool 2 1 1 1 0 0 0 0 Tool 3 0 0 1 0 1 1 0 Tool 4 1 0 1 1 1 0 0 Period 1 Period 2 Period 3 Period 4
Summary Timetabling with Tooling Constraints Node Coloring heuristic Topic 4 Timetabling with Resource Constraints
Timetabling with single resource • Unlimited number of identical machines in parallel • All n jobs must be processed • Resource constraints • Single resource of total quantity R • Required is a certain amount for each job
Resource Constraints • One type of tool but R units of it (resource) • Job j needs Rj units of this resource • Clearly, if Rj + Rk > R then job j and k cannot be processed at the same time, etc • Applications • scheduling a construction project (R = crew size) • exam scheduling (R = number of seats) • Special case of RCPSP with one resource, pi 1, no precedence
Special case: Bin-Packing • Assume equal processing times pj= 1 • Unlimited number of machines • Minimize makespan • Equivalent to bin-packing problem • each bin has capacity R • item of size rj • pack into the minimum number of bins
Solving the Bin-Packing Problem • Known to be NP-hard • Many heuristics developed • First fit (FF) heuristic • Always put an item in the first bin it fits into • Know that
Example • Assume 18 items and R = 2100 • Jobs 1-6 require 301 resources • Jobs 7-12 require 701 resources • Jobs 13-18 require 1051 resources • FF heuristic: • We assign the first 6 jobs to one interval (3016=1806) • We then assign jobs two at a time to next 3 intervals (7012=1402) • We then assign just one of the remaining jobs to each interval • Poor performance when jobs are assigned in arbitrary order
First Fit Decreasing (FFD) • An improvement of FF: • Order jobs in decreasing order first • Know that • FF and FFD can be extended to different release dates R = 12 6 jobs of size 6, 4, 4, 4, 3, 3
Discussion • This chapter only considered very simple models • In practice: • Dynamic reservation systems • Price considerations (yield management) • Other requirements (such as in final topic..)
Extra Topic:Scheduling flights at the airport, A reservation problem with no slack : When planning check-in desks (as adjacent tools)
Planning Check-in Desks rj = # desks required during (given) time-interval I(j) for flightsj=1,2,..n Optimization Problem - Minimize total #desks R* for all flight-desk -assignments Distinguishing feature: - Assigned desks must be adjacent
Algorithm: Earliest Release Date or First-Fit(analogous to algorithm for minimum #machines, topic 1 ) Flight 5 does not fit
LH Another ExampleScheduling flights (j=1,2,..8)in 30 min. periods (t=1,2,..9) Data: A feasible, but non-optimal solution: Find better solutions with R < 11!
First attempt Define R(t) as sum of rj’s over jobs j with tÎI(j) Then R* >= max t R(t)(a lower bound called Rlow)
Optimal Assignment with R*=8 desks Here Rlow=8 and R* = Rlow