T13 Agent coordination in planning and scheduling

408 views

Published on

14th European Agent Systems Summer School

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
408
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

T13 Agent coordination in planning and scheduling

  1. 1. Agent Coordination Agent Coordination Temporal ConstraintsTechniques in in for Autonomous Scheduling Planning and Scheduling Planning and Scheduling a play in 4 parts a play in 2 parts Cees Witteveen, Cees Witteveen Algorithmics group, Bob Huisman Algorithmics group, Algorithmics group & NedTrain Delft University of Technology, The Netherlands Delft University, The Netherlands C.Witteveen@tudelft.nl / NedTrain Company, The Netherlands Delft University C.Witteveen@tudelft.nl B.Huisman@tudelft.nlEASSS Valencia May 2012 1 EASSS Valencia May 2012 2 Our problem Plan coordination examples Given • Building a house Several agents each doing a part of the total set of tasks. • set of agents each capable Tasks are dependent upon each other. of performing some specific tasks; • set of interdependent and constrained tasks to be accomplished; • Organizing intermodal transportation Goods have to be transported by several companies • tasks are distributed over the agents plan coordination problem using different transport modalities. for Question autonomous agents • Airport planning how to specify the constraints such that A set of airports handling incoming and outgoing flights each airport wants to make its own plans for arrival, • each agent is able to make an gate-assignment and departure planning. individual plan/schedule for its set of tasks independently, • Coordinating service providers at airports • individual plans can always be joined A set of service providers each providing a different service to a feasible total plan for the original to a set of airplanes. There are time constraints between services. set of tasks.EASSS Valencia May 2012 3 EASSS Valencia May 2012 4 Plan of the course Contents Part 1 Part 1: coordination of plans with temporal constraints 1. Introduction: Agent Coordination in Scheduling - introduction to autonomous scheduling - basics of scheduling - introduction to autonomous scheduling. - Simple Temporal Plans Cees Witteveen - Temporal decoupling 2. Theory: temporal schedules in Simple Temporal Plans - Application in ground handling at airports - simple temporal plans (STPs); - determining consistency of an STP; Part 2 : coordination of plans with temporal and - finding solutions for an STP; resource constraints - temporal decoupling in STPs. - Plans with resource constraints Bob Huisman 3. Application: coordination of schedules at airports - Constraint posting - temporal decoupling applied to the turnaround process at airports. - Extensions EASSS Valencia May 2012 5 EASSS Valencia May 2012 6
  2. 2. Scheduling: basics Scheduling: examples Given project planning & scheduling • a set of activities (events) whose durations and what planning of activities to be executed resource requirements are known in software projects • a set of temporal constraints between the activities when machine scheduling • a set of computational resources (machines,vehicles) who allocation of jobs to processors needed to perform activities transportation scheduling • and a given cost function how much arrival & departure scheduling of flights Question employee scheduling crew rostering on flights Find an assignment of time points to activities satisfying the constraints and an assignment of resources to activities meeting the educational timetabling requirements such that the cost is minimized timetables at schools and universities scheduling is about deciding assembly system scheduling when who performs what in a cost optimal way. production planning for carsEASSS Valencia May 2012 7 EASSS Valencia May 2012 8 Scheduling: examples Scheduling: examples project planning & scheduling project planning & scheduling planning of activities to be executed planning of activities to be executed in software projects in software projects machine scheduling machine scheduling allocation of jobs to processors allocation of jobs to processors transportation scheduling transportation scheduling arrival & departure scheduling of flights arrival & departure scheduling of flights employee scheduling employee scheduling crew rostering on flights crew rostering on flights educational timetabling educational timetabling timetables at schools and universities timetables at schools and universities assembly system scheduling assembly system scheduling production planning for cars production planning for carsEASSS Valencia May 2012 9 EASSS Valencia May 2012 10 Scheduling: examples Scheduling: examples project planning & scheduling project planning & scheduling planning of activities to be executed planning of activities to be executed in software projects in software projects machine scheduling machine scheduling allocation of jobs to processors allocation of jobs to processors transportation scheduling transportation scheduling arrival & departure scheduling of flights arrival & departure scheduling of flights employee scheduling employee scheduling crew rostering on flights crew rostering on flights educational timetabling educational timetabling timetables at schools and universities timetables at schools and universities assembly system scheduling assembly system scheduling production planning for cars production planning for carsEASSS Valencia May 2012 11 EASSS Valencia May 2012 12
  3. 3. Scheduling: examples Scheduling: more details project planning & scheduling planning of activities to be executed in software projects 1. there is a set of activities Ac and for every task a∈Ac there is a release time r(a)∈Z+, a deadline d(a)∈Z+ and a length l(a)∈Z+. machine scheduling allocation of jobs to processors Example transportation scheduling Suppose that r(a) = 5, d(a) = 9 and l(a) = 2. Then arrival & departure scheduling of flights • we have to start a after t=5 • we have to start a before t=7 employee scheduling crew rostering on flights educational timetabling timetables at schools and universities assembly system scheduling production planning for carsEASSS Valencia May 2012 13 EASSS Valencia May 2012 14 Scheduling: more details Scheduling: more details 1. there is a set of activities Ac and for every task a∈Ac there is 1. there is a set of activities Ac and for every task a∈Ac there is a release time r(a)∈Z+, a deadline d(a)∈Z+ and a length l(a)∈Z+. a release time r(a)∈Z+, a deadline d(a)∈Z+ and a length l(a)∈Z+. 2. there is a partial precedence order < defined on Ac. 2. there is a partial precedence order < defined on A. 3. there is a set R of (renewable) resources. Example - for each r∈R its finite capacity cap(r) is known. if t < t’ , in every valid schedule t has to finish before t’ - for each task a and each resource r, req(a,r) can be started. specifies the amount of r that a needs. Example if cap(r) = 3 and req(a,r) = req(a’,r) = 2, then a and a’ cannot be scheduled concurrently.EASSS Valencia May 2012 15 EASSS Valencia May 2012 16 Scheduling: more details Scheduling: more details 1. there is a set of activities Ac and for every task a∈Ac there is 1. there is a set of activities Ac and for every task a∈Ac there is a release time r(a)∈Z+, a deadline d(a)∈Z+ and a length l(a)∈Z+. time a release time r(a)∈Z+, a deadline d(a)∈Z+ and a length l(a)∈Z+. time constraints constraints 2. there is a partial precedence order < defined on A. 2. there is a partial precedence order < defined on A. 3. there is a set R of (renewable) resources. 3. there is a set R of (renewable) resources. - for each r∈R its finite capacity cap(r) is known. resource - for each r∈R its finite capacity cap(r) is known. resource - for each task a and each resource r, req(a,r) constraints - for each task a and each resource r, req(a,r) constraints specifies the amount of r that a needs. specifies the amount of r that a needs. 4. we have to find a schedule, that is an assignment of 4. we have to find a schedule, that is an assignment of start times to tasks such that every constraint is satisfied start times to tasks such that every constraint is satisfied (and often some optimization objective is optimized) (and often some optimization objective is optimized) This problem is known as the Resource Constrained Project Scheduling Problem (RCPSP) This problem is known as the Time Constrained Project Scheduling Problem (TCPSP)EASSS Valencia May 2012 17 EASSS Valencia May 2012 18
  4. 4. TCPSP: Simple example TCPSP: Simple example given: set Ac of activities ai with asked for: schedule for activities, given: set Ac of activities ai with asked for: schedule for activities, release times, durations, deadlines & respecting all constraints release times, durations, deadlines & respecting all constraints precedences precedences ( 0, 6, 12 ) ( 6, 7, 14 ) ( 6, 7, 14 ) a1 a3 a3 ( 0, 6, 12 ) a1 ( 0, 4, 5 ) ( 0, 10, ∞ ) ( 0, 4, 5 ) ( 0, 7, ∞ ) 0 6 a2 a4 a2 a4 ( 1, 10, 20 ) precedence relation ( 1, 10, 20 ) precedence relation a5 a5 0 5 10 15 20 0 5 10 15 20 ( r(a), l(a), d(a) ) ( r(a), l(a), d(a) )EASSS Valencia May 2012 19 EASSS Valencia May 2012 20 TCPSP: Simple example TCPSP: Simple example given: set Ac of activities ai with asked for: schedule for activities, given: set Ac of activities ai with asked for: schedule for activities, release times, durations, deadlines & respecting all constraints release times, durations, deadlines & respecting all constraints precedences precedences ( 0, 6, 12 ) ( 6, 7, 14 ) ( 0, 6, 12 ) ( 6, 7, 14 ) a1 a3 a1 a3 ( 0, 4, 5 ) ( 0, 7, ∞ ) ( 0, 7, ∞ ) 0 6 13 0 6 13 a2 a4 a4 ( 0, 4, 5 ) ( 1, 10, 20 ) precedence relation ( 1, 10, 20 ) precedence relation a2 a5 a5 0 4 0 5 10 15 20 0 5 10 15 20 ( r(a), l(a), d(a) )EASSS Valencia May 2012 21 EASSS Valencia May 2012 22 TCPSP: Simple example TCPSP: Simple example given: set Ac of activities ai with asked for: schedule for activities, given: set Ac of activities ai with asked for: schedule for activities, release times, durations, deadlines & respecting all constraints release times, durations, deadlines & respecting all constraints precedences precedences ( 0, 6, 12 ) ( 6, 7, 14 ) ( 0, 6, 12 ) ( 6, 7, 14 ) a1 a3 a1 a3 ( 0, 7, ∞ ) ( 0, 7, ∞ ) 0 6 13 0 6 13 a4 a4 ( 0, 4, 5 ) ( 0, 4, 5 ) ( 1, 10, 20 ) ( 1, 10, 20 ) precedence relation a2 precedence relation a2 a5 a5 0 4 0 4 14 0 5 10 15 20 0 5 10 15 20EASSS Valencia May 2012 23 EASSS Valencia May 2012 24
  5. 5. TCPSP: Simple example TCPSP: multi-agent variant given: set Ac of activities ai with asked for: schedule for activities, Given release times, durations, deadlines & respecting all constraints • a set of activities Ac with release, duration and deadline constraints precedences • a precedence ordering < defined on Ac • a set of agents A to execute the activities • for each agent Ai a disjoint subset Aci of activities assigned to it. ( 0, 6, 12 ) ( 6, 7, 14 ) a1 a3 Question 0 6 13 Find a schedule for the set of activities Aci to be performed by agent Ai ( 0, 4, 5 ) ( 1, 10, 20 ) ( 0, 7, ∞ ) such that all constraints are satisfied. a2 a5 a4 0 4 14 21 0 5 10 15 20EASSS Valencia May 2012 25 EASSS Valencia May 2012 26 TCPSP: multi-agent variant MA-TCPSP: example Given given: set Ac of activities ai with asked for: schedule for activities, • a set of activities Ac with release, duration and deadline constraints; release times, durations, deadlines & respecting all constraints • a precedence ordering < defined on Ac; precedences • a set of agents A to execute the activities; • for each agent Ai a disjoint subset Aci of activities assigned to it. ( 0, 6, 12 ) ( 6, 7, 14 ) a1 a3 ( 0, 6, 12 ) ( 6, 7, 14 ) Question a1 a3 ( 0, 4, 5 ) ( 0, 10, ∞ ) Find a schedule for the set of activities Aci to be performed by agent Ai 0 6 13 a2 a4 such that all constraints are satisfied. ( 0, 4, 5 ) ( 1, 10, 20 ) ( 0, 7, ∞ ) ( 1, 10, 20 ) precedence relation a2 a5 a4 Solution a5 0 4 14 21 - Create a schedule for the set of activities Aci of the underlying TCPSP; 0 5 10 15 20 - distribute the schedule found over the agents Ai. assigned to agent A1 assigned to agent A2EASSS Valencia May 2012 27 EASSS Valencia May 2012 28 MA-TCPSP: example MA-TCPSP: example given: set Ac of activities ai with asked for: schedule for activities, given: set Ac of activities ai with asked for: schedule for activities, release times, durations, deadlines & respecting all constraints release times, durations, deadlines & respecting all constraints precedences precedences ( 0, 6, 12 ) ( 0, 7, ∞ ) ( 0, 6, 12 ) ( 6, 7, 14 ) ( 0, 6, 12 ) ( 6, 7, 14 ) A1 a1 a4 a1 a3 ( 0, 6, 12 ) ( 6, 7, 14 ) a1 a3 0 6 14 21 a1 a3 ( 0, 4, 5 ) ( 0, 10, ∞ ) ( 0, 4, 5 ) ( 0, 10, ∞ ) ( 6, 7, 14 ) 0 6 13 a3 a2 a4 a2 a4 ( 0, 4, 5 ) ( 1, 10, 20 ) ( 0, 7, ∞ ) 13 ( 0, 4, 5 ) ( 1, 10, 20 ) ( 1, 10, 20 ) precedence relation a2 a5 a4 ( 1, 10, 20 ) precedence relation A2 a2 a5 a5 0 4 14 21 a5 0 4 14 0 5 10 15 20 0 5 10 15 20 assigned to agent A1 assigned to agent A1 assigned to agent A2 assigned to agent A2EASSS Valencia May 2012 29 EASSS Valencia May 2012 30
  6. 6. MA-TCPSP: example Multi-agent scheduling (i) given: set Ac of activities ai with asked for: schedule for activities, Given release times, durations, deadlines & respecting all constraints • a set of activities Ac with release, duration and deadline constraints precedences • a precedence ordering < defined on Ac ( 0, 6, 12 ) ( 0, 7, ∞ ) • a set of agents A to execute the activities ( 0, 6, 12 ) ( 6, 7, 14 ) • for each agent Ai a disjoint subset Aci of activities assigned to it. A1 a1 a4 a1 a3 0 6 14 21 ( 6, 7, 14 ) Question ( 0, 4, 5 ) ( 0, 10, ∞ ) a4 a3 Find a schedule for the set of activities Aci to be performed by agent Ai a2 13 such that all constraints are satisfied. ( 0, 4, 5 ) ( 1, 10, 20 ) ( 1, 10, 20 ) precedence relation A2 a2 a5 Note a5 0 4 14 The solution proposed is a centralized & dictatorial view on 0 5 10 15 20 MAS: assigned to agent A1 - each agent receives a fixed schedule, assigned to agent A2 - none of the agents is free to determine its own preferred scheduleEASSS Valencia May 2012 31 EASSS Valencia May 2012 32 Multi-agent scheduling (ii) Contents Part 1 Given • a set of activities Ac with release, duration and deadline constraints 1. Introduction: Agent Coordination in Scheduling • a precedence ordering < defined on Ac basic scheduling concepts; • a set of agents A to execute the activities introduction to autonomous scheduling. • for each agent Ai a disjoint subset Aci of activities assigned to it. Question 2. Theory: temporal schedules in Simple Temporal Plans simple temporal plans (STPs); Find a schedule for the set of activities Aci to be performed by agent Ai such that all constraints are satisfied. determining consistency of an STP; finding solutions for an STP; Our problem (agent coordination) temporal decoupling in STPs. find a coordination mechanism ensuring that 3. Application: coordination of schedules at airports - each agent is able to determine its own local schedule; temporal decoupling applied to - a simple merge of all these local schedules constitutes always the turnaround process at airports. a global schedule satisfying all the constraints.EASSS Valencia May 2012 33 EASSS Valencia May 2012 34 Simple Temporal Plans From TCPSP to STP TCPSP STP We discuss TCPSPs using a special constraint representation that allows for efficient solution finding. 1. there is a set of activities Ac and for 1. for every activity a∈Ac there are every activity a∈Ac there is a release two time variables ta and t’a This constraint system allows only time r(a), a deadline d(a) and the following constraints: binary constraints of the form t’ - t ≤ d and a length l(a). - ta ≤ r(a) between time points t associated with activities a. ta - t’a ≤ -l(a) t’a - ta ≤ l(a) Constraint systems containing t’a ≤ d(a) - a set of time points 2. there is a partial precedence order 2. for every pair ai < aj, there exists - and a set of such binary difference constraints < defined on Ac a constraint t’ai - taj ≤ 0 are known as Remark 1 Simple Temporal Plans Usually there is a fixed time reference point z = 0. Then every constraint can be written as a binary constraint: - ta ≤ r(a) => z - ta ≤ r(a); t’a ≤ d(a) => t’a - z ≤ d(a)EASSS Valencia May 2012 35 EASSS Valencia May 2012 36
  7. 7. From TCPSP to STP Small example Two trains A and B meet each other at a platform. TCPSP STP Train A arrives at 12.00 hrs and stops at most 5 minutes. Train B must arrive at least 2 minutes later than A, and 1. there is a set of activities Ac and for 1. for every activity a∈Ac there are must leave within 3 minutes after A leaves. every activity a∈Ac there is a release two time variables ta and t’a and the following constraints: B stays at most 7 minutes and at least 2 minutes. time r(a), a deadline d(a) When does A leave, B arrive and B leave? and a length l(a). - ta ≤ r(a) ta - t’a ≤ -l(a) t’a - ta ≤ l(a) B t’a ≤ d(a) 2. there is a partial precedence order 2. for every pair ai < aj, there exists < defined on Ac a constraint t’ai - taj ≤ 0 A Remark 2 Sometimes the length l(a) of activity a is a variable constrained by l1 ≤ l(a) ≤ l2 Such a constraint can be translated to the following pair of STN constraints: ta - t’a ≤ -l1 and t’a - ta ≤ l2EASSS Valencia May 2012 37 EASSS Valencia May 2012 38 Small example Small example Two trains A and B meet each other at a platform. Two trains A and B meet each other at a platform. Train A arrives at 12.00 hrs and stops at most 5 minutes. Train A arrives at 12.00 hrs and stops at most 5 minutes. Train B must arrive at least 2 minutes later than A, and Train B must arrive at least 2 minutes later than A, and must leave within 3 minutes after A leaves. must leave within 3 minutes after A leaves. B stays at most 7 minutes and at least 2 minutes. B stays at most 7 minutes and at least 2 minutes. When does A leave, B arrive and B leave? When does A leave, B arrive and B leave? time points time points tA, tB : arrival of A, B z0 : time reference tA, tB : arrival of A, B z0 : time reference STP t’A, t’B : departure of A, B t’A, t’B : departure of A, B This is the standard representation in constraints constraints Simple z0 = 0 tB - tA ≥ 2 transforming constraints z0 = 0 t’A - tA ≤ 5 t’B - t’A ≤ 3 to standard form Temporal 0 ≤ tA - z0 ≤ 0 t’B - t’A ≤ 3 tj - ti ≤ aij tA - z0 ≤ 0 tA - t’A ≤ 0 t’B - tB ≤ 7 Plans 0 ≤ t’A - tA ≤ 5 2 ≤ t’B - tB ≤ 7 z0 - tA ≤ 0 tA - tB ≤ -2 tB - t’B ≤ -2EASSS Valencia May 2012 39 EASSS Valencia May 2012 40 Simple Temporal Plans Simple Temporal Plans A Simple Temporal Plan (STP) is a tuple S = ( T, C ) An STN S =(T,C) can also be represented by a labeled directed graph where GS = ( T, E, l ) labeled edge - T is a set of time-points and called a Simple Temporal Network (STN) δ - C is a set of binary constraints of the form t’ - t ≤ δ, δ being an arbitrary constant Nodes are time points, labeled edges are derived from constraints: t’ - t ≤ δ t t’ constraint Simple Temporal Plan Simple Temporal Plan S = ( T, C ) S = ( T, C ) T = {z0, tA, tB, t’A, t’B } T = {z0, tA, tB, t’A, t’B } C = { z0 = 0 t’A - tA ≤ 5 t’B - t’A ≤ 3 C = { z0 = 0 t’A - tA ≤ 5 t’B - t’A ≤ 3 tA - z0 ≤ 0 tA - t’A ≤ 0 t’B - tB ≤ 7 tA - z0 ≤ 0 tA - t’A ≤ 0 t’B - tB ≤ 7 z0 - tA ≤ 0 tA - tB ≤ -2 tB - t’B ≤ -2 } z0 - tA ≤ 0 tA - tB ≤ -2 tB - t’B ≤ -2EASSS Valencia May 2012 41 EASSS Valencia May 2012 42
  8. 8. Simple Temporal Network STP: solution & consistency An STN S =(T,C) can also be represented by a labeled directed graph A solution to an STP S = (T, C) is an assignment { ti = vi : ti ∈ T } GS = ( T, E, l ) of values to variables that satisfies all constraints. called a Simple Temporal Network (STN) or Distance Graph Nodes are time points, labeled edges are derived from constraints: t’ - t ≤ δ t δ t’ • the set of solutions of S is denoted as Sol(S) Note that a solution in fact is a • S is consistent iff Sol(S) ≠ ∅ schedule if we use an STP to specify a scheduling problem Simple Temporal Plan Simple Temporal Network • S equivalent to S’ iff Sol(S) = Sol(S’) z0 = 0 z0 = 0 S = ( T, C ) Solution 1: 0 0 T = {z0, tA, tB, t’A, t’B } 0 0 z0 = 0 tA 5 t’A t’A = 1 tA = 0 C = { z0 = 0 tA = 0 5 t’A - tA ≤ 5 t’B - t’A ≤ 3 t’A = 1 0 0 tA - z0 ≤ 0 tA - t’A ≤ 0 t’B - tB ≤ 7 tB = 2 -2 3 -2 3 t’B = 4 z0 - tA ≤ 0 tA - tB ≤ -2 tB - t’B ≤ -2 7 tB t’B 7 2 = tB t’B = 4 -2 -2EASSS Valencia May 2012 EASSS Valencia May 2012 44 =4 STP: solution & consistency STP: solution to example Two trains A and B meet each other at a platform. A solution to an STP S = (T, C) is an assignment { ti = vi : ti ∈ T } Train A arrives at 12.00 hrs and stops at most 5 minutes. of values to variables that satisfies all constraints. Train B must arrive at least 2 minutes later than A, and • the set of solutions of S is denoted as Sol(S) must leave within 3 minutes after A leaves. • S is consistent iff Sol(S) ≠ ∅ B stays at most 7 minutes and at least 2 minutes. • S equivalent to S’ iff Sol(S) = Sol(S’) When does A leave, B arrive and B leave? z0 = 0 z0 Solution 1: Solution 2: Solution 1: Solution 2: 0 0 z0 = 0 z0 = 0 0 0 z0 = 0 z0 = 0 tA = 0 tA = 0 tA = 0 tA = 0 tA = 0 5 t’A = 5 tA 5 t’A t’A = 1 t’A = 5 t’A = 1 t’A = 5 0 tB = 2 tB = 6 0 tB = 2 tB = 6 -2 3 t’B = 4 t’B = 8 -2 3 t’B = 4 t’B = 8 7 7 A leaves at 12.01, A leaves at 12.05, 6 = tB t’B = 8 tB t’B B arrives at 12:02, B arrives at 12:06, -2 -2 B leaves at 12:04 B leaves at 12:08EASSS Valencia May 2012 45 EASSS Valencia May 2012 46 =4 =4 STP: solution to example Two trains A and B meet each other at a platform. Train A arrives at 12.00 hrs and stops at most 5 minutes. Train B must arrive at least 2 minutes later than A, and must leave within 3 minutes after A leaves. B stays at most 7 minutes and at least 2 minutes. When does A leave, B arrive and B leave? Two important questions to be answered z0 • how to determine consistency… Solution 2: Solution 1: Checking consistency in STP 0 0 • how to find solutions…= 0 z0 z0 = 0 t’A tA = 0 tA = 0 tA 5 t’A = 1 t’A = 5 0 tB = 2 tB = 6 -2 3 t’B = 4 t’B = 8 7 A leaves at 12.01, A leaves at 12.05, tB t’B B arrives at 12:02, B arrives at 12:06, -2 B leaves at 12:04 B leaves at 12:08EASSS Valencia May 2012 47 EASSS Valencia May 2012 48
  9. 9. z0 z0 implied constraints 0 0 implied constraints 0 0 explicit constraints can be combined to imply explicit constraints can be combined to imply other constraints: tA t’A other constraints: tA t’A 5 5 0 0 constraints some implied constraints constraints some implied constraints -2 3 -2 3 1 t’A - tA ≤ 5 t’B - tB = (t’B - t’A )+ (t’A - tA )+ (tA - tB ) 6 7 t’A - tA ≤ 5 t’B - tB = (t’B - t’A )+ (t’A - tA )+ (tA - tB ) 6 7 tB t’B tB t’B tA - tB ≤ -2 ≤ 3 + 5 + -2 tA - tB ≤ -2 ≤ 3 + 5 + -2 -2 -2 = 6 = 6 tB - t’B ≤ -2 Note that the tB - t’B ≤ -2 implied constraint Look at the labels of the t’B - t’A ≤ 3 t’B - t’A ≤ 3 t’A - t’B = (t’A - tA )+ (tA - tB )+ (tB - t’B ) is stronger, replacing edges as distances between shortest paths can be ≤ 5 + -2 + -2 t’B - tB ≤ 7 the original constraint the corresponding nodes. t’B - tB ≤ 7 computed between any = 1 pair of nodes in the STN Finding a tighter constraint comes down to finding a strongest constraints in STP shorter path! correspond to shortest paths in STNEASSS Valencia May 2012 49 EASSS Valencia May 2012 50 z0 z0 implied constraints 0 0 Distance Matrix 0 0 explicit constraints can be combined to imply other constraints: tA t’A Strongest constraints in STP tA t’A 5 5 correspond to shortest paths in STN. 0 constraints some implied constraints -2 3 1 GS : -2 3 The distance matrix DS for an STN t’A - tA ≤ 5 t’B - tB = (t’B - t’A )+ (t’A - tA )+ (tA - tB ) 6 7 S = (T, C) is defined as: 7 tB t’B tB t’B tA - tB ≤ -2 ≤ 3 + 5 + -2 -2 -2 = 6 D(ti, tj) = length of shortest path from tB - t’B ≤ -2 z0 tA t’A tB t’B ti to tj in the distance graph of S z0 tA t’A tB t’B or t’B - t’A ≤ 3 t’A - t’B = (t’A - tA )+ (tA - tB )+ (tB - t’B ) z0 0 0 5 6 8 z0 0 0 5 6 8 ∞ if no such path exists ≤ 5 + -2 + -2 t’B - tB ≤ 7 = 1 tA 0 0 5 6 8 Given the distance graph GS there tA 0 0 5 6 8 are well-known efficient algorithms t’A -1 -1 0 1 3 t’A -1 -1 0 1 3 strongest constraints in STP to compute the distance matrix D. D: correspond to shortest paths in STN tB -2 -2 3 0 6 tB -2 -2 3 0 6 Example: all-pairs shortest path algorithm table of all shortest paths between nodes t’B -4 -4 1 -2 0 Floyd-Warshall: O(n3) t’B -4 -4 1 -2 0EASSS Valencia May 2012 51 EASSS Valencia May 2012 52 checking consistency STN S minimal STN S’ z0 z0 8 0 0 equivalent systems -1 -4 0 0 Given an STP S with its graph GS and distance graph DS, the following statements are tA t’A 5 equivalent: 5 6 tA t’A -2 5 - S is consistent -2 3 - DS has no negative entries on its diagnonal this property can be Sol(S) = Sol(S’) -2 6 -1 3 checked in O(n3) 7 1 - GS has no negative cycles tB t’B 6 -2 tB t’B -2 constraint matrix distance matrix original constraint matrix distance matrix D = [d(t,t’)] z0 tA t’A tB t’B D: z0 tA t’A tB t’B z0 tA t’A tB t’B z0 tA t’A tB t’B S is consistent z0 0 0 5 ∞ ∞ z0 0 0 5 6 8 z0 0 0 5 ∞ ∞ z0 0 0 5 6 8 tA 0 0 5 6 8 tA 0 0 5 6 8 tA 0 0 5 6 8 tA 0 0 5 6 8 t’A ∞ ∞ 0 ∞ 3 t’A -1 -1 0 1 3 t’A ∞ ∞ 0 ∞ 3 t’A -1 -1 0 1 3 all-pairs shortest tB all-pairs shortest tB tB ∞ -2 ∞ 0 7 -2 -2 3 0 6 tB ∞ -2 ∞ 0 7 -2 -2 3 0 6 path computation path computation t’B ∞ ∞ ∞ -2 0 t’B -4 -4 1 -2 0 t’B ∞ ∞ ∞ -2 0 O(n3) t’B -4 -4 1 -2 0EASSS Valencia May 2012 53 EASSS Valencia May 2012 54
  10. 10. finding solutions Given an STN S with its distance graph DS, if DS does not contain negative diagonal elements, then - the set { ti = D(z0, ti) : i=1,2, … n} ∪ {z0 = 0} is a solution - the set { ti = -D(ti, z0) : i=1,2, … n} ∪ {z0 = 0} is also a solution Why Finding solutions in STP original constraint matrix distance matrix D = [d(t,t’)] z0 tA t’A tB t’B z0 tA t’A tB t’B two solutions z0 0 0 5 ∞ ∞ z0 0 0 5 6 8 tA 0 0 5 6 8 tA 0 0 5 6 8 t’A ∞ ∞ 0 ∞ 3 t’A -1 -1 0 1 3 tB ∞ -2 ∞ 0 7 all-pairs shortest tB -2 -2 3 0 6 path computation t’B ∞ ∞ ∞ -2 0 O(n3) t’B -4 -4 1 -2 0EASSS Valencia May 2012 55 EASSS Valencia May 2012 56 finding solutions general recipe for solutions Given an STN S with its distance graph D, if D does not contain negative diagonal sol := ∅ elements, while T ≠ ∅ - the set { ti = D(z0, ti) : i=1,2, … n} ∪ {z0 = 0} is a solution select some t and v ∈ [-D(t,z0), D(z0,t)] add constraint {t = v} to STN and update the distance matrix D; - the set { ti = -D(ti, z0) : i=1,2, … n} ∪ {z0 = 0} is a solution remove row and column t from D; sol := sol ∪ {t=v} Why Take an arbitrary constraint t’ - t ≤ δ. distance matrix D = [d(t,t’)] distance matrix D = [D(t,t’)] We have D(z0,t’) ≤ D(z0,t) + D(t,t’) ≤ D(z0,t) + δ z0 tA t’A tB t’B z0 tA t’A tB t’B Hence, D(z0,t’) - D(z0,t) ≤ δ. start with tA ∈ [ 0,0] ; add tA = 0 z0 0 0 5 6 8 z0 0 0 5 6 8 So the first set of solutions satisfies every constraint. Likewise, tA 0 0 5 6 8 tA 0 0 5 6 8 D(t,z0) ≤ D(t,t’) + D(t’,z0) ≤ δ+ D(t’,z0) t’A -1 -1 0 1 3 t’A -1 -1 0 1 3 Hence, -D(t’,z0) + -D(t,z0) ≤ δ tB tB -2 -2 3 0 6 -2 -2 3 0 6 So the second set of solutions satisfies every constraint. t’B -4 -4 1 -2 0 t’B -4 -4 1 -2 0EASSS Valencia May 2012 57 EASSS Valencia May 2012 58 general recipe for solutions general recipe for solutions sol := ∅ sol := ∅ while T ≠ ∅ while T ≠ ∅ select some t and v ∈ [-D(t,z0), D(z0,t)] select some t and v ∈ [-D(t,z0), D(z0,t)] add constraint {t = v} to STN and update the distance matrix D; add constraint {t = v} to STN and update the distance matrix D; remove row and column t from D; remove row and column t from D; sol := sol ∪ {t=v} sol := sol ∪ {t=v} distance matrix D = [D(t,t’)] distance matrix D = [D(t,t’)] z0 tA t’A tB t’B z0 tA t’A tB t’B start with tA ∈ [ 0,0] ; add tA = 0 start with tA ∈ [ 0,0] ; add tA = 0 z0 0 5 6 8 z0 0 5 4 6 8 take tB ∈ [ 2, 6 ] ; add tB = 4; update take tB ∈ [ 2, 6 ] ; add tB = 4; update tA tA t’A -1 0 1 3 t’A -1 0 1 3 tB -2 3 0 6 tB -4 -2 3 0 6 t’B -4 1 -2 0 t’B -4 1 -2 0EASSS Valencia May 2012 59 EASSS Valencia May 2012 60

×