Title: Constraintbased Scheduling ACC01 Tutorial Session
1Constraint-based SchedulingACC01 Tutorial
Session
- Markus Fromherz
- June 2001
2Outline
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
- Markus FromherzXerox Palo Alto Research
Centerhttp//www.parc.com/fromherz
3Outline
- Short presentations
- Simon de Givry (Thales LCR)A constraint-based
scheduling and planning framework for real-time
applications - Stephen F. Smith (CMU, The Robotics
Institute)Continuous, mixed-initiative
management of transportation resources - Mark Boddy (Honeywell Technology Center)On-line
event dispatch and schedule updating with
information from operations, using a
constraint-based scheduling approach
4Introduction
- Scheduling is
- the process of allocating resources to
activities over time. - Scheduling problems are everywhere
- job-shop scheduling, product assembly sequencing
- manpower and service scheduling, logistics
resource allocation and scheduling, fleet
assignment - Scheduling is an important component of many
business processes.
5Introduction
- Constraint-based scheduling
- separates the model from the solving algorithms
- uses powerful, generic solving algorithms
- which enables
- wider variety of constraints
- dynamic model, model composition
- model re-use for other tasks
- Recent use in control
- on-line and real-time constraint-based scheduling
- even for solving times of tens or hundreds of
milliseconds - Scheduling as a new tool for reconfigurable
system control.
6Next
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
7Scheduling
Products
Operations
Operations
Resource
Resource
Resource
Resource
8Scheduling Application example
- Modular print engines
- 3-20 modules,100s of components
- customer-configurable machines
- complex interactions
- hierarchical, distributed control
- CBS enables
- auto-configuration
- plug-and-playplanning andscheduling
- model multi-use
9Scheduling
- Classic machine shop metaphor
- machines, jobs, tasks
- flow shop task order constrained, resource use
fixed - job shop task order constrained, resource use
flexible - open shop task order and resource use flexible
- precedence and resource constraints
- much work on deterministic algorithms for
problems with few machines and jobs - Constraint-based methods proved successful when
- problems are hard
- domain-specific / redundant constraints are
available - problems change often
- Real problems have a wide variety of constraints.
10Next
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
11Constraint programming Intro
- Scheduling as a constraint satisfaction and
optimization problem - variables timing and resource selection of tasks
- constraints precedence, resource constraints,
etc. - objective function optimality criterion (e.g.,
schedule length) - solution assignment to the resource and timing
variables - Roots
- AI search procedures
- CLP modeling, programming, constraint operations
- OR solving for specific constraint systems
12Constraint programming Constraint problems
- Constraint satisfaction problem (CSP)
- n variables xi with domains Di, m constraints
cj(x1,,xn) - solution consistent variable assignment
- given n variables xi with domains Di and m
constraints cj,find a solution ?x1,,xn?
?v1,,vn?such that vi ? Di i1,,n cj(v1,,vn) j
1,,m - Constrained optimization problem (COP)
- additional objective function h(x1,,xn)
- given n variables xi with domains Di, m
constraints cj, andobjective function h,find a
solution ?x1,,xn? ?v1,,vn?with
minimal h(v1,,vn)subject to vi ? Di i
1,,n cj(v1,,vn) j 1,,m
13Constraint programming Modeling
- Modeling constraint problems
- domain types
- integer domains l,u
- logical (or Boolean) domains false,true (0,1)
- enumeration (or choice) domains 1,k
- real domains
- set domains
- constraint types
- arithmetic constraints (e.g., 3xy ? z)
- Boolean formulae (e.g., x ? (y ? ?z))
- set constraints (e.g., subset(x,y))
14Constraint programming Modeling
- Modeling constraint problems
- constraint system
- set of primitive constraints together with rules
for how to combine and derive constraints - linear or nonlinear over discrete or continuous
variables - equality, inequality, disequality (?),
special-purpose relations - other constraint systems possible in CP framework
- objective function
- single variable (e.g., time of last task in a
schedule) - combinations of objectives (e.g., weighted sum of
individual objectives)
15Constraint programming Solving
Problem
- Constraint graph
- variables are nodes, constraints are edges
- unary, binary, or any number of variables per
constraint - Solving finite-domain constraint problems
- domain reduction constraint propagation search
Graph
Solution t1 2, t2 10, t3 13, t4 15
16Constraint programming Solving
- Domain reduction
- application of a unary constraint c(x)
- Constraint propagation
- propagation of domain changes between connected
variables
x gt 3
x ? 0,10
x ? 4,10
(propagation)
(reduction propagation)
x ? 0,10
x ? 0,7
x ? 4,7
x ? y3
x ? y3
x gt 3
x ? y3
y ? 0,10
y ? 3,10
y ? 7,10
17Constraint programming Solving
- Refinement-based search methods
- incremental assignment of values to variables
- backtracking on constraint violation
- set X ?x1,,xn?while there are unassigned
variables in X select an unassigned variable x
from X select a value v from the domain of
x assign x v (and propagate) backtrack (to
value then variable selection) if a constraint is
violatedend while - Components
- choice points variable selection, value
selection - heuristics (domain-independent or
domain-specific) - backtrack procedure (chronological, backjumping,
etc.) - degree of arc-consistency (forward checking, full
look-ahead, etc.)
18Constraint programming Solving
- Optimization with refinement-based search
- branch-and-bound search
- add new constraint h(x1,,xn) lt h(v1,,vn)
during searchevery time a new solution ?v1,,vn?
is found - binary search
- restart search with progressively narrowerlower
and upper bounds on h - iterative deepening
- restart search with an increasing upper limit on
huntil a solution is found
19Constraint programming Solving
- Repair-based search methods
- changing variable values in a complete assignment
- iteration on constraint violation
- set V ?v1,,vn? as initial solution for
?x1,,xn?while V is inconsistent select an
inconsistent assignment x v from V select a
new value v for x assign x v in Vend
while - Components
- choice points variable selection, value
selection - heuristics
- Optimization with repair-based search
- hill climbing
- simulated annealing
20Next
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
21Constraint-based scheduling Modeling
- Modeling scheduling problems
- scheduling-specific variables and constraints
- intervals (e.g., start and duration)
- various classes of resources
- hard and soft constraints
22Constraint-based scheduling Modeling
Renewable resources
- Modeling scheduling problems
- resource constraints
- define and constrain the available resourcesby
restricting multiple uses of a resource - renewable and consumable resources
- preemptive and non-preemptive tasks
- incremental allocation constraints(e.g.,
unary_resource(r), allocate(r,t1),
allocate(r,t2))or global constraints(e.g.,
cumulative(t1,t2,1,1,1))
unary
volumetric
state
23Constraint-based scheduling Modeling
- Resource allocation examples
unary_resource(r),allocate(r, t1),allocate(r,
t2) ? cumulative(t1,t2,1,1,1)
volumetric_resource(r, 3),allocate(r, t1, 1),
use1allocate(r, t2, 2), use2allocate(r,
t3, 1) use1 ? cumulative(t1,t2,t3,1,2,1,3
)
state_resource(r, 1,2),allocate(r, t1, 1),
state1allocate(r, t2, 2), state2allocate(r,
t3, 2) state2 ? cumulative(t1,t2,1,1,1),c
umulative(t1,t3,1,1,1)
24Constraint-based scheduling Propagation
- Scheduling-specific propagation techniques
- reasoning about resources and intervals
- resource timetables
- maintains a timetable with required and available
capacity at any time for each resource - propagates between resources and task times
- edge finding
- reasons about execution order of tasks on a given
resource - updates earliest and latest possible execution
times - Domain-specific redundant constraints and search
heuristics can lead to increased propagation and
smaller search trees.
25Constraint-based scheduling Example
- Job-shop scheduling problem
- given
- set of machines each processes one task at a
time - set of jobs each a set of tasks with given
durations, fixed order, assigned machines - find schedule (task times) that minimizes the
makespan - Model
- tasks interval variables t, durations
dmachines unary resource variables r - objective h l
- constraints For every task t 0 ? t ? l. For
every task t, given duration d t.d d. For
every job with tasks ?t1,,tn? ti ? ti1 (i
1,,n1). For every task t, given assigned
machine r allocate(r, t).
26Constraint-based scheduling Off/on-line
- Off-line/predictive scheduling
- receive and post constraints in one step
- then solve for all tasks to find task times
- On-line/reactive scheduling
- receive and post constraints incrementally(only
for known tasks) - find and execute schedule concurrently
- reschedule if constraints change
- few generic schedulers for on-line use
receive problem
post constraints
solve problem
release for execution
27Constraint-based scheduling Inside
- Deployed generic real-time, embedded schedulers
- Xeroxs print-engine paper-path scheduler
- details in next section
- NASAs Remote Agent Planner and Scheduler
(RAX-PS) - part of Deep Space One
- constraint solver with customized search
strategies - on-line constraint management
- JPLs Aspen planner and scheduler
- for NASA spacecraft
- on-line constraint management
- real-time response by using iterative repair
techniques
28Constraint-based scheduling Complexity
- Complexity
- most real scheduling problems are NP-hard
- research focus finding generic heuristics and
enabling programmers to guide algorithms with
domain-specific knowledge (glass-box approach) - Possible solutions
- simplify by relaxing certain assumptions, e.g.,
by allowing to preempt tasks - dedicated complexity analysis, e.g., separating
typical from average and worst-case scenarios - adaptive constraint solving
29Constraint-based scheduling MPC
- Model-predictive control
- similarities to CBS
- model, objectives, and constraints stated
explicitly as a COP - incremental nature of processing incoming
requests - optimization of decisions with respect to a
horizon of future events - reactive to changes in assumptions, system state
- differences from CBS
- order of references points and control inputs
fixed - sequence of solutions is the values of the same
control task at different times - common requirement from constraint programming
view - full optimization with minimal commitment approach
30Next
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
31Application example Print-engine scheduling
- System-level task
- on a given machine,Mark engine with 1 feeder and
2 finishers - for desired document(s),10 pages, 50 copies,
duplex, color, face-up - plan and schedule required operations.Feed at
0s, mark at 3s, invert at 4s, ... - Low-level controlexecutes andmonitors
theoperations.
32Application example Components
- Scheduler components
- machine module models
- system controller
- constraint solver
- Automatic composition,flexible control
throughconstraint modelsand algorithms.
33Application example Modeling
- Components as transducers
- work units, transformation, resource allocations
- feature, timing constraints on combinations of
inputs and outputs - compositional, no function in structure
- Describing structure, constraints,and interfaces.
Transport component
34Application example Modeling
- Transport component in CDL
- domain-specific concurrent constraint language
- for describing component and module capabilities
- constraint systems integer ( interval),
resource, feature - Component Transport(int length, int speed)
EntryPort in ExitPort out IntVariable
t_out, d FeatureVariable s UnaryResource
space Capability Move(IntVariable t_in)
in.Input(s, t_in) out.Output(s, t_out)
s.size.width lt 200 t_in d
t_out d length/speed
space.Allocate(t_in, d) // Capability
Move // Component Transport
35Application example Capabilities
- Machine capabilities
- composing capabilities by unifying output to
input events, propagating feature and timing
constraints - result
- completespecification ofthe output sheet
- timing andresourceconstraints
36Application example Control
- Auto-configuration
- modules pass up their module models
- module models are composed to machine model
- Run-time control
- scheduler identifies sheet plans for stream of
sheets - scheduler schedules sheet plans incrementally,
optimally - control commands and instantiated reference times
are sent to module controllers for execution
37Application example Control
- Sample schedule for ten sheets
- six simplex sheets, two duplex sheets,two
simplex sheets
38Finally
- Tutorial presentation
- Introduction
- Scheduling
- Constraint programming
- Constraint-based scheduling
- Application example
- Conclusion
39Conclusion CBS
- Constraint-based scheduling
- provides a set of technologies for constructing
high-level control software - separates scheduling algorithms from
system-specific information - facilitates developing correct and flexible
control software for complex dynamical systems
40Conclusion Future
- Future work
- further integration of CLP, AI, and OR techniques
- more research on constraint-based techniques
inreal-time, on-line environments - more work on making constraint-based scheduling
accessible - usable modeling languages
- associated analysis and transformation tools
- Constraint-based scheduling is becoming an
important part of advanced control software.