Roman Barták (Charles University in Prague, Czech Republic)
MODELLING AND SOLVING
y g p
MODELLING AND SOLVING SCHEDULING PROBLEMS USING CONSTRAINT - - PDF document
Roman Bartk (Charles University in Prague, Czech Republic) y g p MODELLING AND SOLVING SCHEDULING PROBLEMS USING CONSTRAINT PROGRAMMING CONSTRAINT PROGRAMMING Two worlds Two worlds planning vs. scheduling planning is about finding
Roman Barták (Charles University in Prague, Czech Republic)
y g p
“how can I use the resources to get max X and min Y…” “how can I get using objective metrics a plan that for the long how can I get, using objective metrics, a plan that for the long term, will improve the plant efficiency…”
“how can I produce this product now, and this one and that p p ,
“how can I satisfy Mr. X from sales and Mr. Y from the plant and the customer at the same time, without getting into new , g g troubles…”
depth‐first search assign a value to the variable propagate = make the problem propagate = make the problem locally consistent backtrack upon failure X in 1..5
≈ X=1 ∨ X=2 ∨ X=3 ∨ X=4 ∨ X=5 (enumeration)
X=1 ∨ X≠1
(step labeling)
X<3 ∨ X≥3
(domain splitting) 3 3 ( p g)
X<Y ∨ X≥Y
(problem splitting)
t t(A) (A) d(A)
B A
start(A)+p(A)=end(A) precedences A«B: end(A) ≤ start(B)
unary resource A«B ∨ B«A: end(A) ≤ start(B) ∨ end(B) ≤ start(A)
resource inference
4 6 16 16 B (4) 7 A (2)
p(Ω ∪ {A}) > lct(Ω ∪ {A}) est(Ω) ⇒ A«Ω
7 15 C (5)
p(Ω ∪ {A}) > lct(Ω ∪ {A}) ‐ est(Ω) ⇒ A«Ω A«Ω ⇒ end(A) ≤ min{ lct(Ω') ‐ p(Ω') | Ω'⊆Ω }
{C | est(X) ≤ est(C) ∧ lct(C) ≤ lct(Y)} |
time complexity O(n3), frequently used incremental algorithm
alternative resources are just special cases of alternative process alternative process
[FLAIRS 2007]
nodes = operations, arcs = precedence (temporal) relations logical dependencies between nodes – branching relations.
PAR
ALT
PAR
for example, a demand must be fulfilled
ALT
Is it possible to select a process satisfying the demand? The problem is NP‐complete!!! [FLAIRS 2007].
PAR
ALT
[AIMSA 2008]
x z z z x x x y z z z y y z z y z k = 1 k = 2 k = 3
[FLAIRS 2007]
A B
B
A
B1 B2 B3
C
[RAC 2008]
(Nested)Temporal Network with Alternatives
each node A is annotated by a temporal variableTA with a domain
〈0,MaxTime〉, where MaxTime is a constant given by the user. T l l ti [ b] b t d X d Y t h ld if b th d
Temporal relation [a,b] between nodes X and Y must hold if both nodes
are valid! VX * VY * (TX + a) ≤TY ∧VX * VY * (TY – b) ≤TX. Notes:
VX = 0 ∨VY = 0 → 0 ≤TY ∧ 0 ≤TX VX = VY = 1 → (TX + a) ≤TY ∧ (TY – b) ≤TX. Th b l i d h f b hi ! The above temporal constraint does not assume the type of branching!
[0,0] [K,K] [Z1, Z1] [Z2, Z2] [Zn, Zn] ALT ALT ALT ALT ALT ALT
ALT ALT ALT ALT ALT ALT
A TA
A DurA
VX * VY * (TX + DurX) ≤TY ∨VX * VY * (TY + DurY) ≤TX
(in)valid operations: ValA = 1 ⇔ DurA > 0
[CSCLP 2008]
select some activity (earliest start combined with other criteria) make the activity valid
d d h f
decide its position in the resource (from start)
valid A A«B invalid A B«A, valid B A«C C«A, valid C A«C C«A, valid C A«D D«A valid D A«D D«A valid D A«D D«A valid D A«D D«A valid D {B C}AD A{B,C,D} DA{B,C} CA{B,D}{C,D}AB BA{C,D} {B,D}AC {B,C}AD {B,C,D}A
Number of resources 34 Number of activity types 991 y yp Number of items 294 Number of orders 45 Total ordered q antit 88 5 tons (88 485 kg) Total ordered quantity 88.5 tons (88 485 kg) Schedule period 1 week (10 080 minutes) Number of activities 5946 Number of precedences 9325 R i 3 i (P i 4/1 00 MH ) Runtime 53 mins (Pentium 4/1700 MHz)
good enough – the user cannot improve it in reasonable
fast enough – depends on the plant dynamics. One hour