Presentation is loading. Please wait.

Presentation is loading. Please wait.

4/15: LPG contd. And Temp. constraint networks. --~30 min of LPG discussion --Temporal constraint networks --Next class: Read Scheduling paper --Next Week:

Similar presentations


Presentation on theme: "4/15: LPG contd. And Temp. constraint networks. --~30 min of LPG discussion --Temporal constraint networks --Next class: Read Scheduling paper --Next Week:"— Presentation transcript:

1 4/15: LPG contd. And Temp. constraint networks. --~30 min of LPG discussion --Temporal constraint networks --Next class: Read Scheduling paper --Next Week: Uncertainity and partial observability

2 LPG: Local Search on Planning Graphs  Searches for valid subgraphs of planning graphs 1.G  Pick a candidate sub-graph 2.Loop until solution 1.If G is solution, exit 2.Else, 1.Pick a conflict/flaw f in G 2.Generate a set of repairs for ff 3.Evaluate the goodness of the repairs and commit to the best { To avoid local minima, with 1-p probability pick a non-best repair randomly } 4. Loop back to 2. Mutex actions or unsupported preconds Add or remove actions --candidate actions come from the corresponding level of the PG (sort of like P-ACTION heuristic in AltAlt) -- involves implicit extension of PG Conceptually, it is best to think of a PG that has been infinitely extended over which the AG is embedded Use PG-based heuristics to evaluate the repairs --LPG uses relaxed plans Called Action-graphs --can be parallel or serial based on whether we use parallel or serial PG

3 General points made on 4/15---I  LPG is a domain-independent local search planner  In contrast, ASPEN [Chien et. Al. JPL] is a domain specific local search planner  Clarification: ASPEN uses some domain-specific heuristics for deciding which flaw to select, and which repair to pick. Its flaws and repairs themselves are domain-indepdent.  A better comparison between LPG and ASPEN may be like that between CISC and RISC (complex instruction set computer vs. reduced instruction set computer)  LPG uses Planning Graph more as a guidance rather than as a hard constraint (think of action graphs being drawn on the “graph paper” provided by PG)  Local Search gives no optimality guarantees  LPG often runs the problem multiple times and takes the “best” solution (or reports the median one)  Local search makes no distinction between planning and replanning  Replanning involves using as much of the old plan as possible. The right way to do it involves “retraction” of action. None of the systematic planners allow it. A systematic planner would have to split this into (a) remove the parts you don’t want and (b) do addition of actions. In contrast, for LPG, replanning is just starting with an existing plan [see their AIPS 2000 paper]

4 General points 4/15 --II  LPG uses PG for two distinct purposes:  As an envelope that guides/constrains the repairs to its action graph  As a basis for reachability information that allows it to cost the various repairs.  Since 1998, all versions of LPG involved the first use. The second use—sophisticated costing of repairs—happened only much more recently  Earlier, LPG would consider all open conditions to be of equal cost; now it uses relaxed plans to provide accurate costing of open conditions  It is interesting to note that the notion of “flaws” in a plan in local search wind up being connected to the ideas of causal proof  LPG talks about threats and open conditions; an earlier planner LPSP [Brafman & Hoos; 1999] did the same thing  Not surprising since the repairs have to be goal directed, and should allow flexible modifitions. Only the causal proof allows both.  The success of LPG shows that defining neighborhood of repairs in the context of plan and planning graph is much better than doing it in terms of a SAT/CSP compilation  However, this is a sort of “existential argument”—all it says s that if you are smart enough and perseverant enough (Gerevini and Serina worked on LPG pretty much continuously since 1998!!) then you may be able to design repairs in plan space that are much more useful than those in the SAT space [Brafman and Hoos define a bunch of really complex repairs that never seemed to take off…]

5 Advantages: Can follow gradients in search space; also O(1) space Disadvantages: no guarantee of completeness or optimality To specify a hill-climbing Algorithm you need the Notions of 1. Set of potential solutions (and current candidate solution) 2. A neighborhood of a given potential solution 3. A “goodness” function that estimates how good a given potential solution is

6 Ideas for improving convergence: -- Random restart hill-climbing After every N iterations, start with a completely random assignment --Probabilistic greedy -with probability p do what the greedy strategy suggests -with probability (1-p) pick a random variable and change its value randomly -- p can increase as the search progresses A greedier version of the above: For each variable v, let l(v) be the value that it can take so that the number of conflicts are minimized. Let n(v) be the number of conflicts with this value. --Pick the variable v with the lowest n(v) value. --Assign it the value l(v) I pointed out that The neighborhood 1 is subsumed by Neighborhood 2 2 1 This one basically searches the 1-neighborhood of the current assignment (where k-neighborhood is all assignments that differ from the current assignment in atmost k-variable values)

