Presentation is loading. Please wait.

Presentation is loading. Please wait.

Finite Capacity Scheduling

Similar presentations


Presentation on theme: "Finite Capacity Scheduling"— Presentation transcript:

1 Finite Capacity Scheduling
6.834J, J

2 Overview of Presentation
What is Finite Capacity Scheduling? Types of Scheduling Problems Background and History of Work Representation of Schedules Representation of Scheduling Problems Solution Algorithms Summary

3 What is Finite Capacity Scheduling?
Informal and Partial Definitions Determining the best sequence of tasks on a resource Optimal assignment of limited resources to tasks to fulfill a set of orders Elimination of factory bottlenecks Formal Definition The allocation of resources over time to perform a set of tasks such that task precedence constraints and resource capacity constraints are not violated, and overall deadline goals are met to the best extent possible

4 Example Schedule Gantt chart

5 Types of Scheduling Problems
Energy Job Shop Batch Process Discrete Manufacturing Servicing of Complex Equipment Scheduling of a Unique Resource Military Logistics

6 Energy Scheduling Electrical utility generator scheduling to meet anticipated demand Ex. – Utility with 3 Generators Generator 1 2 3 Capacity (kw) 120 350 Hourly Cost ($/h) 10 Incremental Cost ($/kwh) 0.20 0.30 0.40

7 Energy Scheduling (cont.)
Demand Profile

8 Energy Scheduling (cont.)
Best Schedule: Hour 1 2 3 4 Generator 1 100 120 Generator 2 80 Generator 3 60

9 Let if generator i is on during time j, 0 otherwise
be the energy generated by generator i during time j Cost can then be expressed as From the previous schedule, non-zero values of B and E are: So cost = = 242

10 Constraints for this problem can be expressed as
Where is demand at time j, and is the capacity of generator i. Note how this forces Eij to be 0 if Bij is. This, combined with the constraint that the B variables must be binary, and the previously defined cost function, yields an optimization problem with discrete and continuous constraints. Such problems are often solved by Mixed Integer Linear Programming algorithms (more on this later).

11 Suppose another consumer would like to buy energy
Variations on Problem Suppose utility has 100 kwh energy storage device (battery that has no hourly or incremental cost) Could run generator 2 during 1st hour to charge battery Could then discharge battery to meet demand in 3rd hour Eliminates need to use generator 3 Suppose another consumer would like to buy energy New consumer has their own demand profile Utility must evaluate whether it is profitable to sell to this new customer This is a function of base demand profile, consumer’s demand profile, generation costs, and what the new consumer is willing to pay Suppose generator 3 has high hourly cost but low energy cost It may make sense to run it and shut off generators 1 and 2

12 Variations on Problem – Co-generation
Co-generation introduces a new set of complex considerations Ex. – Refinery that uses waste heat from process to make steam to generate electricity Refinery may schedule production to simultaneously meet production goals and demand for electricity, thus maximizing profit Two kinds of demand Refinery’s main products (gasoline of various grades, etc.) Electricity (demand profile as shown previously) Also complicated by the fact that electricity prices vary based on demand, and on time of day Contracts between factories, utilities, and customers can be extremely complicated

13 Job Shop Scheduling Schedule n jobs on m machines
Each job requires processing on each machine in a particular order This order differs from one job to another Often formulated as constraint satisfaction problem with binary temporal constraints among the mn tasks Eliminating bottleneck resources is an important goal

14 Batch Process Scheduling
Tasks have “size” that is a continuous and/or discrete function of the amount of material to be produced to fulfill an order Task size can affect task duration, resource requirements Resource utilization represented with a combination of discrete and continuous variables Often, and important goal is to find ways to combine similar tasks into larger “batches” in order to minimize changeover costs

15 Example – Beer Production
After brewing and aging, beer must be filtered, prior to packaging.

16 Discrete Manufacturing Scheduling
Semiconductor Auto assembly Heavy equipment Aircraft assembly Electronic parts assembly

