720 likes | 918 Views
Constraint-Based Scheduling. Adapted from slides by Stephen F. Smith. Announcements. 4/21 Lecture – Prof. Eric Nyberg of LTI will presenting on the Q&A technology in WATSON. Zico will be holding his normal office hours today from 3:00 – 4:00. Outline. What is scheduling?
E N D
Constraint-Based Scheduling Adapted from slides by Stephen F. Smith
Announcements • 4/21 Lecture – Prof. Eric Nyberg of LTI will presenting on the Q&A technology in WATSON. • Zico will be holding his normal office hours today from 3:00 – 4:00.
Outline • What is scheduling? • Basic constraint-based scheduling models • Managing schedule change • Planning and Scheduling • Coordinating Distributed Scheduling Agents • Coordinators: A Distributed Scheduling Case Study
OP1,1 OP1,2 OP1,3 j i rd1 dd1 R1 R2 R OP2,1 OP2,2 dd2 rd2 OP2,1 OP1,2 R1 OP1,3 OP1,1 OP2,2 R2 What is Scheduling? • Given problem constraints and objective criterion, figure out how to best execute tasks with available resources over time st(i) + p(i) ≤ st(j), where p(i) is the processing time of op i i j st(i) + p(i) ≤ st(j) V st(j) + p(j) ≤ st(i) rd(j) ≤ st(i) for each op i of job j time Minimize ∑ |c(j) - dd(j)|
Planning - Synthesis of action sequences to achieve goals (what to do) Scheduling - Assignment of resources and times to actions to maximize performance (how and when) j i st(i) + p(i) ≤ st(j), where p(i) is the processing time of op i on(b,t) on(b,r) on(g,t) on(g,r) R i j on(r,g) st(i) + p(i) ≤ st(j) ∨ st(j) + p(j) ≤ st(i) clear(b) clear(r) rd(j) ≤ st(i) for each op i of job j Minimize ∑ |c(j) - dd(j)| putdown(r) stack(b,r) R1 OP1,2 OP1,1 clear(g) OP2,2 OP1,3 R2 stack(g,b) OP2,1 In recent years, the distinction has started to blur: preconds preconds clear(x) clear(x) clear(y) Planning Scheduling on(x,?) R1 on(x,?) R2 stack(x,y) resource setup and state constraints postconds resources postconds ¬on(x,?) ¬on(x,?) on(x,t) on(x,y) action selection from pre-computed resource & process alternatives clear(?) maximizing # of goals achieved, # of soft constraints satisfied clear(?) putdown(x) durative actions, temporal reasoning What is Planning and Scheduling? OP1,1 OP1,2 OP1,3 rd1 dd1 rd2 dd2 OP2,1 OP2,2
Relationship to Planning • Fundamentally concerned with coordinating multiple processes/agents • efficient use of shared resources • Processes known in advance • action selection from pre-specified alternatives • Restricted notion of state • availability, usage of shared resources • Determination of when and how
Classical Approaches from Operations Research • Optimization • Determination of tractable problem classes • Mathematical programming models • mixed-integer, non-linear optimization • decomposition, relaxation (bounding) techniques • Criticism: idealized and otherwise restrictive problem formulations • Priority dispatch rules • robust, practical decision-procedures but myopic tendencies
AI Perspective • Symbolic representations of time, resource capacity constraints • Heuristic (tree) search formulation • Emphasis on broader picture • ongoing continuous process versus static optimization task • larger problem-solving context (integration with planning • dynamic, uncertain environment
Scheduling Research: The Last 15 Years • Major advances in techniques for solving practical problems • Constraint solving frameworks • Incremental mathematical programming models • Meta-heuristic search procedures • Several significant success stories • Commercial enterprises and tools
Outline • What is scheduling? • Basics of constraint-based scheduling models • Managing schedule change • Planning and Scheduling • Coordinating Distributed Scheduling Agents • Coordinators: A Distributed Scheduling Case Study
Constraint-Based Search Models Components: Properties: • Modeling Generality/Expressiveness • Incrementality • Compositional Current Solution Conflict Handling / Retraction Heuristics Commitment Strategies / Heuristics Constraint Propagation
What is a CSP? • Given a triple {V,D,C}, where • V = set of decision variables • D = set of domains for variables in V • C = set of constraints on the values of variables in V • Find a consistent assignment of values to all variables in V
A Basic CSP Procedure 1. [Filtering] - Propagate constraints to establish the current set vd of feasible values for each unassigned variable d 2. If vd = Ø for any variable d , backtrack 3. If no unassigned variables or no consistent assignments for all variables, quit; Otherwise 4. [Variable Ordering] - Select an unassigned variable d to assign 5. [Value Ordering] - Select a value from vd to assign to d. 6. Go to step 1
Formulating Scheduling Problems as CSPs • “Fixed times” model • Find a consistent assignment of start times to activities • Variables are activity start times • Disjunctive graph model • Post sufficient additional precedence constraints between pairs of activities to eliminate resource contention • Variables are ordering decisions
OP1,2 R1 OP2,1 OP1,2 OP2,1 OP2,1 OP1,2 R1 time time Fixed versus Flexible Times Scheduling Some tradeoffs: • Flexibility of generated solutions • Convenience of search space
Filtering (Propagation) Algorithms • Role • Early pruning of the search space by eliminating infeasible assignments • Detection of constraint conflicts • Temporal Constraints • Simple Temporal Networks (Dechter 91) • Resource Constraints • Dominance Conditions (Erschler 80), Edge Finding (Nuijten 94, Balance Constraint (Laborie 01), ...
Simple Temporal Networks • Edge-weighted graph of time points expressing constraints of the form: atpjtpib • The domain of each time point is a single interval (no disjunction) • Encodes broad range of constraints including • Temporal relations: • finish-to-start <0, ∞> (precedence) • start-to-finish <t1,t2> (duration) • start-to-start <0,0> (same-start) • ... • Metric bounds: offsets from time origin • Efficient computation of arc consistent solutions via all-pairs shortest path algorithm
OP1,1 OP1,2 OP1,3 rd1 dd1 R1 R2 OP1,1 OP1,2 OP1,3 <d11,d11> <0,∞> <0,∞> <d12,d12> <d13,d13> OP2,1 OP2,2 <rd1,∞> <t1,t1> CZ (0,0) dd2 rd2 Schedule Op1,2 at time t1 <0,∞> <0,dd1> <rd2,∞> <0,dd2> <d21,d21> <0,∞> <d22,d22> Schedule Op2,1 before Op1,2 OP2,2 OP2,1 STN Example
Pruning Ordering Alternatives • Let Opi andOpj be 2 unordered operations competing for R • Then there are 4 possibilities (Erschler’s dominance conditions): • LSTi < EFTj and LSTj ≥ EFTi -> Opi is before Opj • LSTj < EFTi and LSTi ≥ EFTj -> Opj is before Opi • LSTi < EFTj and LSTj < EFTi -> inconsistency • LSTi ≥ EFTj and LSTj ≥ EFTi -> both options remain open Latest Interval OPi ESTj LFTj Earliest Interval OPi ESTi R LFTi Opi cannot precede OPj
((LFT(S) - EST(S) < Dur(O) + Dur(S)) (LST(S) - EST(O) < Dur(O) + EST(O)) EST(O) ≥ EST(S) + Dur(S) S = {OP ,OP }; O = OP Start Time OP ≥ 25 k i k j Edge Finding • S - a set of operations competing for resource R • O - an operation not in S also requiring R OP k OP j OP i 10 30 20
AssignActivity: [Rtype1,Rtype2] [t1,t2] Generate Resources R4 R3 R1 R2 Generate Possible Intervals IR1,2 ... IR1,1 IR2,1 ... IR4,1 IR2,2 IR3,1 ... ... IR3,2 Actj Acti Actk R2 Scheduling An Activity (Fixed times schema) Apply filtering techniques to start times, resource alternatives of unscheduled activities
AssignActivity: [Rtype1,Rtype2] [t1,t2] R4 R3 R1 R2 IR1,2 ... IR1,1 IR2,1 IR4,1 ... IR2,2 IR3,1 ... ... IR3,2 Configuring A Basic Scheduling Search Model • Couple core search procedure with variable ordering heuristic and filtering algs. to produce greedy solution generator • Embed in larger optimizing search by • Backtracking over variable/value ordering choices • Dynamically changing the variable ordering and iteratively re-invoking the core procedure • using the solution generator to seed a local search
Search Heuristics (Variable and Value Ordering) • Resource Demand/Contention (Sadeh 91, Beck 97) • Identify bottleneck resource • Schedule (or sequence) those activities contributing most to demand • Slack/Temporal Flexibility (Smith & Cheng 93) • Choose pair of activities with least sequencing flexibility • Post sequencing constraint that leaves the most slack • Minimal critical sets (Laborie & Gallib 95) • Generalization to multi-capacity resources • Resource Envelopes (Muscettola 04)
Constraint-Posting Scheduling Models • Conduct search in the space of ordering decisions • variables - Ordering(i,j,R) for operations i and j contending for resource R • values - i before j, j before i • Constraint posting and propagation in the underlying temporal constraint network (time points and distances)
Peak 2 Peak2 Peak 1 Peak 1 C C Impose Capacity Constraint Time feasible task network Resource Leveling Task 2 Task 1 Peak 2 C Constraint Propagation Task 2 Time feasible task network Task 1 Deadline Basic Constraint-Posting Cycle 25
Scheduling Search Procedures • Constructive procedures • greedy, backtracking, LDS, ... • Iterative repair and local search • “commit early and often” versus “least-commitment” winnowing of solution set • emphasis on retraction heuristics as well as constructive heuristics • well suited for incremental change Will show example methods later in discussing oversubscribed problems
Outline • What is scheduling? • Basics of constraint-based scheduling models • Managing schedule change • Planning and Scheduling • Coordinating Distributed Scheduling Agents • Coordinators: A Distributed Scheduling Case Study
Scheduler Pro-active: Generate schedules that anticipate Uncertainty Reactive: Manage schedule in response to unexpected events Executor Views on Scheduling under Uncertainty • Design and use of scheduling policies • Establish and maintain prescriptive schedules
Approaches to Managing Change • Build schedules that retain flexibility • Produce schedules that promote localized recovery (Supermodels - Ginsberg) • Incremental re-scheduling techniques are a natural (e.g., that consider “continuity” as an objective criteria) • Self-scheduling control systems
Incremental Schedule Repair • Several competing approaches to maintaining continuity in the schedules generated over time • Minimally disruptive schedule revision (temporal delay, resource area) • Priority-based change • Regeneration with preference for same decisions • Extended local search • Critical issue: how to trade solution stability concerns off against (re)optimization needs and computational cost
Hedging Against Uncertainty • Temporal Networks with uncertainty [Vidal 96] - some set of edges are contingent (e.g. uncertain duration) • strong controllability - analogous to conformant planning • dynamic controllability - solution can always be extracted as uncertain arcs become known • Contingent schedules • Disjunctive Temporal Networks [Moffit & Pollock 06] • Opportunity to make resource choices explicit; challenge is managing combinatorics • Project likely failure points and generate explicit contingencies [Drummond and Bresina 94, Hiatt et. al 09] • Aversion dynamics [McKay 00] • adapt scheduling policy to minimize impact of unexpected change
Outline • What is scheduling? • Basics of constraint-based scheduling models • Managing schedule change • Planning and Scheduling • Coordinating Distributed Scheduling Agents • Coordinators: A Distributed Scheduling Case Study
Sequence goals and construct goal achieving action sequences G1 A1 A2 G3 A4 Allocate resources (maybe) and Assign times A3 A5 G2 Plan R1 A1 R2 A5 R3 A3 A2 A4 Schedule Integrated Planning and Scheduling (as typically formulated) Goals G3 G1 G2
Resource-Driven Problems • Principal form of goal interaction is competition for resources • Upfront planning process is separable and limited to achievement of individual goals • At its core, these are essentially scheduling problems • But allocation of resources introduces planning sub-problems
Construct goal achieving action sequences G1 A1 A2 Allocate Resources and Assign times G3 A5 A4 A3 R1 G2 A1 Plan R2 A5 R3 A3 A2 A4 Schedule Resource-Driven Problems Goals G3 G1 G2
AssignActivity: [Rtype1,Rtype2] [t1,t2] R4 R3 R1 R2 IR1,2 ... ... IR1,1 IR2,1 IR4,1 IR2,2 IR3,1 ... IR3,2 ... t2 IR1,2 IR1,1 Acti Actk R1 Setup Setup S t1 Where’s the Planning in a Scheduling Problem? • Managing shared resources • Resource support actions are needed to “set up” resources for use • These support actions depend on required usage states, which are determined by the scheduler’s sequencing decisions
Scheduling the Hubble Space Telescope • A complex single machine problem • Resource support actions • Instrument reconfiguration • Pointing direction • Target lock ... TargetY Visibility ... not visible visible visible ObserveA ObserveB ChangeOver(Inst-1,Inst-2) Inst-1 Target: X Inst-2 Target: Y Slewing(X,Y) Earliest Start Time Setup Time Idle Time
HSTS Solution Proposals OBS 4 Abstract Schedule OBS 3 OBS 1 OBS 5 ... OBS 2 Setup Telescope state OBS 1 OBS 2 Single machine scheduler Detailed Schedule Subgoaling temporal planner WF state: OBS 1 PC state: OBS 2 WFPC state: pointing state:
What is missing? • Scheduling models gain their power by making restrictive modeling assumptions • Resource “setup” as a sequence-dependent duration • Bounded dynamics of resource usage • Trades flexibility for scalability • Explicit goal-directed reasoning can be used to overcome this limitation • Extension to enable more idiosyncratic allocation options • Modular knowledge, performance requirements • Challenge: How to effectively embed a planner within the scheduler search process?
Solving Oversubscribed Problems • Basic Setting: Resource constraints restrict the ability of some system of interest to perform tasks (achieve goals), and cumulative demand exceeds its capacity • 2 sets of interacting decisions • Which subset of tasks to perform (goals to achieve) • How to allocate tasks to system resources over time • Objective: • Maximize number of tasks performed, maximize resource utilization, …
Examples/Applications • Rover Task Planning [Smith 2004] • Telescope observation scheduling [Bresina et. al 96, Johnston and Miller 94, Muscettola and Smith 93, Giuliano et. al 08. • Satellite observation scheduling [Barbulescu et.al 06, Frank et. al 02, Globus et. al 2003, Rabideau, Chein et. al] • Military airlift allocation [Kramer and Smith 03] • Personal task management [Varakanthan and Smith 08]
Approaches to Oversubscribed Problems • Planning Perspective • Emphasis on resource limitations other than time (e.g., fuel) • Orienteering-type problems [D. Smith 04] • General formulation as partial satisfaction planning • Specify preferences over goals and combine with other preferences • Scheduling Perspective • Selection and allocation of tasks to resources under temporal constraints
Oversubscribed Scheduling Research • Has focused on problems where principal source of interaction between tasks (goals) is competition for resources over time • Basic model: • Tasks (goals) have durations, resource requirements and feasible time windows • Tasks may have priorities (indicating relative importance) • Resources may have reconfiguration (setup) constraints • More complex settings: • High level tasks may decompose in HTN fashion into lower level activity sequences or disjunctions (reflecting prior modeling of various process or resource choices)
Representational Alternatives • Permutation Space Search – Search in the space of task permutations • Permutation specifies a scheduling order • “Schedule builder” applied to construct schedule • Examples: Squeaky Wheel Opt., Genetic Algorithms • Schedule Space Search – Search directly in the space of possible schedules. • Initial base solution is progressively revised and improved over time. • Examples: Iterative Repair, Task Swap
Basic Airlift Allocation Problem Requests: • Decisions: • Use resources (e.g., aircraft) from wing W1 or W2? • Start at what time? • Mission1: • pick up cargo at A • deliver to B • then C. B C A W2 W1 • Mission2 • … • Mission-n Missions have priorities which must be strictly enforced
Task Swapping[Kramer and Smith 2003,2004,2005] Goal:Controlled schedule revision to accommodate additional tasks without relaxing constraints Basic Approach • Temporarily relax priority constraint • Conduct repair-based search around the “footprint” of an unassignable task t’s feasible execution window • If all tasks displaced to accommodate t cannot be feasibly reinserted, Undo
Unassignable task, T1 CapR=7 T2 CapR=7 T3 T4 Assigned task, T1 T6 T5 T7 T8 T3 T4 T10 T9 T6 T5 T12 T11 R T14 T15 T13 T7 T8 T10 T9 T12 T11 R T14 T15 T13 An Example Un-scheduled task T2 Re-scheduled task T2 T2
Retraction Heuristics C1 C2 • Max-Flexibility = task-duration/feasible-window-size • Min-Conflicts = count intervals that are at-capacity which conflict with a task’s feasible window. • Min-Contention = conflict-count * conflict duration Unassignable task T6 est st lft ft T1 T2 T3 T4 T5
General Task Swap Procedure • Given an unassignable task t to insert into the schedule, • Identify where conflicts with that task exist. • Retract 1 or more tasks in the conflicted areas to free up capacity • Schedule task t, and mark it as “seen.” • Re-schedule the retracted tasks. • If all retracted tasks cannot be re-scheduled, recurse on them, most constrained first. • If all tasks have been tested (seen) and some remain unassignable, backtrack to original state. • Matched best performance on benchmark pickup-and-delivery problems
An Experiment[Kramer, Barbulescu, Smith 07] • Question: How does a schedule-based search procedure perform relative to a permutation-based search procedure in a given domain? • Examine performance of two representative procedures on AFSCN and AMC domains • Schedule Space: Task Swap • Permutation Space: Squeaky Wheel Optimization (SWO)