7 Action Graphs  Originally used (parallel) action graphs  Two types of inconsistencies: mutex and open cond  Now uses “linear” action graphs (basically subgraphs of serial PG)  Only one type of inconsistency: open cond  Allows larger neighborhood to be searched (in terms of Open Cond)  Adding an action implies going forward on the PG  Deleting an action implies pushing back on the PG  Can get a parallel plan (or a concurrent

8 Subgraph of a “Serial Plan Graph” (while action graphs are subgraphs of standard plan graphs)

9

10

11 Time is de-coupled from “level” --propagated just like cost is done  time of a fact is the min of the times of the actions supporting it  time of an action is max of  Times of its preconds  Times of actions that precede it

12 a5 Since the TA-graph is a serial graph Adding an action at any level Will automatically involve extending (“scooting”) The TA graph over the Underlying PG. --on left we are trying to add a5 to take care of the violation of f7 (caused by a2). --On the right we have a new TA graph which involves putting a new level to incorparte a5

13

14 Normalization Factors

15

16 Example illustrating Eval-Add

17

18

19

20

21

22 STN slides “borrowed” from Brian Williams

23 Projective Task Expansion Dynamic Scheduling and Task Dispatch Task Dispatch Temporal Plan Goals and Environment Constraints Temporal Network Solver Temporal Planner

24 Y Qualitative Temporal Constraints (Allen 83)  x before y  x meets y  x overlaps y  x during y  x starts y  x finishes y  x equals y XY XY XY YX YX YX X  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

25 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.

26 Example: Deep Space One Remote Agent Experiment Max_Thrust Idle Poke Timer Attitude Accum SEP Action SEP_Segment

27 Qualitative Temporal Constraints Maybe Expressed as Inequalities (Vilain, Kautz 86)  x before yX + < Y -  x meets yX + = 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]

28 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

29 Metric Time: Quantitative Temporal Constraint Networks (Dechter, Meiri, Pearl 91)  A set of time points X i at which events occur.  Unary constraints (a 0 < X i < b 0 ) or (a 1 < X i < b 1 ) or...  Binary constraints (a 0 < X j - X i < b 0 ) or (a 1 < X j - X i < b 1 ) or... Not n-ary constraints

30 Digression: the less-than-fully-rational bias for binary CSP problems in CSP community  Much work in CSP community (including temporal networks) is directed at “binary” CSPs—i.e. csps where all the constraints are between exactly 2 variables.  E.g. Arc-consistency, Conflit-directed-backjumping etc are only clearly articulated for binary CSPs first. Temporal networks studied in Dechter et al are all binary.  Binary CSPs are a “canonical” subset of CSP—any n-ary CSP can be compiled into a binary CSP by introducing additional (hidden) variables. The conversion is not always good  [Bacchus and Vanbeek, 98] provides a tradeoff analysisBacchus and Vanbeek, 98]  The ostensible reason for the interest in binary CSPs is ostensibly that most naturally occuring constraints are between 2-entities.  A less charitable characterization is that the constraint graphs in binary CSPs are normal graphs so they can be analyzed better  The constraint graphs in n-ary CSPs will be “hyper graphs” (edges are between sets of vertices)  In the case of temporal networks that will arise in planning,even for simple constraints caused by causal threats, the disjunctive constraint that is posted is a 3-ary constraint (between threat, producer and consumer)—not a binary one  If you split the disjunction into the search space however, we will get two Simple temporal networks that are both binary.

31 Temporal Constraint Satisfaction Problem (TCSP)  X i continuous variables  {I 1,...,I n }interval constraints where I i = [a i,b i ]interval  T i = (a i  X i  b i ) or... or (a i  X i  b i )  T ij = (a 1  X i - X j  b 1 ) or... or (a n  X i - X j  b n ) [Dechter, Meiri, Pearl, aij89]

32 TCSP Are Visualized Using Directed Constraint Graphs 13 42 0 [10,20] [30,40] [60,inf] [10,20] [20,30] [40,50] [60,70]

33 TCSP Queries (Dechter, Meiri, Pearl, AIJ91)  Is the TCSP consistent? Planning  What are the feasible times for each X i ?  What are the feasible durations between each X i and X j ?  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

34 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…

35 Operations on Constraints: Intersection And Composition Compose [10,20] with [30,40][60,inf] to get constraint between 0 and 3

