10/27 exam post-mortem phased-relaxation approach order generalization (partialization) temporal...
Post on 20-Dec-2015
214 views
TRANSCRIPT
10/27
Exam post-mortemPhased-relaxation approachOrder generalization (Partialization)Temporal Networks
Phased Relaxation in SAPA
Relax the negative logical and resource effectsto build the Relaxed Temporal Planning Graph
Find relaxed solution which is used as distance heuristicsFind relaxed solution which is used as distance heuristics
Adjust the heuristic valuesusing the negative interactions
Adjust the heuristic valuesusing the negative interactions
Adjust the heuristic valuesusing the resource consumptionInformation.
Adjust the heuristic valuesusing the resource consumptionInformation.
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
A1 A2 A3
A1(10) gives g1 but deletes p at the startA3(8) gives g2 but requires p at startA2(4) gives p at end We want g1,g2
A position-constrained plan with makespan 22
A1
A2
A3 G
p
g1
g2
[et(A1) <= et(A2)] or [st(A1) >= st(A3)][et(A2) <= st(A3)….
OrderConstrainedplan
The best makespan dispatch of the order-constrained plan
A1
A2 A3 14+
There could be multiple O.C. plansbecause of multiple possible causal sources. Optimization will involve Going through them all.
~p
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
Plan representation
A1
A2
A3
Drive(cityA,cityB)
QAt(truck,B)
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
Is this represent
ation general?
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
X Y
X Y
X Y
YX
YX
Y X
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
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
JerseyvotesIncumbent rule
Turnout Median Outcome
11/1:Temporal NetworksScheduling
The Cell-phonecorrection
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
TCSP Are Visualized UsingDirected Constraint Graphs
1 3
42
0[10,20]
[30,40][60,inf]
[10,20]
[20,30][40,50]
[60,70]
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 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
1 3
42
0[10,20]
[30,40][60,inf]
[10,20]
[20,30][40,50]
[60,70]
1 3
42
0[10,20]
[30,40][60,inf]
[10,20]
[20,30][40,50]
[60,70]
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.
1 30[10,20] [30,40]
[0,100]
1 30[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]
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
To Query an STN Map to aDistance Graph Gd = < V,Ed >
70
1 3
42
020
50
-10
40
-30
20 -10
-40-60
1 3
42
0[10,20] [30,40]
[10,20]
[40,50]
[60,70]
Tij = (aij Xj - Xi bij)Xj - Xi bij
Xi - Xj - aij
Edge encodes an upper bound on distance to target from source.
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 do4. for i, j := 1 to n do5. dij min{dij, dik + dkj};
ik
j
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 0
d-graph
Shortest Paths of Gd
70
1 2
43
020
50
-10
40
-30
20 -10
-40-60
STN Minimum Network
0 1 2 3 4
0 [0] [10,20] [40,50] [20,30] [60,70]
1 [-20,-10] [0] [30,40] [10,20] [50,60]
2 [-50,-40] [-40,-30] [0] [-20,-10] [20,30]
3 [-30,-20] [-20,-10] [10,20] [0] [40,50]
4 [-70,-60] [-60,-50] [-30,-20] [-50,-40] [0]
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 0
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)
Testing Plan Consistency
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 0
d-graph70
1 2
43
020
50
-10
40
-30
20 -10
-40-60
No negative cycles: -5 > TA – TA = 0
Latest Solution
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 070
1 2
43
020
50
-10
40
-30
20 -10
-40-60
d-graph
Node 0 is the reference.
Earliest Solution
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 070
1 2
43
020
50
-10
40
-30
20 -10
-40-60
d-graph
Node 0 is the reference.
Solution: Earliest Times
70
1 3
42
020
50
-10
40
-30
20 -10
-40
-60
S1 = (-d10, . . . , -dn0)
Scheduling:Feasible Values
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 0
d-graph
• X1 in [10, 20]
• X2 in [40, 50]
• X3 in [20, 30]
• X4 in [60, 70]
Latest Times
Earliest Times
Solution by Decomposition
0 1 2 3 4
0 0 20 50 30 70
1 -10 0 40 20 60
2 -40 -30 0 -10 30
3 -20 -10 20 0 50
4 -60 -50 -20 -40 0
d-graph • Select value for 4, consistent with 1,2 & 3O(N2)
• Select value for 2, consistent with 1
45
• Select value for 1
15
• Select value for 3, consistent with 1 & 2
30