310 likes | 475 Views
10/27. Exam post-mortem Phased-relaxation approach Order generalization (Partialization) Temporal Networks. Phased Relaxation in SAPA. Adjusting the Heuristic Values.
E N D
10/27 Exam post-mortem Phased-relaxation approach Order generalization (Partialization) Temporal Networks
Adjusting the Heuristic Values Ignored resource related information can be used to improve the heuristic values (such like +ve and –ve interactions in classical planning) Adjusted Cost: C = C + R (Con(R) – (Init(R)+Pro(R)))/R * C(AR) Cannot be applied to admissible heuristics Similar phased relaxation is also applied to negative interactions
SAPA converts its position constrained plans to order constrained plans A position-constrained plan with makespan 22 A1(10) gives g1 but deletes p at the start A3(8) gives g2 but requires p at start A2(4) gives p at end We want g1,g2 A1 A2 A3 p Order Constrained plan The best makespan dispatch of the order-constrained plan A2 g2 ~p A3 G A2 A3 14+e A1 A1 g1 There could be multiple O.C. plans because of multiple possible causal sources. Optimization will involve Going through them all. [et(A1) <= et(A2)] or [st(A1) >= st(A3)] [et(A2) <= st(A3) ….
Order generalization as Explanation-based learning • The order generalization (partialization) in the previous slide is an example of Explanation-based learning • The idea is to “explain” (prove) why an example (in our case, a specific plan) is an instance of a concept (in our case, “a correct solution plan”), and realize that only the aspects of the example that took part in the proof/explanation are relevant (needed) for the proof to proceed. • The explanation is done with respect to some background domain theory (in our case, the theory is the theory of what makes a plan “correct”—which is given by the causal proof). • If the background theory is incorrect, then explanation will be incorrect too (and you will learn superstitions ;-) • Sometimes, background theory may be partial (correct but incomplete). For example, you may not know how to explain why the example is an instance of the concept—but may know that certain attributes qualitatively influence (determine) certain class labels • E.g. you get down at Sao Paolo, Brazil and the first three people you see • Are speaking portugese • Are wearing red shirts • You induce that Brazilians speak Portugese, but you don’t induce that Brazilians all wear red clothes. This is because you think nationality does determine language, but does not determine color of clothes. • EBL can be used in conjunction with inductive learning. EBL can pick the relevant attributes over which you then do your induction • Recall that one major headache in many classification learning strategies is the issue of irrelevant attributes. The domain theory and EBL analysis can help you identify relevant attributes over which to do learning
A3 A1 A2 Q At(truck,B) Drive(cityA,cityB) Plan representation Is this representation general? An executable plan must provide -- the actions that need to be executed -- the start times for each of the actions Or a set of simple temporal constraints on the set of actions (S.T.C. are generalization of partial orders) E.g. A1—[4,5]A2 (means 4 <= ST(A2) – ST(A1) <= 5 ) Plan views: Pert and Gantt charts GANTT Chart is what is shown on the right PERT shows the Causal links
Qualitative Temporal Constraints(Allen 83) • y after x • y met-by x • y overlapped-by x • y contains x • y started-by x • y finished-by x • y equals x • x before y • x meets y • x overlaps y • x during y • x starts y • x finishes y • x equals y X Y X Y X Y Y X Y X Y X Y X
Intervals can be handled directly • The 13 in the previous page are primitive relations. The relation between a pair of intervals may well be a disjunction of these primitive ones: • A meets B OR A starts B • There are “transitive” axioms for computing the relations between A and C, given the relations between A and B & B and C • A meets B & B starts C => A starts C • A starts B & B during C => ~ [C before A] • Using these axioms, we can do constraint propagation directly on interval relations; to check for tight relations among any given pair of relations (as well as consistency of a set of relations) • Allen’s Interval Algebra • Intervals can also be handled in terms of their start and end points. This latter is what we will see next.
Qualitative Temporal ConstraintsMaybe Expressed as Inequalities (Vilain, Kautz 86) • x before y X+ < Y- • x meets y X+ = Y- • x overlaps y (Y- < X+) & (X- < Y+) • x during y (Y- < X-) & (X+ < Y+) • x starts y (X- = Y-) & (X+ < Y+) • x finishes y (X- < Y-) & (X+ = Y+) • x equals y (X- = Y-) & (X+ = Y+) Inequalities may be expressed as binary interval relations: X+ - Y- < [-inf, 0]
Metric Constraints • Going to the store takes at least 10 minutes and at most 30 minutes. • 10 < [T+(store) – T-(store)] < 30 • Bread should be eaten within a day of baking. • 0 < [T+(baking) – T-(eating)] < 1 day • Inequalities, X+ < Y- , may be expressed as binary interval relations: • - inf < [X+ - Y-] < 0
Jerseyvotes Incumbent rule 11/1: Temporal Networks Scheduling Median Outcome Turnout The Cell-phone correction
Metric Time: Quantitative Temporal Constraint Networks(Dechter, Meiri, Pearl 91) • A set of time points Xi at which events occur. • Unary constraints (a0< Xi < b0 ) or (a1< Xi < b1 ) or . . . • Binary constraints (a0< Xj -Xi < b0 ) or (a1< Xj -Xi < b1 ) or . . . Not n-ary constraints
TCSPs vs CSPs • TCSP is a subclass of CSPs with some important properties • The domains of the variables are totally ordered • The domains of the variables are continuous • Most queries on TCSPs would involve reasoning over all solutions of a TCSP (e.g. earliest/latest feasible time of a temporal variable) • Since there are potentially an infinite number of solutions to a TCSP, we need to find a way of representing the set of all solutions compactly • Minimal TCSP network is such a representation
[30,40] [10,20] [60,inf] 0 1 3 [10,20] 2 4 [20,30] [40,50] [60,70] TCSP Are Visualized UsingDirected Constraint Graphs
TCSP Queries(Dechter, Meiri, Pearl, AIJ91) • Is the TCSP consistent?Planning • What are the feasible times for each Xi? • What are the feasible durations between each Xi and Xj? • What is a consistent set of times?Scheduling • What are the earliest possible times?Scheduling • What are the latest possible times? All of these can be done if we compute the minimal equivalent network
Minimal Networks • A TCSP N1 is considered minimal network if there is no other network N2 that has the same solutions as N1, and has at least one tighter constraint than N1 • Tightness means there are fewer valid composite labels for the variables. This has nothing to do with the “syntactic complexity” of the constraint • A Constraint a[ 1 3]b is tighter than a constraint a[0 10]b • A constraint a[1 1.5][1.6 1.9][1.9 2.3] [2.3 4.8] [5 6]b is tighter than a constraint a[0 10]b • Computation of minimal networks, in general, involves doing two operations: • Intersection over constraints • Composition over constraints • For each path p in the network, connecting a pair of nodes a and b, find the path constraint between a and b (using composition) • Intersect all the constraints between a pair of nodes a and b to find the tightest constraint between a and b • Can lead to “fragmentation of constraints” in the case of disjunctive TCSPs…
Operations on Constraints: Intersection And Composition Compose [10,20] with [30,40][60,inf] to get constraint between 0 and 3
An example where minimal network is different from the original one. [40,60] [10,20] [30,40] [10,20] [30,40] 0 1 3 0 1 3 [0,100] [0,100] To compute the constraint between 0 and 3, we first compose [10,20] and [30,40] to get [40,60] we then intersect [40,60] and [0,100] to get [40,60]
Computing Minimal Network for a STP • Minimal networks for STPs can be computed by ensuring “path consistency” • For each triple of vertices i,j,k • C(i,k) := C(i,k) .intersection. [C(i,j) .compose. C(j,k)] • For STP’s we are guaranteed to reach fixpoint by the time we visit each constraint once. • An alternative is to convert STP to a distance graph and do All pairs shortest path algorithm
20 40 0 1 3 -10 [10,20] -30 [30,40] 0 1 3 -10 20 [10,20] 50 2 4 -40 2 4 -60 [40,50] 70 [60,70] To Query an STN Map to aDistance Graph Gd = < V,Ed > Edge encodes an upper bound on distance to target from source. Xj - Xi£ bij Xi - Xj£ - aij Tij = (aij£ Xj - Xi£ bij)
Conjoined Paths are Computed using All Pairs Shortest Path(e.g., Floyd-Warshall’s algorithm ) 1. for i := 1 to n do dii 0; 2. for i, j := 1 to n do dij aij; 3. for k := 1 to n do 4. for i, j := 1 to n do 5. dij min{dij, dik + dkj}; k i j
20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph Shortest Paths of Gd
STN Minimum Network d-graph STN minimum network
Disjunctive TCSPs • Suppose we have a TCSP, where just one of the constraints is dijunctive: a [1 2][5 6] b • We have two STPs one in which the constraint a[1 2]b is there and the other contains a[5 6]b • Disjunctive TCSP’s can be solved by solving the exponential number of STPs • Minimal network for DTP is the union of minimal networks for the STPs • This is a brute-force method; Exponential number of STPs—many of which have significant overlapping constraints. • There are better approaches that work directly on DTPs [Decther, Schwalb, 97] • Scheduling can be seen as solving a DTP (the disjunction is induced because of the resource contention constraints)
20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 Testing Plan Consistency No negative cycles: -5 > TA– TA = 0 d-graph
Latest Solution Node 0 is the reference. 20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph
Earliest Solution Node 0 is the reference. 20 40 0 1 2 -10 -30 -10 20 50 3 4 -40 -60 70 d-graph
Solution: Earliest Times S1 = (-d10, . . . , -dn0) 20 40 0 1 3 -10 -30 -10 20 50 2 4 -40 -60 70
Scheduling:Feasible Values Latest Times • X1 in [10, 20] • X2 in [40, 50] • X3 in [20, 30] • X4 in [60, 70] Earliest Times d-graph
O(N2) Solution by Decomposition • Select value for 1 • 15 • Select value for 2, consistent with 1 • 45 • Select value for 3, consistent with 1 & 2 • 30 d-graph • Select value for 4, consistent with 1,2 & 3