36 An example where minimal network is different from the original one. 13 0 [10,20][30,40] [0,100] 13 0 [10,20][30,40] [0,100] [40,60] 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]

37 Simple Temporal Networks (Dechter, Meiri, Pearl 91) Simple Temporal Networks:  A set of time points X i at which events occur.  Unary constraints (a 0 < X i < b 0 ) or (a 1 < X i < b 1 ) or...  Binary constraints (a 0 < X j - X i < b 0 ) or (a 1 < X j - X i < b 1 ) or... Sufficient to represent: most Allen relations simple metric constraints Sufficient to represent: most Allen relations simple metric constraints Can’t represent: Disjoint tokens Can’t represent: Disjoint tokens

38 Simple Temporal Network  T ij = (a ij  X i - X j  b ij ) 13 42 0 [10,20] [30,40] [60,inf] [10,20] [20,30] [40,50] [60,70]

39 Thrust Goals Attitude Turn(a,b) Point(a)Point(b)Turn(b,a) Engine Thrust (b, 200) Off Delta_V(direction=b, magnitude=200) Power Warm Up A Completed Plan Forms an STN

40        A Completed Plan Forms an STN

41 TCSP Queries (Dechter, Meiri, Pearl, AIJ91)  Is the TCSP consistent? Planning  What are the feasible times for each X i ?  What are the feasible durations between each X i and X j ?  What is a consistent set of times? Scheduling  What are the earliest possible times? Scheduling  What are the latest possible times?

42 To Query an STN Map to a Distance Graph G d = 70 13 42 0 20 50 -10 40 -30 20 -10 -40 -60 13 42 0 [10,20][30,40] [10,20] [40,50] [60,70] T ij = (a ij  X j - X i  b ij ) X j - X i  b ij X i - X j  - a ij Edge encodes an upper bound on distance to target from source.

43 G d Induces Constraints  Path constraint: i 0 =i, i 1 =..., i k = j → Conjoined path constraints result in the shortest path as bound: where d ij is the shortest path from i to j

44 d-graph Shortest Paths of G d 70 12 43 0 20 50 -10 40 -30 20 -10 -40 -60

45 STN Minimum Network d-graphSTN minimum network

46 Conjoined Paths are Computed using All Pairs Shortest Path (e.g., Floyd-Warshall’s algorithm ) 1. for i := 1 to n do d ii 0; 2. for i, j := 1 to n do d ij a ij ; 3. for k := 1 to n do 4. for i, j := 1 to n do 5. d ij min{d ij, d ik + d kj }; i k j

47 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)

48 Testing Plan Consistency d-graph 70 12 43 0 20 50 -10 40 -30 20 -10 -40 -60 No negative cycles: -5 > T A – T A = 0

49 Latest Solution 70 12 43 0 20 50 -10 40 -30 20 -10 -40 -60 d-graph Node 0 is the reference.

50 Earliest Solution 70 12 43 0 20 50 -10 40 -30 20 -10 -40 -60 d-graph Node 0 is the reference.

51 Solution: Earliest Times 70 13 42 0 20 50 -10 40 -30 20 -10 -40 -60 S 1 = (-d 10,..., -d n0 )

52 Scheduling: Feasible Values d-graph X 1 in [10, 20] X 2 in [40, 50] X 3 in [20, 30] X 4 in [60, 70] Latest Times Earliest Times

53 Scheduling without Search: Solution by Decomposition d-graph Select value for 1 à 15[10,20]

54 Scheduling without Search: Solution by Decomposition d-graph Select value for 1 à 15[10,20]

55 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45 [40,50], 15+[30,40] Select value for 1 à 15

56 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45[45,50] Select value for 1 à 15

57 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45 [45,50] Select value for 1 à 15

58 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45 Select value for 1 à 15 Select value for 3, consistent with 1 & 2 à 30 [20,30], 15+[10,20],45+[-20,-10]

59 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45 Select value for 1 à 15 Select value for 3, consistent with 1 & 2 à 30 [25,30]

60 Solution by Decomposition d-graph Select value for 2, consistent with 1 à 45 Select value for 1 à 15 Select value for 3, consistent with 1 & 2 à 30 [25,30]

61 Solution by Decomposition d-graph Select value for 4, consistent with 1,2 & 3 O(N 2 ) Select value for 2, consistent with 1 à 45 Select value for 1 à 15 Select value for 3, consistent with 1 & 2 à 30


Download ppt "4/15: LPG contd. And Temp. constraint networks. --~30 min of LPG discussion --Temporal constraint networks --Next class: Read Scheduling paper --Next Week:"

Similar presentations


Ads by Google