Download presentation
Presentation is loading. Please wait.
Published byLindsey Ramsey Modified over 9 years ago
1
Path Consistency for 1- General CSPs 2- STPs Peter Schlette Wesley Botham CSCE990 Advanced CP, Fall 2009
2
Outline 12/7/2015 2 General CSPs Review of Path Consistency & PC Algorithms Path Consistency Algorithms PC-1, PC-2, DPC, PPC, PC-8, PC-2001 STPs Review of Triangulated Graphs Path Consistency on STPs Floyd-Warshall, Bellman-Ford, STP, P 3 C, Prop-STP
3
Path Consistency: Properties 12/7/2015 3 A CSP is path consistent iff it is strongly 3-consistent [van Beek & Dechter, JACM95] [van Beek & Dechter, JACM95] Domains are filtered by arc consistency Consistent solutions over 2 variables can be extended to every 3 rd variable PC algorithms typically iterate over triplets of variables End variables in triplets need not be distinct In STP, variables domains are not relevant, thus PC algorithms on STPs enforce only 3-consistency A given algorithm Must determine that a CSP is path consistent or not May or may not filter the constraints as much as possible (e.g., DPC)
4
List of Algorithms Discussed PC-1 [Mackworth 77,, Dechter Fig 3.10] PC-2 [Mackworth 77, Dechter Fig 3.11] DPC [Dechter & Pearl 89, Dechter Fig. 4.9] PPC [Bliek & Sam-Haroud 99] PC-8 [Chmeiss & Jégou 98] PC-2001 [Bessière et al. 05] 12/7/2015 4
5
Path Consistency: Algorithms 12/7/2015 5 They all stop when a relation/domain is empty; omitted for clarity Queue Does is it have one? Edges (e.g., PPC) Triplets of variables (e.g., PC-2) Tuples of ‘vv-pair, variable’ (e.g., PC-8 & PC-2001) Properties Determines strong 3-consistency? What is the time and space complexity? Requires additional data structures to remember supports? Graph: Complete? Chordal? What is the practical performance (i.e., phase transition)?
6
PC-1 [Mackworth 77] 12/7/2015 6 1 Repeat until quiescence 2 For i, j, k variables 3 R ij R ij R ik R kj Has 4 nested loops, iterates over vertices, needs no queue Updates every edge & every domain ( i = j ) Uses composition and intersection Determines strong 3-consistency (when i = j ) Time complexity is O(n 5 d 5 ) One sweep costs O(n 3 d 3 ) Number of sweeps O(n 2 d 2 ) Space: no queue, no additional data structure, complete graph
7
PC-2 [Mackworth 77] 12/7/2015 7 Has 1 loop over a queue of triplets of variables When an edge (domain) is updated, only triplets with an ‘external’ 3 rd node are added to queue Allows i=j, thus determines strong 3-consistency. Dechter Fig 3.11 specifies i<j in which case domains are not updated Theoretically & practically faster than PC-1 (queue) Time complexity is O(n 3 d 5 ) Space: Queue size is O(n 3 ), no additional data structures, complete graph 1 Q { ( i,j,k ) | i j, i k, j k } 2 While Q is not empty 3 For ( i,j,k ) from Q 4 R ij R ij R ik R jk 5 If R ij changed, Q Q U { ( m, i, j ), ( m, j, i ) | m i, m j } m m j i k
8
n=16, a=16, d=30% PC-1 vs. PC-2 [Botham & Schlette] 12/7/2015 8 PC-2 PC-1
9
PPC [Bliek & Sam-Haroud 99] 12/7/2015 9 Q ← E Until Q is empty do edge ← DEQUEUE(Q) for every triplet i,j,k related to edge R ij ← R ij ∩ (R ik R kj ) if R ij was changed then EnQueue((i,j), Q) First triangulates the graph Keeps Q, a queue of edges For an edge in Q Pops edge from Q, retrieves all triplets where edge appears In each triplet, updates each edge Each updated edge is added to Q Does not specify whether or not domains are filtered (some should be for soundness)
10
PPC [Bliek & Sam-Haroud 99] 12/7/2015 10 Triangulated graph is usually sparser than complete graph For triplet ( i,j,k ) allows i=j, algorithm is sound (not clear in paper) Enforces Strong path-consistency Weaker filtering than PC-2 Time: O( ed 2 ), degree of graph Space: queue O( e) for storing triplets, no additional data structure, chordal graph Weakness: if 2 or more edges of a given triplet are in Q All three edges are updated once for each edge May do redundant work (fixed in STP) i vnvn j v2v2 v1v1
11
1 For k=n downto 1do 2 For i =1 to k R EVISE (i, R ik ) 3 For i,jk i,k connected & j,k connected 4 R ij R ij R ik R jk k-2 k k-4 k-6 DPC [Dechter Fig 4.9, Dechter & Pearl 89] Given an ordering for the variables From bottom to top, enforces directional arc-consistency (DAC) From bottom to top, for every variable, updates the edge between every two of its parents Properties Moralizes the graph, determines strong directional path consistency relative to ordering Time O(min( t.d 3,n 3 d 3 )) Space: No queue, no additional data structures, chordal graph 12/7/2015 11
12
DPC: Constraint revision [Dechter Fig 3.9] 1 For each ( a,b ) R ij 2 If no c D k is s.t. ( a,c ) R ik & ( a,b ) R jk 3 Remove ( a,b ) from R ij 12/7/2015 12 k j i Does not operate on matrices in reality ( , ) Iterates over Tuples in constraints (i.e., (a,b) R ij ) and Values in domain (i.e., c D k ) Not yet tested against PC-1, PC-2, PPC
13
PC-8 [Chmeiss & Jégou 98] PC-8 I NITIALIZE While Q do P OP ((i,a),k), Q) P ROPAGATE ((i,a),k) UPDATE if WITHOUTSUPPORT((i,a),(j,b),k) REMOVE (a,b) from R ij, (b,a) from R ij Q ← Q U {((i,a,)j),((j,b),i)} 12/7/2015 13 I NITIALIZE Q ← for i,j,k=1 to n (i<j,k≠i,k≠j) for (a,b)R ij U PDATE ((i,a),(j,b),k) P ROPAGATE for j=1 to n (j≠i,j≠k) for bDj and (a,b)R ij U PDATE ((i,a),(j,b),k)
14
PC-8 Analysis [Chmeiss & Jégou 98] Queue: a list of (vvp, var) = ((var,val),var) Determines strong PC-property (if you allow i=j ) Achieves ‘full’ filtering Time complexity I NITIALIZATION : O(n 3 d 3 ) P ROPAGATE is called O(n 2 d 2 ) times, each call costs O(nd 2 ) PC-8: I NITIALIZATION + (n 2 d 2 ) P ROPAGATE = O(n 3 d 4 ) Space Queue O(n 2 d), data structure Status-PC: O(n 2 d) Graph is complete 12/7/2015 14
15
PC-8 vs. PC-2 [Botham & Schlette] 12/7/2015 15 PC-2 PC-8 n=16, a=16, d=30%
16
12/7/2015 16 PC-2001 [Bessière+ 05] PC-2001 1 I NITIALIZE (Q) 2 While Q 3 P OP ((i,a),k) from Q 4 R EVISE P ATH ( (i,a),j ) I NITIALIZE (Q) 1 For i, j, k variables 2 For each ( a, b ) R ij 3 If ( a, b ) has no support c in D k 4 Remove ( a, b ) from R ij 5 Q Q U {(( i, a ), j ), (( j, b ), i )} 6 Else 7 Last(( i, a ),( j, b ), k ) the first support of ( a, b ) D k
17
12/7/2015 17 PC-2001 [Bessière+ 05] R EVISE P ATH (( i, a ), k,Q) 1 For each j k 2 For each b D j | ( a,b) R ij 3 support Last(( i, a ),( j, b ), k ) 4 While support is nil or was deleted 5 support next value in D k 6 If no supports exist 7 Remove ( a,b ) from R ij 8 Q Q U {(( i, a ), j ), (( j, b ), i )} 9 Else 10 Last(( i, a ),( j, b ), k ) support Records supporting values to improve time complexity (at the cost of space overhead)
18
PC-2001 Analysis [Bessière+ 05] Queue: same as PC-8, list of (vvp,var) Achieves the same properties as PC-1, PC-2, PC-8 Time: O(n 3 d 3 ) Space Queue: O(n 2 d) Data structure: Last structure dominates O(n 3 d 2 ) Graph complete Compared to PC-8, PC-2001 Is easier to understand and implement Has lower time complexity Is faster in general in experiments Has worse space complexity 12/7/2015 18
19
PC-2001 vs. PC-2, PC-8 [Botham & Schlette] 12/7/2015 19 PC-8 PC-2001 PC-2 n=16, a=16, d=30%
20
12/7/2015 20 QueueDataStrTimeGraphPC-p?FilteringEmpirically PC-1None O(n 5 d 5 )CompleteYesFull PC-2 Triplets O(n 3 ) NoneO(n 3 d 5 ) Complete YesFullBetter than PC-1 in all cases PPC Edges O( e) None O( ed 2 ) ChordalYesPartial Advantageous on sparse graphs DPCNone O(min(td 3, n 3 d 3 ) ChordalNo‘weak’ partial Not evaluated yet, but likely best PC-8 {(vvp,var) * } O(n 2 d) Status O(n 2 d) O(n 3 d 4 )CompleteYesFull Significantly better than PC- 2 around phase transition, ambiguous otherwise PC-2001 {(vvp,var) * } O(n 2 d) Last O(n 3 d 3 ) CompleteYesFull Better than PC-8 in nearly all cases Summary of PC Algorithms for General CSPs Comparisons: CPU time, #CC for preprocessing
21
Outline 12/7/2015 21 General CSPs Review of Path Consistency & PC Algorithms Path Consistency Algorithms PC-1, PC-2, DPC, PPC, PC-8, PC-2001 STPs Review of Triangulated Graphs Path Consistency on STPs Floyd-Warshall, Bellman-Ford, STP, P 3 C, Prop-STP
22
Triangulated Graphs: Motivation [Bliek & Sam-Haroud 99] showed that PPC Operates on triangulated graphs Determines the property of strong path consistency When constraints are convex, PPC also yields minimal CSP [Xu & Choueiry 03] studied STP In STP constraints are convex Proposed STP, which adapts PPC to STPs w/o updating domains (‘weak’ path consistency) May do fewer updates than PPC: queue of edges versus queue of triangles [Planken et al. 08] studied STP Showed that STP is O(t 2 ), t is the number of triangles Proposed P 3 C, for STP, that is O(t) 12/7/2015 22
23
Vertex elimination Vertex elimination operation: When removing a vertex, connect all neighbors if they are not already connected Fill edges: are the edges added when eliminating a vertex Simplicial vertex Vertex whose neighbors are all connected (form a clique) Eliminating a simplicial vertex does not add any edges Perfect elimination ordering: There is always a simplicial vertex to be eliminated. All nodes can be eliminated w/o adding any fill edges 12/7/2015 23
24
A graph is triangulated iff it has a perfect elimination order The width of the triangulated graph is equal to the size of its largest clique -1. Why? Finding the width is tractable, thus max. clique on triangulated graph is tractable (usually, NP-hard) Using the reverse of the perfect elimination ordering of a triangulated graph yields A moralized graph The induced width of this ordering is equal to the width of the triangulated graph, why? Moralizing an arbitrary ordering of a graph yields a triangulated graph. Why? Triangulated Graphs 12/7/2015 24
25
Outline 12/7/2015 25 General CSPs Review of Path Consistency & PC Algorithms Path Consistency Algorithms PC-1, PC-2, DPC, PPC, PC-8, PC-2001 STPs Review of Triangulated Graphs Path Consistency on STPs Floyd-Warshall, Bellman-Ford, STP, Prop-STP, P 3 C (Prop-STP is not discussed for lack of time)
26
Floyd-Warshall for STP [CLR] Basic STP solver, three nested loops Initialization: builds the distance graph R ij = [a,b] gives e ij b and e ji -a When edge does not exist, add infinite distance (complete graph) Time (n 3 ), Space: No queue but O(n 2 ) new edges 12/7/2015 26 F LOYD W ARSHALL For k 1 to n For i 1 to n For j 1 to n w(e ij ) M IN (w(e ij ),w(e ik )+w(e kj ))
27
d[s] 0 for each vertex i other than source ( i s) d[ i ] Repeat n-1 times for each edge e ij if d[i] + w( e ij ) < d[ j ] then d[j] d[ i ] + w( e ij ) for each edge e ij if d[ i] + w( e ij ) < d[ j] then return inconsistent 12/7/2015 27 Bellman-Ford for STP [CLR] Time: O(en), Space: No queue but O(n) new edges Detects path consistency Edges are not guaranteed minimal
28
PPC Operates on triangulated graphs ‘Fully’ filters convex constraints ∆STP adapts & refines PPC to STP Keeps a queue of triangles (vs. a queue of edges) Pops a triangle from queue & updates all 3 edges Implicitly separate graph in biconnected components Enqueues triangles adjacent to only the updated edge Best performance when queue is FIFO 12/7/2015 28 ∆STP [Xu & Choueiry 03]
29
12/7/2015 29 Performance on STPs: F-W, PPC, STP [Xu & Choueiry 03]
30
12/7/2015 30 Constraint checks for selected STP solvers Performance on STPs: BF, DPC, STP [Shi+ 05]
31
12/7/2015 31 Designers of ∆STP became aware of relevance of simplicial ordering in ∆STP in 2005 (ref. Nic Wilson) Designers of Prop-STP exploited the idea The authors of P 3 C formalize the flaw of ∆STP Identified a pathological case where ∆STP does unnecessary work (not useful filtering) Characterized it as set of problems where ∆STP runs in Ω (t 2 ), where t is the number of triangles P 3 C addresses flaw by using a simplicial ordering Proves that propagation can be achieved in (t) P 3 C: The Idea [Planken+ 08]
32
P 3 C: Pathological Case [Planken+ 08] {c i →i+1 | 0 ≤ i ≤ t+1} with zero weight {c i→j | (1 ≤ i ≤ j−2 < t) ∧ i+j−t ∈ {1,2}} with weight j−i−1 {c j→i | (1 ≤ i ≤ j−2 < t) ∧ i+j−t ∈ {1,2}} with weight t−(j−i−1) 12/7/2015 32
33
Path. Case: Empirically [Planken+ 08] 12/7/2015 33 cubic quadratic linear
34
P 3 C: The Algorithm [Planken+ 08] Given: A triangulated graph & a perfect elimination order 12/7/2015 34 k j i k j i The algorithm has two steps Bottom up: For every node Considers every pair of parents Updates the edge between parents (ref. DPC) Top down: For every node Considers every pair of parents Updates edges adjacent to node 1 2
35
P 3 C: Bottom up [Planken+ 08] DPC: For each node update the edges between all parents given the edges with the node 12/7/2015 35
36
P 3 C: Top Down [Planken+ 08] Update the edges between every node and its parent 12/7/2015 36
37
P 3 C: Sound & complete [Planken+ 08] Claim: on iteration k of P 3 C’s second half, all edges in the subgraph consisting of { V i | i ≤ k } are minimal Base case: k = 2 We know that c 1,2 (in orange) must be minimal if it exists, due to DPC; the subgraph will always be minimal for k = 2 12/7/2015 37 k=2 1 2 1 k=3
38
Induction hypothesis: G k-1 ={ V i ≤ k -1 } forms a minimal subgraph Induction step: G k-1 minimal G k minimal In the k th iteration, w ik =min( w ik, w ij + w jk ) Any part of a theoretical shorter path that extends out of the G k-1 can be replaced by its two endpoints within G k-1, due to the filtering from DPC The only way w ik could be non-minimal is if there were a shorter path w ij + w jk, but this path was checked in the k th iteration We have a base step and an inductive step, so the proof is complete! 12/7/2015 38 P 3 C: Sound & complete [ Planken+ 08] k i j GkGk k-1 G k-1 1
39
Time Complexity [Planken+ 08] P 3 C runs in Θ (t), t is the number of triangles O(t) ⊆ O(n w* 2 ), w* is the min. induced width O(n w* 2 ) ⊆ O(n δ 2 ), where δ is max. degree O(n δ 2 ) ⊆ O(n 3 ) DPC visits each triangle exactly once The second half of P 3 C visits each triangle exactly once Thus we have a constant number of visits to each triangle and a linear time complexity in the number of triangles 12/7/2015 39
40
Jobshop (enforced consistency) [Planken+ 08] 12/7/2015 40 In spite of theoretical bounds, the two algorithms are quite close
41
Summary of STP Algorithms GraphPC-p?Minimality?TimeQueueExperiments FWCompleteYes Θ(n 3 ) NoneWorst BFPartialYesNoO(en)NoneBetter than FW PPCChordalYes O( ed 2 )O( e) DPCChordalYesNo (t) None Low density: less good than STP, high density same as STP STP ChordalYes O(min(t 2, ed 2 )) O( e) Faster than PPC, better than DPC on low densities P3CP3CChordalYes (t) NoneBest reported, 12/7/2015 41
42
Future Work [Planken+ 08] Extend P 3 C to general CSPs Investigate efficiency of triangulation algorithms vs. P 3 C Incremental P 3 C solver for STPs 12/7/2015 42
43
References CSP PC-1, PC-2: see [Mackworth, AIJ 1977] PPC: see [Bliek & Sam-Haroud, IJCAI 1999] DPC: see [Dechter 4.2.2, Dechter & Pearl, AIJ 1987] PC-8: see [Chmeiss & Jégou, IJAITools 1998] PC-2001: see [Bessière et. Al, AIJ 2005] STP Floyd-Warshall, Bellman-Ford: see CLR textbook DPC: see [Dechter et al., AIJ 1991] ∆STP: see [Xu and Choueiry, TIME 2003] Prop-STP: see [Bui, Tyson, and Yorke-Smith, AAAI 07, Workshop] P 3 C: see [Planken et al., ICAPS 2008] 12/7/2015 43
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.