17 Discrete Manufacturing Scheduling (cont.)
Characteristics Similar, in some ways, to job shop, and to batch process scheduling Process plan instantiated based on order Process plans for similar types of orders are similar Fewer continuous variables and constraints Task sizes are discrete functions of order Ex. – a car needs 4 tires Resource allocations are typically binary Resource is utilized or not Resources typically allocated to tasks for individual orders Typically, no batching of tasks

18 Scheduling Service of Complex Equipment
Ex. – Space Shuttle Ground Processing Approximately 40,000 hours of technician labor between flights.

19 Space Shuttle Service (cont.)
About 50% same for each flight. Rest is function of payloads, maintenance based on age of components orbiter modifications Very dynamic environment Arrival date subject to change (and affected by weather) Resource requirements – parts, supplies, people State (configuration) of system being repaired is important State constraints (requirements and effects), very important Use of changeover tasks to get system into correct state

20 Scheduling of a Unique Resource
Ex. – Hubble Telescope

21 Scheduling of Hubble Telescope (cont.)
10,000 to 30,000 observations scheduled per year Primary resource constraint is available observing time Affected by orbital position Required orientation to keep sunlight on solar panels Many constraints periodic Disruptions Targets of opportunity (new supernova) Spacecraft anomalies Changes in observing programs

22 Military Logistics Transportation of troops and supplies
Resources to be scheduled are transport vessels and cargo planes Groups of troops and supplies represent tasks Resource capacity constraints significant Deadline constraints significant Precedence constraints significant Equipment must be delivered in appropriate sequence

23 Background of Work on Scheduling (a representative, but not exhaustive list)
MRP (Material Requirements Planning), MRP II (1970’s) Demand for end-products expanded into time-phased requirements for parts Timing based on operation leadtimes No accounting of resource loading Schedules often un-realistic Mark Fox, CMU, ISIS (1980’s) Each order scheduled one at a time Constructive approach, incrementally extends partial schedule solution until complete Simple best-first search with backtracking Formulation as CSP, hard and soft constraints, continuous and discrete Some constraint propagation (forward chaining) capability

24 Background of Work on Scheduling (cont.)
Monte Zweben, NASA, Gerry (1990’s) Iterative repair algorithm Modifies complete schedule to repair constraints, or to make more optimal Hill-climbing, search states are complete solutions Pantelides, Imperial College (1990’s) Chemical Process Scheduling RTN, MILP algorithm Discrete time formulation Branch and bound, branch and cut

25 Areas of Work Related to Scheduling
Assignment Problem Assign n tasks to n resources (no time rep.) Specialized algorithm solves this efficiently Transportation Problem Transfer material between nodes in a graph Traveling Salesman Problem Resource “visits” n tasks (optimal sequencing of tasks on a resource) Graph theory, flow networks (used in TSP) Long-Range Planning using Dynamic Programming Combinatoric Optimization, CSP, A* search, MILP

26 Representation of Schedules
Task Start time Finish time Duration Resource assignments Resource Renewable (equipment for example) Non-renewable (material or product, for example) Useful to think of task as consuming one set of resources, and producing another set For equipment, the task “consumes” the resource at the start time, and “produces” it (makes it available again) at the finish time.

27 Representation of Schedules (cont.)
Attributes of materials (non-renewable) resources - amount and state Amount of flour, number of loaves of bread – related to task size State – temperature of bread, freshness Attributes of equipment (renewable) resources – state Oven at input is clean (required state), oven at output is dirty (effect) Cleaning oven is “changeover” task Baker at output is tired (taking a knap might be changeover) Attributes of tasks related to those of resources

28 Representation of Schedules: Discrete vs
Representation of Schedules: Discrete vs. Continuous Time Representations Discrete Scheduling horizon divided into discrete, equal intervals Task start, finish times expressed in terms of these increments Advantageous for certain scheduling algorithms Easy to check for resource capacity violations Disadvantage is that if fine time granularity over longer scheduling horizon is required, then many intervals Problem size becomes un-manageable Continuous Task start, finish times expressed as real numbers Smaller number of variables Discrete event vs. discrete time Disadvantage is that checking resource capacity violations is more complicated Rules out use of certain scheduling algorithms

