resource scheduling constraints
play

Resource Scheduling Constraints Nicolas Beldiceanu SICS - PowerPoint PPT Presentation

Resource Scheduling Constraints Nicolas Beldiceanu SICS Lgerhyddsvgen 5 SE-75237 Uppsala, Sweden (nicolas@sics.se) Resource scheduling constraints 1. Overview 2. Cumulative 3. Cumulatives Resource scheduling Problem: tasks


  1. Resource Scheduling Constraints Nicolas Beldiceanu SICS Lägerhyddsvägen 5 SE-75237 Uppsala, Sweden (nicolas@sics.se)

  2. Resource scheduling constraints 1. Overview 2. Cumulative 3. Cumulatives

  3. Resource scheduling • Problem: tasks subject to temporal and resource constraints • Most successful area of CP • LP is usually poor on this type of problems • Two main categories of resources: - renewable - non-renewable

  4. Resource scheduling constraints 1. Overview 2. Cumulative 3. Cumulatives

  5. Cumulative ORIGIN : [AggounBeldiceanu93] ARGUMENTS : ctr_arguments(cumulative, [TASKS-collection(origin-dvar, duration-dvar, end-dvar, height dvar), LIMIT-int]). PURPOSE : The cumulative constraint enforces that at each point in time, the cumulated height of the set of tasks that overlap that point, does not exceed a given limit. EXAMPLE : cumulative([[origin-1, duration-3 , end-4 , height-1], [origin-2, duration-9 , end-11, height-2], [origin-3, duration-10, end-13, height-1], [origin-6, duration-6 , end-12, height-1], [origin-7, duration-2 , end-9 , height-3]],8)

  6. Cumulative INITIAL GRAPH

  7. Cumulative ≤ 8 ≤ ≤ ≤ 7 1 2 3 4 5 6 7 8 91011 12 ( 3+1+1+2 ≤ ≤ 8 ) ≤ ≤

  8. Coloured_cumulative ORIGIN : Derived from cumulative and nvalues . ARGUMENTS : ctr_arguments(coloured_cumulative, [TASKS-collection(origin-dvar, duration-dvar, end-dvar, colour-dvar), LIMIT-int]). PURPOSE : The coloured_cumulative constraint enforces that at each point in time, the number of distinct colours of the set of tasks that overlap that point, do not exceed a given limit. EXAMPLE : coloured_cumulative([[origin-1, duration-2 , end-3 , colour-1], [origin-2, duration-9 , end-11, colour-2], [origin-3, duration-10, end-13, colour-3], [origin-6, duration-6 , end-12, colour-2], [origin-7, duration-2 , end-9 , colour-3]],2)

  9. Coloured_cumulative INITIAL GRAPH

  10. Coloured_cumulative ≤ ≤ 2 ≤ ≤ 7 1 2 3 4 5 6 7 8 9101112 nvalues([3,2,3,2], ≤ ≤ ,2) ≤ ≤ 3 2 3 2 1

  11. Definition of cumulative cumulative(Origins,Durations,Heights,Limit) ListDvars ListDvars ListDvars Int quantity of resource Limit duration height task origin time

  12. Example of cumulative O1 in 1..2, O2 in 3..3, D1 in 2..3, D2 in 2..2, H1 in 1..4, H2 in 2..3 cumulative([ O1 , O2 ],[ D1 , D2 ],[ H1 , H2 ], 4 ), labeling([leftmost,up],[O1,D1,H1,O2,D2,H2]). [1,2,1,3,2,2] [1,3,1,3,2,3] [1,2,1,3,2,3] [1,3,2,3,2,2] [1,2,2,3,2,2] [2,2,1,3,2,2] [1,2,2,3,2,3] [2,2,1,3,2,3] [1,2,3,3,2,2] [2,2,2,3,2,2] [1,2,3,3,2,3] [2,3,1,3,2,2] [1,2,4,3,2,2] [2,3,1,3,2,3] [1,2,4,3,2,3] [2,3,2,3,2,2] [1,3,1,3,2,2]

  13. Main applications of cumulative Renewable resource 1 • disjunctive scheduling • cumulative scheduling Non renewable resource • producer consumer Bin-packing 1 2 3 Necessary condition for placement

  14. Producer-Consumer Final Stock Stock production task Consumed Quantity C Produced Consumer task Quantity P Initial stock

  15. Cumulative for placement We want to place the 8 followings rectangles in a 12 x 4 rectangle : R 1 (5×2), R 2 (8×3), R 3 (6×1), R 4 (5×1), R 5 (2×1), R 6 (3×1), R 7 (2×2), R 8 (1×2) . There exists a cumulative solution (by cutting R 8 into two pieces) but there is no solution with a non-overlapping constraint on rectangles. (proof : M. Hujter, On the dynamic storage allocation problem, Manuscript, Computer and Automation Institute Hung. Acad. Sci. (1990)) 4 R 8 R 1 : 6 × 1 3 R 1 : 5 × 2 R 4 : 5 × 1 R 2 : 2 2 × × 2 × × R 5 R 2 : 8 × 2 1 R 6 :3 × 1 R 8 0 0 1 2 3 4 5 6 7 8 9 10 11 12

  16. Resource scheduling constraints 1. Overview 2. Cumulative 3. Cumulatives

  17. The cumulatives constraint The original cumulative constraint: resource 4 ≤ 4 ≤ ≤ ≤ consumption 3 4 3 2 Restrict the resource consumption 1 1 2 at each point in time. 0 time 1 2 3 4 5 6 The generalized cumulatives constraint: resource 1 7 consumption ≥ 0 ≥ ≥ ≥ 0 6 -1 A pool of cumulative resources , Cumulated 4 2 profiles 5 Height of a task can be negative , 1 2 ≥ ≥ 0 ≥ ≥ Maximum or minimum resource consumption , 0 3 1 -1 Holds for time-points crossed by -2 time 1 2 3 4 5 6 at least one task .

  18. Parameters Consumption • Tasks: 1 Resource 2 3 Resource 1 • Origin 2 Machine • Duration 1 Height task(O,D,E,H,M) 0 • End time 1 2 3 4 5 6 • Height Origin End Duration • Machine Origin+Duration=En d • Resources: 1 3 • MachineId 2 machine(M,L) Identifier Limit • Limit 1 0 1 1 • Constraint: 3 3 ≥ 2 2 • upper bound(Ctr) ≤ 1 1 • lower 0 0

  19. D t For all tasks : E F i t For all time-points crossed by task : I N m t Let be the machine where task is assigned , I s i m T For all tasks which both cross point , and are assigned to : I O s N The sum of the height of tasks is not greater (less) m than the capacity of machine . E resource 1 7 X consumption ≥ 0 ≥ ≥ ≥ 0 6 A Machine 2 -1 M 4 2 5 P 1 2 L ≥ 0 ≥ ≥ ≥ 0 3 E 1 -1 Machine 1 -2 time 1 3 4 5 6 2

  20. Original cumulative constraint Maximum capacity resource 4 consumption 3 4 3 2 1 1 2 0 time 1 2 3 4 5 6 cumulatives ({machine-1 origin-2 duration-2 height-2 machine-1 origin-4 duration-2 height-1 machine-1 origin-3 duration-1 height-1 machine-1 origin-5 duration-1 height-3}, {id-1 capacity- 4 }, ≤ ≤ ≤ ≤ )

  21. cumulative constraint with machine choice Machine 2 with capacity 1 resource Machine 1 with capacity 3 1 3 consumption 3 2 2 1 4 1 0 1 2 3 4 5 6 time cumulatives ({machine-1 origin-2 duration-3 height-1, machine-1 origin-3 duration-2 height-2, machine-2 origin-2 duration-4 height-1, machine-1 origin-6 duration-1 height-2}, { id-1 capacity-3, id-2 capacity-1}, ≤ )

  22. Uninterupted minimum level of resource consumption Minimum consumption is 2 resource 4 consumption 5 3 4 2 3 1 2 0 1 1 2 3 4 5 6 time First use Last use cumulatives ({machine-1 origin-2 duration-4 height-0, machine-1 origin-2 duration-4 height-1, machine-1 origin-2 duration-2 height-1, machine-1 origin-4 duration-2 height-2, machine-1 origin-4 duration-1 height-1}, {id-1 capacity-2}, ≥ ≥ ≥ ≥ )

  23. Minimum level of resource consumption Minimum consumption is 2 resource 4 consumption 3 2 2 3 1 4 1 0 1 2 3 4 5 6 time No constraint at this point cumulatives ({machine-1 origin-2 duration-2 height-1, machine-1 origin-2 duration-1 height-2, machine-1 origin-3 duration-1 height-1, machine-1 origin-5 duration-2 height-2}, {id-1 capacity-2}, ≥ ) ≥ ≥ ≥

  24. Producer-consumer No negative stock resource 7 consumption 6 2 5 4 Stock at this 1 4 3 point in time 2 1 3 0 time 1 2 3 4 5 6 ({ machine-1 origin-1 duration-3 height-2, cumulatives machine-1 origin-1 duration-4 height-3, machine-1 origin-1 duration-6 height-1, machine-1 origin-5 duration-2 height-4}, {id-1 capacity-7}, ≤ )

  25. Producer-Consumer with multiple resources No negative stock on resource 2 resource 3 4 consumption 2 No negative stock on resource 1 5 1 4 2 Stocks at this 3 points in time 2 1 1 3 0 time 1 2 3 4 5 6 cumulatives ({ machine-1 origin-1 duration-1 height-1, machine-1 origin-1 duration-3 height-2, machine-1 origin-3 duration-4 height-1, machine-2 origin-1 duration-3 height-1, machine-2 origin-3 duration-4 height-2} , {id-1 capacity-4, id-2 capacity-3}, ≤ )

  26. Workload covering Green tasks ”cover” yellow tasks resource 3 6 consumption 2 5 1 3 4 Cumulated 0 profile 1 -1 2 -2 -3 -4 time 1 2 3 4 5 6 cumulatives machine-1 origin-2 duration-2 height-(-2), ({ machine-1 origin-4 duration-2 height-(-3), machine-1 origin-1 duration-4 height-1, machine-1 origin-5 duration-2 height-1, machine-1 origin-2 duration-4 height-1, machine-1 origin-3 duration-3 height-1} , {id-1 capacity-0}, ≥ )

  27. Workloads covering Green tasks resource 1 ”cover” yellow tasks on 7 consumption 0 both resources 6 -1 Cumulated 4 2 profiles 5 1 2 0 3 1 -1 -2 time 1 2 3 4 5 6 cumulatives ({ machine-1 origin-2 duration-2 height-(-2), machine-1 origin-1 duration-4 height-1, machine-1 origin-4 duration-2 height-(-1), machine-1 origin-2 duration-3 height-2, machine-1 origin-5 duration-2 height-2, machine-2 origin-3 duration-2 height-(-1), machine-2 origin-1 duration-4 height-1} , {id-1 capacity-0, id-2 capacity-0} ≥ )

  28. Exercise: project scheduling T2 T5 1-3 3-4 T4 T1 T7 2-2 2-1 0-0 T3 T6 4-3 1-6 Each task requires a given number of persons . Knowning that you have at most 7 persons, find the earliest end.

  29. Exercise: project scheduling (load) T2 T5 3 12 T4 T1 T7 4 1 0 T3 T6 12 6 Each task requires a given load (duration x needed resource).Knowning that you have at most 7 persons, modify your previous program in order to find the earliest end.

  30. Exercise: perfect square Write a program for finding a solution for placing 21 squares of respective size [50,42,37,35,33,29, 27,25,24,19,18,17,16,15,11,9,8,7,6,4,2]) into a square of size 112 without overlap.

Recommend


More recommend