Presentation is loading. Please wait.

Presentation is loading. Please wait.

26 April 2013Lecture 6: Problem Solving1 Problem Solving Jorge Cruz DI/FCT/UNL April 2013.

Similar presentations


Presentation on theme: "26 April 2013Lecture 6: Problem Solving1 Problem Solving Jorge Cruz DI/FCT/UNL April 2013."— Presentation transcript:

1 26 April 2013Lecture 6: Problem Solving1 Problem Solving Jorge Cruz DI/FCT/UNL April 2013

2 Lecture 6: Problem Solving2 Problem Solving Variable Elimination Dependency Reduction Modelling Techniques System Scaling Constraint Solving Systems Interval Libraries Some Languages and Tools Some Common Benchmarks Some Problems 26 April 2013 Final Project

3 Lecture 6: Problem Solving3 Modelling Techniques Frequently a single problem may be modelled by several equivalent CCSPs The behaviour of a constraint solver may change drastically even with equivalent CCSPs To choose the best model for a particular problem is important to understand the underlying constraint propagation algorithms Some modelling techniques are commonly adopted for improving the accuracy and efficiency of the continuous constraint solvers 26 April 2013

4 Lecture 6: Problem Solving4 Modelling Techniques A fundamental problem of interval arithmetic is the dependency problem (see lecture 2). Dependency Reduction Some expressions may be rewritten into equivalents that minimize the dependency problem Factorize as much as possible polynomial expressions: Instead of using constraint x 2 y 2 +xy 2 +xy=0 use constraint xy(y(x+1)+1)=0 Use better interval extensions (mean value form, Taylor form,…): Instead of using constraint x  x 2 =0 use constraint 0.25  (x  0.5) 2 =0 Examples: 26 April 2013

5 Lecture 6: Problem Solving5 Modelling Techniques Precision and efficiency may be improved if the number of variables is reduced Variable Elimination Sometimes a set of constraints may be rewritten into an equivalent set with less variables Example: Continuous constraint solvers rely on the efficiency of branch and prune algorithms for enforcing consistency on the CCSP variables Instead of using the constraint system: x 1 + x 2 + x 3 =  1 (x 1 + x 1 x 2 + x 2 x 3 ) x 4 = c 1 (x 2 + x 1 x 3 ) x 4 = c 2 x 3 x 4 = c 3 Consider x 4 = c 3 /x 3 and use the constraint system: x 1 + x 2 + x 3 =  1 (x 1 + x 1 x 2 + x 2 x 3 )c 3 = c 1 x 3 (x 2 + x 1 x 3 )c 3 = c 2 x 3 26 April 2013

6 Lecture 6: Problem Solving6 Modelling Techniques A consequence of numerical errors is the amplification of the variable domains and poor pruning results System Scaling Two major sources of numerical errors are: operations with large numbers (lower density of F-Numbers at this ranges) operands with different magnitudes Scaling the system and making some variable substitutions may avoid such situations as much as possible Continuous constraint solvers rely on interval techniques for dealing with numerical errors. Consider x = 10 20 y and use the constraint: y 2 +3y+2=0 Example: Instead of using constraint: 10 -20 x 2 +3x+2×10 20 =0 26 April 2013