29 Representation of Schedules Gantt Chart

30 Representation of Scheduling Problems
Resource-Operation Network (RON) Inspired by Imperial College RTN Consists of Operations and Resource Requirements Operation Class of task Duration may be constant, or may be function of other things Other attributes (amount, type of material to be produced) Resource Requirement Renewable and non-renewable resources Incorporates notion of state (of a material or a resource) Task is an instantiation of an operation Resource assignment is an instantiation of a resource requirement

31 Representation of Scheduling Problems (cont.)
- Note similarity to schedule representation Attributes of operations and resource requirements similar to attributes of tasks and resources

32 Representation of Scheduling Problems: Constraints
Resource requirements, Operations have attributes Some general (like duration, start-time, etc.) Some problem specific (state of a particular resource type) Attributes can have discrete or continuous values Combination of algebraic and logical constraints used to constrain values of attributes Kneading.finish_time < Baking.start_time Baking.OvenInput.Status = clean Baking.Dough.amount = f(Baking.size) RON architecture is general enough to support just about any kind of constraint (algebraic, logical, even functions) However, there are a number of important basic types of constraints that are often used in scheduling

33 Representation of Scheduling Problems: Common Constraint Types
Constraints associated with resources Resource utilization (how much of a resource a task needs) Resource capacity (resource utilization should not exceed this) Resource state Task may require resource to be in particular state at beginning of task Task may leave resource in particular state at end of task (effect) Motivation for changeover tasks Resource availability (calendar) Resource (labor for example) may not be available on weekends Constraints associated with tasks Duration (may be constant, or may be function of task size) Start, finish (related by duration) Precedence (kneading before baking) Usually not necessary when using RON formulation (falls out) Due dates (ultimately, the reason for doing scheduling)

34 Resource Utilization Constraints
Operation usually determines amount of resource required, and amount produced May be simple constant: Baking.Oven_Input.amount = 1 (need one oven) Baking.Oven_Output.amount = 1 (oven not consumed by process) May be integer function of task size Baking.Size = Baking.Break.Loaves (task size = number of loaves) Baking.Flour.amount = 12 x Baking.Size May be continuous function of task size HoldingTank.level = 50 x Filtering.Size May even be a complex, non-linear function Lubricant.amount = f(Drilling.Size)

35 Resource Capacity Constraints
Resource utilization should not exceed maximum capacity for a resource Resource utilization becomes function of time over scheduling horizon

36 Resource State Constraints
Constraint on state of input resource requirement Analogous to requirement part of planning operation (Graphplan, etc.) Baking.Oven_Input.status = clean Constraint on state of output resource requirement Analogous to effects part of planning operation Baking.Oven_Output.status = dirty Changeover operation used to restore resource to required state Cleaning operation converts dirty oven to clean one State requirements, changeover operations, often the key issue in generating good schedule Reason: changeover operations take time (setup time) Goal is often to minimize changeovers This can be achieved by batching similar tasks There is a limit to this, however, imposed by limits of inventory (resource capacity constraints)

37 Soft Constraints and Cost
It is often advantageous to think of scheduling as a constrained (or even un-constrained) optimization problem, rather than a constraint satisfaction problem Analogous to notion of Lagrange multipliers in non-linear constrained optimization Allow some constraints to be relaxed (make them soft) However, relaxation has a cost penalty Relaxation of deadline constraint results in lateness penalty Relaxation of resource capacity constraint results in overtime pay requirement Production costs usually directly associated with resource utilization Thus, cost function is sum of Resource utilization costs Constraint relaxation penalties

38 Process Plan Instantiation
Instantiate tasks for process plan (operations) for each order Ex. 3 orders for bread Order Amount Due Date 1 3 loaves Mon. 2 5 loaves Tues. 3 1 loaf Wed.

39 Instantiated Tasks (Based on Process Plan)
Kneading1 Kneading2 Kneading3 Baking1 Baking2 Baking3 Size 3 5 1 Also, Cleaning1, Cleaning2, and Cleaning3 (size not an issue for these)

