1 CHR summer school 2010 – Introduction to CHR – Jon Sneyers An introduction to An introduction to C ONSTRAINT H ANDLING R ULES C H R ONSTRAINT ANDLING ULES Jon Sneyers August 2010
2 CHR summer school 2010 – Introduction to CHR – Jon Sneyers PART ONE Introduction
3 CHR summer school 2010 – Introduction to CHR – Jon Sneyers How to get from A to B ? point B : Library Ladeuzeplein, Leuven point A : Universiteitshallen Naamsestraat 22, Leuven, Belgium
4 CHR summer school 2010 – Introduction to CHR – Jon Sneyers shortest path (by car) according to
5 CHR summer school 2010 – Introduction to CHR – Jon Sneyers Abstraction to map
6 CHR summer school 2010 – Introduction to CHR – Jon Sneyers 20 Abstraction to 40 20 40 60 (weighted & directed) 40 20 graph 30 60 40 30 160 60 30 5 10 40 90 90 90 100 150 30 140 10 5 10 230 10 5 60 30 30 120 40
7 CHR summer school 2010 – Introduction to CHR – Jon Sneyers 20 40 20 40 60 how to find 40 20 the shortest 30 path ??? 60 40 30 160 60 30 5 10 40 90 90 90 100 150 30 140 10 5 10 230 10 5 60 30 30 120 40
8 CHR summer school 2010 – Introduction to CHR – Jon Sneyers how to find the shortest path ??? Edsger Dijkstra (1930-2002) Dutch computer scientist
9 CHR summer school 2010 – Introduction to CHR – Jon Sneyers Dijkstra's algorithm: 1. distance( start-point ) = 0 2. pick a (not-yet-considered) point x with smallest distance, LABEL( x ) 3. if end-point is considered, stop; otherwise go to step 2 a y : LABEL( x ) : for all arrows x set distance( y ) = distance( x ) + a (if the new distance is shorter) Edsger Dijkstra (1930-2002) Dutch computer scientist
10 CHR summer school 2010 – Introduction to CHR – Jon Sneyers How to do this automatically ?
Recommend
More recommend