7 Lecture 6: Problem Solving7 Some Languages and Tools PROFIL/BIAS (Programmer's Runtime Optimized Fast Interval Library) http://www.ti3.tu-harburg.de/Software/PROFILEnglisch.html Interval Libraries GAOL: NOT Just Another Interval Library http://sourceforge.net/projects/gaol smath (routines for interval arithmetic and constraint narrowing) http://interval.sourceforge.net/interval/prolog/clip/clip/smath/README.html C FILIB (Fast Interval LIBrary) http://www.math.uni-wuppertal.de/org/WRST/software/filib.html FILIB++ (Fast Interval LIBrary in C++) http://www.math.uni-wuppertal.de/org/WRST/software/filib.html C++ 26 April 2013

8 Lecture 6: Problem Solving8 Some Languages and Tools ILOG Solver (C++) http://www.ilog.com/products/solver Constraint Solving Systems Elisa (C++) http://sourceforge.net/projects/elisa RealPaver (C++) http://www.sciences.univ-nantes.fr/info/perso/permanents/granvil/realpaver Academic CLIP (Prolog) http://interval.sourceforge.net/interval/prolog/clip/README.html Commercial 26 April 2013

9 Lecture 6: Problem Solving9 Some Problems Many continuous problems may be modelled and solved as CCSPs. Some Common Benchmarks Several benchmarks are commonly used to address the quality of the constraint solvers. The following problems illustrate some common benchmarks in interval constraints. For each benchmark we would like to know where are the solutions (if any) satisfying the constraints within the specified ranges 26 April 2013

10 Lecture 6: Problem Solving10 Some Problems 2x 1 =2 2x 2 =1 2x 3 =2 2x 4 =1 2x 5 =x 6 x 5 +2x 6 =2 (x 1 -x 7 ) 2 +x 8 2 -x 7 2 =(x 8 -x 2 ) 2 (x 1 -x 7 ) 2 +x 8 2 -(x 3 -x 7 ) 2 =(x 4 -x 8 ) 2 x 1 2 +x 2 2 -2x 1 x 7 +2x 2 x 8 =0 x 1 2 -x 3 3 -x 4 2 -2x 7 (x 1 -x 3 )+2x 4 x 8 =0 Appolonius Ranges: Constraints: x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8  [-10 8,10 8 ] 26 April 2013

11 Lecture 6: Problem Solving11 Some Problems x 2 + y 2 + z 2 = 36 x + y = z xy + z 2 = 1 Bronstein Ranges: Constraints: x, y, z  [-10 8,10 8 ] 26 April 2013

12 Lecture 6: Problem Solving12 Some Problems Brown Ranges: Constraints: n = 5 x 1, x 2, x 3, x 4, x 5  [-10 8,10 8 ] 26 April 2013

13 Lecture 6: Problem Solving13 Some Problems R = 10 R 5 = 0.193 R 6 = 0.002597/  40 R 7 = 0.003448/  40 R 8 = 0.00001799/40 R 9 = 0.0002155/  40 R 10 = 0.00003846/40 3x 5 =x 1 (x 2 +1) x 2 (2x 1 +x 3 2 +R 8 +2R 10 x 2 +R 7 x 3 +R 9 x 4 )+x 1 =Rx 5 x 3 (2x 2 x 3 +2R 5 x 3 +R 6 +R 7 x 2 )=8x 5 x 4 (R 9 x 2 +2x 4 )=4Rx 5 x 2 (x 1 +R 10 x 2 +x 3 2 +R 8 +R 7 x 3 +R 9 x 4 )+x 1 +x 3 (R 5 x 3 +R 6 )+x 4 2 =1 Chem Ranges: Constraints: x 1, x 2, x 3, x 4, x 5  [0,10 8 ] 26 April 2013

14 Lecture 6: Problem Solving14 Some Problems x 1 2 = x 2 x 4 2 = x 3 2.177e 7 x 2 + 0.55x 1 x 4 + 0.45x 1 = x 4 + 1.697e 7 x 2 x4 1.585×10 14 x 2 x 4 +4.126×10 7 x 1 x 3 +2.284×10 7 x 3 x 4 +48.4x 4 = 8.282×10 6 x 1 x 4 +1.918×10 7 x 3 +27.73 Chemk Ranges: Constraints: x 1, x 2, x 3, x 4  [0,1] 26 April 2013

15 Lecture 6: Problem Solving15 Some Problems y 2 z 2 + y 2 + z 2 + 13 = 24yz x 2 z 2 + x 2 + z 2 + 13 = 24xz x 2 y 2 + x 2 + y 2 + 13 = 24xy Cyclo Ranges: Constraints: x, y, z  [0,10 5 ] 26 April 2013

16 Lecture 6: Problem Solving16 Some Problems x 2 + 2x 6 + x 9 +2x 10 = 10 -5 x 3 + x 8 = 3×10 -5 x 1 + x 3 +2x 5 + 2x 8 + x 9 + x 10 = 5×10 -5 x 4 + 2x 7 = 10 -5 0.5140437×10 -7 x 5 = x 1 2 0.1006932×10 -6 x 6 = 2x 2 2 0.7816278×10 -15 x 7 = x 4 2 0.1496236×10 -6 x 8 = x 1 x 3 0.6194411×10 -7 x 9 = x 1 x 2 0.2089296×10 -14 x 10 = x 1 x 2 2 Combustion Ranges: Constraints: x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8, x 9, x 10  [-10 8,10 8 ] 26 April 2013

17 Lecture 6: Problem Solving17 Some Problems x 1 +5x 2 2 = x 2 3 + 2x 2 + 13 x 1 + x 2 3 + x 2 2 = 14x 2 + 29 Freudenstein Ranges: Constraints: x 1, x 2  [-10 8,10 8 ] 26 April 2013

18 Lecture 6: Problem Solving18 Some Problems 2x 2 2 + 4x 1 x 2 + 4x 1 3 = 42x 1 + 14 2x 1 2 + 4x 1 x 2 + 4x 2 3 = 26x 2 + 22 Himmelblau Ranges: Constraints: x 1, x 2  [-10 8,10 8 ] 26 April 2013

19 Lecture 6: Problem Solving19 Some Problems x 1 = 0.25428722 + 0.183247757 x 4 x 3 x 9 x 2 = 0.37842197 + 0.16275449 x 1 x 10 x 6 x 3 = 0.27162577 + 0.16955071 x 1 x 2 x 10 x 4 = 0.19807914 + 0.15585316 x 7 x 1 x 6 x 5 = 0.44166728 + 0.19950920 x 7 x 6 x 3 x 6 = 0.14654113 + 0.18922793 x 8 x 5 x 10 x 7 = 0.42937161 + 0.21180486 x 2 x 5 x 8 x 8 = 0.07056438 + 0.17081208 x 1 x 7 x 6 x 9 = 0.34504906 + 0.19612740 x 10 x 6 x 8 x 10 = 0.42651102 + 0.21466544 x 4 x 8 x 1 I1 Ranges: Constraints: x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8, x 9, x 10  [-2,2] 26 April 2013

20 Lecture 6: Problem Solving20 Some Problems 6(x 1 x 2 - x 3 x 4 ) + 10 x 1 = 1 6(x 1 x 4 + x 2 x 3 ) + 10 x 3 = 4 x 1 2 + x 3 2 = 1 x 2 2 + x 4 2 = 1 Kincox Ranges: Constraints: x 1, x 2, x 3, x 4  [-1,1] 26 April 2013

21 Lecture 6: Problem Solving21 Some Problems eg + 2dh = 0 9e + 4b = 0 4ch + 2ef + 3dg = 0 7c + 8f = 9a 4df + 5cg + 6h + 3e = 0 5d + 6cf + 7g - 9b = 0 9d + 6a = 5b 7a = 9c + 8 Nauheim Ranges: Constraints: a, b, c, d, e, f, g, h  [-10 8,10 8 ] 26 April 2013

22 Lecture 6: Problem Solving22 Some Problems x 1 2 + x 3 2 =1 x 2 2 + x 4 2 =1 x 5 x 3 3 + x 6 x 4 3 = 5 x 5 x 1 3 + x 6 x 2 3 = 4 x 5 x 1 x 3 2 + x 6 x 4 2 x 2 = 3 x 5 x 1 2 x 3 + x 6 x 2 2 x 4 = 2 x 2  x 1 Neuro Ranges: Constraints: x 1, x 2, x 3, x 4, x 5, x 6  [-10,10] 26 April 2013

23 Lecture 6: Problem Solving23 Some Problems x - lt 3 - Lw =0 y - Lt - lw 3 =0 L = 1 l = 2 x = a 2a = 3 y = b b = rt w 2 + t 2 = 1 Piano Ranges: Constraints: x, y, a, b, r, t, l, L  [-10 5,10 5 ] w  [0,10 5 ] 26 April 2013

24 Lecture 6: Problem Solving24 Some Problems x 1 2 + x 2 2 =1 x 3 2 + x 4 2 =1 x 5 2 + x 6 2 =1 x 7 2 + x 8 2 =1 0.004731x 1 x 3 + x 7 = 0.3578x 2 x 3 + 0.1238x 1 + 0.001637x 2 + 0.9338x 4 + 0.3571 0.2238x 1 x 3 + 0.7623x 2 x 3 + 0.2638x 1 = 0.07745x 2 + 0.6734x 4 + 0.6022 + x 7 x 6 x 8 + 0.3578x 1 + 0.004731x 2 = 0 0.2238x 2 + 0.3461 = 0.7623x 1 Robot Kinematics Ranges: Constraints: x 1, x 2, x 3, x 4, x 5, x 6, x 7, x 8  [-1,1] 26 April 2013

25 Lecture 6: Problem Solving25 Project Use interval constraint techniques to solve systems of nonlinear equations that models Social Argumentation Networks [1]. The problem These are systems with n equations and n unknowns of the form: with 1  i  n, x i  [0,1], a i  (0,1) and m ji  {0,1} [1] J. Leite and J. Martins. Social abstract argumentation. In Proceedings of IJCAI'11, volume 3, 2011. 26 April 2013

26 Lecture 6: Problem Solving26 Project Solve the following systems: a) b) c) Task 1 26 April 2013

27 Lecture 6: Problem Solving27 Project Solve the systems represented in the files: a) example1example1 b) example2example2 c) example3example3 d) example4example4 e) example5example5 f) example6example6 g) example7example7 h) example8example8 with the following format: the first line contains an integer representing the number of variables n; the next n lines represent the values of a i ; the next n lines represent the matrix m. Task 2 26 April 2013

28 Lecture 6: Problem Solving28 Project a)Implement na application to generate and solve a random system of n variables. b)Solve random systems of 5, 10, 15, 20, 25, … variables (10 instances of each) and produce a table with statistical information of its performance (execution time, number of splits, …) Task 3 26 April 2013


Download ppt "26 April 2013Lecture 6: Problem Solving1 Problem Solving Jorge Cruz DI/FCT/UNL April 2013."

Similar presentations


Ads by Google