40 Process Plan Instantiation (cont.)
Initial resource assignment based on resource requirements using very simple dispatch heuristics Sequence tasks on resource based on order

41 Process Plan Instantiation (cont.)
This actually is not a bad schedule in some circumstances Probably is a good schedule for this example On the other hand, if the baker doesn’t care about freshness, and wants to take Tues. off Batch orders together to improve efficiency Requires inventory capacity Refrigerated storage space Tolerance to reduction in quality (quality is a state variable that decays over time)

42 Solution of Scheduling Problems
Unlike representation, which is relatively universal, solution algorithm is problem-dependent Most real-world problems also require heuristics, specialized for the particular type of problem

43 Solution Algorithms Dispatch Algorithms MILP
Relation to A*, constructive constraint-based Constructive Constraint-Based Iterative Repair Simulated Annealing How A* heuristics can be used here (relaxation of deadline constraints) Genetic Algorithms

44 Dispatch Algorithms Process plan instantiated (as described previously) Tasks put into queues, one for each order (Preserves task precedence constraints)

45 Dispatch Algorithms (cont.)
Tasks released one at a time from queues Assigned to first available resource Which queue is popped depends on task priorities Queue with highest priority task at top gets popped Task priority based on variety of factors Mainly order importance and urgency Apex system is a dispatch system Flight controller assistant, described by Rob Kochman

46 Dispatch Algorithms (cont.)
Advantages Simple to implement Can easily handle changing requirements by updating priorities Disadvantages When task is popped, it is assigned to first available resource If none available, it just waits, and nothing further can be done Thus, susceptible to bottlenecks Doesn’t really set schedule times Can’t guarantee when things will get done No look-ahead, so no optimization No capability for JIT Tasks “shifted to the left”

47 Dispatch Algorithms (cont.)
However Much, if not most, real-world scheduling is done in this way Manual scheduling is often done in this way

48 MILP (Mixed Integer Linear Programming)
Used for energy scheduling Chemical process scheduling Pantelides, et. al., Imperial College Sometimes used in discrete manufacturing Pekny, Miller, Traveling Salesman Problems For scheduling, requires discrete time formulation

49 MILP Basics Constraints represented as linear equalities and inequalities A is constant matrix, b is constant vector, x is vector of variables X vector has lower and upper bounds X consists of real and integer variables Cost represented as weighted sum of x

50 MILP Basics Energy scheduling example presented previously is an example of an MILP

51 MILP Basics (cont.) This formulation is relatively easy to solve if x has just real variables, no integers (if it is an LP) Simplex algorithm, commercial solvers (CPLEX) can easily handle problems with > 100,000 variables Integer constraint adds significant complexity Requires search where for each integer variable, Pick an integer Propagate by solving LP If feasible, go on to next variable and repeat If not feasible, pick different integer Bad news – depth-first search Good news – there is a very good heuristic to guide the search

52 MILP Basics (cont.) This algorithm is called “branch and bound”
The linear relaxation often gives good guidance about what integer values to pick Ex. Suppose that LP relaxation results in value of 7.3 for variable x1, which is constrained to be an integer variable. MILP solver tries x1 = 7 as one search branch, and x1 = 8 as the other This algorithm is called “branch and bound” Note that the LP relaxation is a best-case heuristic Therefore, branch and bound is a kind of A* search If the LP relaxation yields a solution that is worse than the best one found so far, that entire branch of the tree is pruned

53 MILP Basics (cont.) Ex. x1, x2 are integer, other variables real

54 RTN Formulation Let if resource i is assigned to task j at time k,
0 otherwise. Suppose task j has duration n. Let if task j starts at time k, 0 otherwise. Then Note that if ST is set to integer (1 or 0), all other variables have integer values, even in LP relaxation! Example of “branch and cut”. Resource capacity constraint is easy to express:

