Seminar: Search and Optimization Directional Consistency Gabi R¨ oger Universit¨ at Basel November 6, 2014
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Arc-consistency
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = a,b,c a,b,d a,b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = a,b,c a,b,d a,b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = a,b,c a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = a,b,c a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 1 , x 2 , x 3 , x 4 = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4 Backtrack-free search
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 4 , x 2 , x 1 , x 3 = b, e a,b a,b a,b,e = x 4 x 2 x 1 = x 3
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Example x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e Assume we search with variable order x 4 , x 2 , x 1 , x 3 = b, e a,b a,b a,b,e = x 4 x 2 x 1 = x 3 Not necessarily backtrack-free search
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional arc-consistency: Definition Definition (Directional arc-consistency) A network is directional arc-consistent relative to variable order d = ( x 1 , . . . , x n ) iff every variable x i is arc-consistent relative to every variable x j such that i ≤ j .
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Arc-consistency: Function DAC function DAC: for i = n , . . . , 1: for each j < i such that R ji ∈ R : D j ← D j ∩ π j ( R ji ⋊ ⋉ D i ) (remove values from D j that don’t have a partner in D i ) Input: Constraint network R = ( X , D , C ) Input: with variable ordering d = ( x 1 , . . . , x n ) Effect: Enforces directional arc-consistency along d . Time complexity: O ( ek 2 ) with e binary constraints and Time complexity: maximal domain size k .
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Arc-consistency: Questions How does directional arc-consistency relate to full arc-consistency? Is there a criterion when directional arc-consistency leads to backtrack-free search? Can we find a suitable variable ordering?
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional AC vs. Full AC x 1 x 4 a,b,c b,c,e = = = x 2 x 3 a,b,d a,b,e = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4 = b, e a,b a,b a,b,e = x 4 x 2 x 1 = x 3
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional AC vs. Full AC x 1 x 4 a,b,c b,c,e x 1 x 4 b b = = = = = = x 2 x 3 a,b,d a,b,e x 2 x 3 b b = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4 = b, e a,b a,b a,b,e = x 4 x 2 x 1 = x 3
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional AC vs. Full AC x 1 x 4 a,b,c b,c,e x 1 x 4 b b = = = = = = x 2 x 3 a,b,d a,b,e x 2 x 3 b b = b a,b,d b,e b,c,e = = x 1 x 2 x 3 x 4 = b, e a,b a,b a,b,e = x 4 x 2 x 1 = x 3 Enforcing full AC eliminates everything directional AC does . . . and more
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of a Graph Definition (Width of a graph) Let G = ( V , E ) be an undirected graph and d = ( v 1 , . . . , v n ) be an ordering of its the nodes. The parents of a node v are its neighbours that precede it in the ordering. The width of a node is the number of its parents. The width of the ordering is the maximum width over all nodes. The width of graph G is the minimum width over all orderings.
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of a graph: Example A B C D E F
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of a graph: Example F,E,D,C,B,A: A F E D C B A B C D E F
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of a graph: Example F,E,D,C,B,A: A F E D C B A B C D A,B,C,D,E,F: E F A B C D E F
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of Graph: Algorithm function MIN-WIDTH: d ← array of size | V | for i = n , . . . , 1: r ← a node in G with smallest degree d [ i ] ← r Remove all adjacent edges of r from E Remove r from V Input: Graph G = ( V , E ) Effect: d contains minimum width ordering of nodes.
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Width of Graph and Directional Arc-Consistency Theorem A graph is a tree iff it has width 1. Definition A constraint network is backtrack-free relative to a given ordering ( x 1 , . . . , x n ) if for every i < n , every partial solutions of ( x 1 , . . . , x i ) can be consistently extended to include x i +1 Theorem Let d be a width-1 ordering of a constraint tree T. If T is directional arc-consistent relative to d then the network is backtrack-free along d.
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Application: Algorithm for Trees function TREE-SOLVING: Generate width-1 ordering ( x 1 , . . . , x n ) for R along a rooted tree. Let x p ( i ) denote the parent of x i in the rooted tree. for i = n , . . . , 1: D p ( i ) ← D p ( i ) ∩ π p ( i ) ( R p ( i ) i ⋊ ⋉ D i ) if D p ( i ) = ∅ : exit (inconsistent network) Extract solution with (backtrack-free) search. Input: Constraint network R = ( X , D , C ) Output: Solution (or inconsistent network). Time complexity: O ( nk 2 ) with n variables and Time complexity: maximal domain size k .
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Path-consistency
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary (Strong) directional path-consistency: Function DPC function DPC: E ′ ← E for k = n , . . . , 1: for each i < k such that ( x i , x k ) ∈ E ′ : D i ← D i ∩ π i ( R ik ⋊ ⋉ D k ) for each i , j < k such that ( x i , x k ) , ( x j , x k ) ∈ E ′ : R ij ← R ij ∩ π ij ( R ik ⋊ ⋉ R kj ) ⋉ D k ⋊ E ′ ← E ′ ∪ ( x i , x j ) Input: Constraint network R = ( X , D , C ) with constraint graph Input: G = ( V , E ) and variable ordering d = ( x 1 , . . . , x n ) Effect: Enforces directional arc- and path-consistency along d . Time complexity: O ( n 3 k 3 ) with n variables and Time complexity: maximal domain size k .
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Path-consistency: Example x 1 a,b � = � = x 2 x 4 a,b a,b � = � = x 3 a,b
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Path-consistency: Example x 1 a,b � = � = x 2 x 4 a,b a,b � = � = x 3 a,b � = � = � = a,b a,b a,b a,b � = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Path-consistency: Example x 1 a,b � = � = x 2 x 4 a,b a,b � = � = x 3 a,b � = � = � = a,b a,b a,b a,b � = x 1 x 2 x 3 x 4
Directional Arc-consistency Directional Path-consistency Adaptive Consistency Summary Directional Path-consistency: Example x 1 a,b � = � = x 2 x 4 a,b a,b � = � = x 3 a,b � = � = � = a,b a,b a,b a,b � = x 1 x 2 x 3 x 4
Recommend
More recommend