140 likes | 272 Views
Temporal Constraint Propagation (Non-Preemptive Case). Outline. Variables Relations between the variables Temporal constraints Time bounds Minimal and maximal distances between time points. Variables (definition). Three variables start(A) end(A) duration(A) for each activity A.
E N D
Outline • Variables • Relations between the variables • Temporal constraints • Time bounds • Minimal and maximal distances between time points
Variables (definition) Three variables start(A) end(A) duration(A) for each activity A
Variables (implementation) • Finite domain (bitvector) • The domain of each variable is a finite set • Interval domain (pair of numbers) • The domain of each variable is an interval startmin(A), startmax(A), endmin(A), endmax(A) durationmin(A), durationmax(A)
Relation between the variables end(A) = start(A) + duration(A) endmin(A) = max(endmin(A), startmin(A) + durationmin(A)) endmax(A) = min(endmax(A), startmax(A) + durationmax(A)) startmin(A) = max(startmin(A), endmin(A) - durationmax(A)) startmax(A) = min(startmax(A), endmax(A) - durationmin(A)) durationmin(A) = max(durationmin(A), endmin(A) - startmax(A)) durationmax(A) = min(durationmax(A), endmax(A) - startmin(A))
Temporal constraints • Simple precedences start(A) £ start(B) start(A) £ end(B) end(A) £ start(B) end(A) £ end(B)
Temporal constraints • Precedences with minimal delays start(A) + delay £ start(B) start(A) + delay £ end(B) end(A) + delay £ start(B) end(A) + delay £ end(B)
Temporal constraints • Precedences with fixed delays start(A) + delay = start(B) start(A) + delay = end(B) end(A) + delay = start(B) end(A) + delay = end(B)
Temporal constraints • Maximal delays start(A) £ start(B) + delay start(A) £ end(B) + delay end(A) £ start(B) + delay end(A) £ end(B) + delay
Propagation of time bounds var(A) + delay £ var(B) varmin(B) = max(varmin(B), varmin(A) + delay) varmax(A) = min(varmax(A), varmax(B) - delay) Complete propagation for bounded domains • Contradiction found when the constraints conflict • Best possible varmin(A) and varmax(A) found otherwise • Incremental variant of an operations research algorithm for project scheduling (PERT networks)
Propagation of time bounds Complexity • For a consistent network: O(n*m) where n is the number of activities and m the number of constraints if constraints are propagated in the first-in first-out order • For an inconsistent network: O(h*n2) where h is the time horizon (can be reduced to O(n3) but not worth it in practice)
Minimal and maximal distances • [x + dxy£ y] and [y + dyz£ z] implies [x + (dxy+ dyz) £ z] • Useful to solve disjunctions of temporal constraints [x - 5 £ y] [y + 2 £ z] [z + 4 £ x] OR [v + 3 £ w]
Minimal and maximal distances • Matrix-based method Whenever dxy is modified, update dwz to max(dwz, dwx+ dxy+ dyz)
Minimal and maximal distances Complexity • O(n2) after each modification of the constraint network • O(n3) to initialize the matrix