55 RTN Formulation (cont.)
Material production is formulated as follows: here, j refers to tasks that produce material Mi. Then, deadline constraint is simply (is enough of the material ready at the due time). Advantages Rigorous formulation, all constraints propagated Easy to try all sorts of what-if scenarios Resource capacity constraints, material production easily checked Disadvantages Requires discrete-time formulation, so formulation can become large Formulation tricky Important that constraints significantly reduce search space Should be set up so that relaxation produces integer results Compilers can mitigate this disadvantage

56 Constructive Constraint-Based
Fox, et. al., ISIS Best-first search with backtracking Tasks for orders scheduled one at a time Incrementally adds to partial schedule at each node in the search If infeasibility is reached (constraint violation) Backtrack to resolve constraint Advantages Relatively simple, can make use of standard algorithms like A* Use of A* allows for incorporation of heuristics Such heuristics are often used by human schedulers Disadvantages Re-scheduling is difficult May not find a complete schedule in the required time Changeover constraints, task switching is difficult Constraint relaxation is difficult

57 Constructive Constraint-Based (cont.)
Important disadvantage (often a show-stopper) A simple swap of ordering of two tasks on a resource (something that human schedulers often do) may require significant backtracking Ex. Swapping to eliminate large changeover (asymetric TSP) requires backtracking Unravels everything done between order 1 and n

58 Iterative Repair Zweben, et. al., GERRY, Red Pepper Software
Scheduling of space shuttle ground operations Johnston and Minton Scheduling of Hubble space telescope Begin with complete but possibly flawed schedule Generate initial schedule quickly using simple dispatching Iteratively modify to repair constraint violations, and to make more optimal Each step in search is a repair step (single modification to complete schedule) Results in either better or worse schedule Hill-climbing (best-first) search Searches space of possible complete assignments

59 Iterative Repair (cont.)
Disadvantage May get stuck in local optimum (as with all local search techniques) Can be mitigated using simulated annealing approach Allow repair step that increases cost with some non-zero probability Advantages Inherently provides for rescheduling Current schedule is initial (flawed) schedule for new requirements Assumes new requirements not that different from old Complete schedule available at all times Though it may not be such a great schedule Constraint relaxation is easy (a repair step) Swapping tasks to reduce changeovers is easy (repair step) A complete assignment is often more informative in guiding search than a partial assignment (Johnston and Minton)

60 Iterative Repair (cont.)
Potentially many kinds of repair steps Using a few assumptions, problem can be reduced to very small number of kinds of repair steps Assume that a discrete-event simulator exists such that Given an assignment of tasks to resources, and an ordering of tasks on resources Simulator propagates timing and resource constraints so that no resource is overloaded, state constraints are met, resource calendar constraints are met Note that order deadlines may not be met (soft constraint) Effectively simulates what would happen in real plant Continuous time representation Such a simulator is relatively easy to implement, and is fast Such a simulator can operate as the constraint propagation kernel of an iterative repair algorithm Given such a simulator, the only decisions to make are Which resources to assign tasks to Sorting of tasks on a resource Repair steps are thus Move task on a resource to a different sort position on that resource Move task to a different resource (insert somewhere in the new resource’s sort sequence)

61 Iterative Repair Example – Beer Scheduling
Filtering of alcoholic vs. non-alcoholic beer prior to packaging

62 Iterative Repair Example – Beer Scheduling
RON

63 Iterative Repair Example – Beer Scheduling
Assume holding tank capacity is 100 gallons 3 orders each for 80 gallons alcoholic, non-alcoholic beer, interspersed as follows (packaging tasks fixed)

64 Iterative Repair Example – Beer Scheduling
Simple dispatching produces following (flawed) schedule

65 Iterative Repair Example – Beer Scheduling
Iterative repair batches second A, NA tasks with first Note that further batching is not possible (would need more tanks)

66 Summary Focus of this lecture was on generally useful techniques
Solution of real-world scheduling problems can make use of these techniques, but also, often requires use of problem specific heuristics As with other problems, scheduling becomes easier as computers get faster (less need for problem-specific heuristics)


Download ppt "Finite Capacity Scheduling"

Similar presentations


Ads by Google