InterBlock-Backtracking: Exploiting Structure in
Numerical CSPs Solving
Christophe JermannLINA/CNRS, University of Nantes
Joint work with:
Bertrand Neveu, Gilles TrombettoniI3S/CNRS-INRIA, University of Nice
Outline IBB: a general framework for solving
decomposed NCSPs Principle Inputs Process
IBB+Interval: an instance of IBB Interval solving Interblock Filtering Experiments
Conclusion & Future directions
Outline IBB: a general framework for solving
decomposed NCSPs Principle Inputs/Parameters Process
IBB+Interval: an instance of IBB Interval solving Interblock Filtering Experiments
Conclusion & Future directions
IBB: general sight Main ideas in [Bliek et al, CP98] Since then, made a general framework Parameters: fix to obtain one instance of IBB
a (set of) solving method(s) a backtracking process optional: a set of “add-ons”
Inputs: a decomposed numerical CSP (NCSP)
Output: One (or all the) solution(s) of the NCSP
Numerical CSPs Defined by (X,D,C) where:
X: a set of variables D: a set of continuous domains, one for each xX C: a set of constraints (equations, inequalities, …)
on X Applications:
Physics: forces, electrical measurements… Design & Geometry: distances, angles, … Program verification: instructions with floats, … Robotics: kinematic constraints, … …
Decomposed NCSPs Decomposed(S) = ({S1, S2, …, S3}, <, +)
Si = well-constrained sub-NCSP
< = partial order for Si’s solving + = partial solutions combination operator
Such that Sol(S1)+Sol(S2)+…+Sol(S3) = Sol(S)
Why decompose ? Divide & conquer => reduce solving complexity
Several kinds of decompositions : Equational [Michelucci et al. 1996], [Bliek et al. 1998], … Geometric [Hoffmann et al 1995], [Jermann et al. 2000], …
…
Solving methods NCSP system of (non-linear)
equations/inequalities
Symbolic: Groebner basis, … Numeric: Local (Newton-Raphson, …),
Homotopy, Interval, …
Generally, the structure is under-exploited
IBB allows to generically exploit the structure identified by decomposition
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
I
J
HG
D
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
D
I
J
HG
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D xJ,yJ
xA,yA xC,yC
IHG
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D xJ,yJ
xA,yA xC,yC
IHG
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D xJ,yJ
xA,yA xC,yC
IHG
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D xJ,yJ
xA,yA xC,yC
IHG
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D
xE,yE
xJ,yJ
xA,yA
IHG
xC,yC
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D
xE,yE xF,yF
xJ,yJ
xA,yA xC,yC
IHG
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D
xE,yE xF,yF
YD
xJ,yJ
xA,yA xC,yC
IHG
xB,yB
Exploiting structure Sub-NCSP = block
A subset of constraints All the induced variables
Input variables (computed in another block) Output variables (computed in the block)
Partial order DAGA
BC
E F
J
D
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
IHG
Solving process Choosing a total order:
Compatible with the partial order Fixes a static block ordering for backtracking
purpose
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
Solving a DAG of Blocks Choosing a total order:
Compatible with the partial order Fixes a static block ordering for backtracking
purpose
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Solving a DAG of Blocks Solving each block in sequence
with a solving method which can differ from block to block
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Solving Method 1=> Internal Search Tree 1=> 2 solutions: B1 and B2
Solving a DAG of Blocks Solving each block in sequence
with a solving method which can differ from block to block
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1Solving Method 2=> Internal Search Tree 2=> 2 solutions: E1 and E2 Depending on B1
Solving a DAG of Blocks Solving each block in sequence
with a solving method which can differ from block to block
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1
No Solution in Block 5
Solving a DAG of Blocks Backtracking:
On “no solution”
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1
No Solution in Block 5
Backtracking
Solving a DAG of Blocks Backtracking:
On “no solution”
=> block solving should be complete for this purpose
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1
One global solution B1,E2,F1,D1,G1,H1,I1
F1,D1,G1,H1,I1
E2
Solving a DAG of Blocks Backtracking:
On “no solution” Or on “next solution”
=> block solving should be complete for this purpose
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1
Backtracking for completion
One global solution B1,E2,F1,D1,G1,H1,I1
F1,D1,G1,H1,I1
E2
Solving a DAG of Blocks Backtracking => solving several times the
same block … but not the same problem ! Input variables = parameters
=> Blocks = parametric NCSPs
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1 E2
B2
Block 2The constraints have changeddepending on B2
One global solution B1,E2,F1,D1,G1,H1,I1
Solving a DAG of Blocks Backtracking => solving several times the
same block … but not the same problem ! Input variables = parameters
=> Blocks = parametric NCSPs
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1 E2
B2
Block 2
Solving Method 3=> Internal Search Tree 3=> 2 solutions: E3 and E4 Depending on B2
One global solution B1,E2,F1,D1,G1,H1,I1
Solving a DAG of Blocks Backtracking => solving several times the
same block … but not the same problem ! Input variables = parameters
=> Blocks = parametric NCSPs
xB,yB
xE,yE xF,yF
YD xG,yG
xH,yH
xI,yI
xJ,yJ
xA,yA xC,yC
1
32
4 5
Search Tree
Block 1
Block 2
B1
E1
All the global solutions
E2
B2
Block 2
E3 E4
Possible InterBlock Backtracking BT: Chronological Backtracking GBJ: Graph-based Backjumping [Dechter, 1990] GPB: Generalized Partial-Order BT [Bliek, 1998]
Intelligent Backtracking
xA,yAxC,yC
xB,yB
xE,yE xF,yF
yD xG,yG
xH,yH
xI,yI
xJ,yJ
1
2 3
45
Possible InterBlock Backtracking BT: Chronological Backtracking GBJ: Graph-based Backjumping [Dechter, 1990] GPB: Generalized Partial-Order BT [Bliek, 1998]
Intelligent Backtracking
xA,yAxC,yC
xB,yB
xE,yE xF,yF
yD xG,yG
xH,yH
xI,yI
xJ,yJ
1
2 3
45BT
Possible InterBlock Backtracking BT: Chronological Backtracking GBJ: Graph-based Backjumping [Dechter, 1990] GPB: Generalized Partial-Order BT [Bliek, 1998]
Intelligent Backtracking
xA,yAxC,yC
xB,yB
xE,yE xF,yF
yD xG,yG
xH,yH
xI,yI
xJ,yJ
1
2 3
45BT
GBJGPB
Possible InterBlock Backtracking BT: Chronological Backtracking GBJ: Graph-based Backjumping [Dechter, 1990] GPB: Generalized Partial-Order BT [Bliek, 1998]
Intelligent Backtracking
xA,yAxC,yC
xB,yB
xE,yE xF,yF
yD xG,yG
xH,yH
xI,yI
xJ,yJ
1
2 3
45BT
GBJGPB
GBJGPB
Possible InterBlock Backtracking BT: Chronological Backtracking GBJ: Graph-based Backjumping [Dechter, 1990] GPB: Generalized Partial-Order BT [Bliek, 1998]
Intelligent Backtracking
xA,yAxC,yC
xB,yB
xE,yE xF,yF
yD xG,yG
xH,yH
xI,yI
xJ,yJ
1
2 3
45BT
GBJGPB
GBJGPB
GBJ+
+ = with the recompute condition
IBB: extending the framework Specific treatments as add-ons:
Generally, depending on the solving methods Choose the strategy of application
(before/after/during a block solving, …) E.g.:
Pre-conditioners, Propagators, Inequalities checkers, …
Outline IBB: a general framework for solving
decomposed NCSPs Principle Inputs Process
IBB+Interval: an instance of IBB Interval solving Interblock Filtering Experiments
Conclusion & Future directions
IBB + Interval Solving method = Interval constraint
programming techniques Backtracking: BT, GBJ & GPB
=> 3 instances in fact An interesting add-on: Inter-Block Filtering
(IBF) Propagates domain reductions in following blocks
Interval solving 3 operations:
x
y (x-1)2 -3=y
y<x/3
-x2+3=y
Search space = cross-product of the domains (intervals)
Interval solving 3 operations:
Filtering: reduces the bounds of the domain of each variable using a local consistency
x
y (x-1)2 -3=y
y<x/3
-x2+3=y
Interval solving 3 operations:
Filtering: reduces the bounds of the domain of each variable using a local consistency
x
y (x-1)2 -3=y
y<x/3
-x2+3=y
Interval solving 3 operations:
Filtering: reduces the bounds of the domain of each variable using a local consistency
Splitting: splits search space into parts to be explored individually => a search-tree appears
x
y (x-1)2 -3=y
y<x/3
-x2+3=y
Interval solving 3 operations:
Filtering: reduces the bounds of the domain of each variable using a local consistency
Splitting: splits search space into parts to be explored individually => a search-tree appears
Existence: checks if a unique solution exists in the current sub-search-space
x
y (x-1)2 -3=y
y<x/3
-x2+3=y
InterBlock Filtering
AB
C
Block 1
Principle: Use local consistency to propagate the reductions during the solving of current blocks in related blocs
InterBlock Filtering
AB
C
Block 1
AB
C
E1
Block 2E2
InterBlock Filtering
AB
C
Block 1
AB
C
E1
Block 2E2
F
AB
CE1
Block 3E2
InterBlock Filtering
AB
C
Block 1
AB
C
E1
Block 2E2
F
AB
CE1
Block 3E2
D??F
AB
CE1
Block 4E2
InterBlock Filtering
AB
C
Block 1
AB
C
E1
Block 2E2
F
AB
CE1
Block 3E2
D??F
AB
CE1
Block 4E2
Using IBF, E1 incompatibility can be detected in Block 2by propagating on Block 4
Benchmarking Implemented as a C++ prototype Run on a PIII 935 Experimental protocol:
Parameters: ~12 instances of IBB+Interval Interval Solving: (uses ILOG Solver 5.0)
Filtering: 2B, 3B, Box, Bound, 2B+Box, 3B+Bound; best choice per problem (usually 2B+Box or
3B) Splitting: classical interval bisection Existence: always and only with Box and Bound
Backtracking: BT, GBJ, GPB, with or without + InterBlock Filtering: with or without
Inputs: NCSPs: 8 from CAD, 4 domain sizes Decomposition: best among 4 methods
Test set GCSP Size Size Dec. 1,E-01 1,E+00 1,E+01 1,E+02 Mechanism 98 98 = 1x10, 2x4, 27x2, 26x1 1 8 48 448 Ponts 30 30 = 1x14, 6x2, 4x1 1 15 96 128 Sierpinski3 84 124 = 44x2, 36x1 1 4(8) 42(58) 60(138) Tangent 28 42 = 2x4, 11x2, 12x1 4 16 32 64 Triangles 46 46 = 3x6, 3x4, 8x2 1 1(4) 4(8) 4(8) Chair 178 178 = 1x15,1x13,1x9,5x8,3x6,2x4,14x3,1x2,31x1 6 6 18 36 Hourglass 29 39 = 2x4, 3x3, 2x2, 18x1 1 1 2 8 Tetra 30 30 = 1x9, 4x3, 1x2, 7x1 1 16 68 256
Overall comparisonw/ IBF IBF w/ IBF IBF w/ IBF IBF w/ IBF IBF
Global BT 3,3 XXS 3,2 XXS 9,4 XXS 12,4 XXSGlobal BT 0,17 14,1 0,6 15 2,8 18,7 13,3 32,8BT+ 0,11 14,1 0,4 13,6 2,6 17,2 13,1 30,6GBJ 0,1 14,1 0,4 13,5 2,6 17,3 13,1 30,4GPB 0,1 14,2 0,4 13,3 2,7 17,4 13,1 30,53B(GBJ) 0,23 0,68 1,7 2,3 9,7 11 83 88Global BT+ 0,03 0,88 0,03 1,64 0,06 1 0,06 1,21GBJ 0,04 0,75 0,03 1,6 0,02 0,83 0,06 1,19GPB 0,05 0,73 0,03 1,61 0,05 0,88 0,05 1,153B(GBJ) 0,03 0,3 0,05 0,6 0,05 0,2 0,1 0,4Global 3B-BT 0,1 1,32 12,3 160 96 788 136 10943B-BT+ 0,1 1,32 12,7 160 67 703 93 9283B-GBJ 0,1 1,32 12 166 61 682 85 916Global BT+ 0,05 1,26 0,11 1,89 0,13 7,63 0,2 8,15BJ 0,07 1,17 0,11 1,89 0,14 7,69 0,19 8GPB 0,07 1,19 0,1 1,93 0,11 7,69 0,22 8,043B(GBJ) 0,2 0,7 0,2 1,3 0,2 1,3Global BT 9,96 70 40 137 81 241 80 240BT+ 9,96 70 29 99,6 78 102 78 102BJ 9,96 70 29 99,6 78 102 78 102GPB 9,96 70 29 99,6 49 102 49 102
39 46
>54000
0,3
Triangle
8,63 2908 2068 1987
Tangent
0,5 35
XXS
Sierpinski3
3,1 >54000 >54000
1,E-01
XXS
Hour-glass
0,12 1,89 1,47 22,77
Mechanism
XXS XXS
1,E+00 1,E+01 1,E+02
Chair XXS XXS XXS XXS
NCSP IBB
w/ IBF IBF w/ IBF IBF w/ IBF IBF w/ IBF IBF Global BT 3,3 XXS 3,2 XXS 9,4 XXS 12,4 XXSGlobal BT 0,17 14,1 0,6 15 2,8 18,7 13,3 32,8BT+ 0,11 14,1 0,4 13,6 2,6 17,2 13,1 30,6GBJ 0,1 14,1 0,4 13,5 2,6 17,3 13,1 30,4GPB 0,1 14,2 0,4 13,3 2,7 17,4 13,1 30,53B(GBJ) 0,23 0,68 1,7 2,3 9,7 11 83 88Global BT+ 0,03 0,88 0,03 1,64 0,06 1 0,06 1,21GBJ 0,04 0,75 0,03 1,6 0,02 0,83 0,06 1,19GPB 0,05 0,73 0,03 1,61 0,05 0,88 0,05 1,153B(GBJ) 0,03 0,3 0,05 0,6 0,05 0,2 0,1 0,4Global 3B-BT 0,1 1,32 12,3 160 96 788 136 10943B-BT+ 0,1 1,32 12,7 160 67 703 93 9283B-GBJ 0,1 1,32 12 166 61 682 85 916Global BT+ 0,05 1,26 0,11 1,89 0,13 7,63 0,2 8,15BJ 0,07 1,17 0,11 1,89 0,14 7,69 0,19 8GPB 0,07 1,19 0,1 1,93 0,11 7,69 0,22 8,043B(GBJ) 0,2 0,7 0,2 1,3 0,2 1,3Global BT 9,96 70 40 137 81 241 80 240BT+ 9,96 70 29 99,6 78 102 78 102BJ 9,96 70 29 99,6 78 102 78 102GPB 9,96 70 29 99,6 49 102 49 102
>54000
0,31987
Tangent
0,5 35
Triangle
8,63 2908 2068
39 46
XXS
Sierpinski3
3,1 >54000 >54000
1,E-01
XXS
Hour-glass
0,12 1,89 1,47 22,77
Mechanism
XXS XXS
1,E+00 1,E+01 1,E+02
Chair XXS XXS XXS XXS
NCSP IBB
Overall comparison
w/ IBF IBF w/ IBF IBF w/ IBF IBF w/ IBF IBF Global BT 3,3 XXS 3,2 XXS 9,4 XXS 12,4 XXSGlobal BT 0,17 14,1 0,6 15 2,8 18,7 13,3 32,8BT+ 0,11 14,1 0,4 13,6 2,6 17,2 13,1 30,6GBJ 0,1 14,1 0,4 13,5 2,6 17,3 13,1 30,4GPB 0,1 14,2 0,4 13,3 2,7 17,4 13,1 30,53B(GBJ) 0,23 0,68 1,7 2,3 9,7 11 83 88Global BT+ 0,03 0,88 0,03 1,64 0,06 1 0,06 1,21GBJ 0,04 0,75 0,03 1,6 0,02 0,83 0,06 1,19GPB 0,05 0,73 0,03 1,61 0,05 0,88 0,05 1,153B(GBJ) 0,03 0,3 0,05 0,6 0,05 0,2 0,1 0,4Global 3B-BT 0,1 1,32 12,3 160 96 788 136 10943B-BT+ 0,1 1,32 12,7 160 67 703 93 9283B-GBJ 0,1 1,32 12 166 61 682 85 916Global BT+ 0,05 1,26 0,11 1,89 0,13 7,63 0,2 8,15BJ 0,07 1,17 0,11 1,89 0,14 7,69 0,19 8GPB 0,07 1,19 0,1 1,93 0,11 7,69 0,22 8,043B(GBJ) 0,2 0,7 0,2 1,3 0,2 1,3Global BT 9,96 70 40 137 81 241 80 240BT+ 9,96 70 29 99,6 78 102 78 102BJ 9,96 70 29 99,6 78 102 78 102GPB 9,96 70 29 99,6 49 102 49 102
1,E+00 1,E+01 1,E+02
Chair XXS XXS XXS XXS
NCSP IBB1,E-01
XXS
Hour-glass
0,12 1,89 1,47 22,77
Mechanism
XXS XXS XXS
Sierpinski3
3,1 >54000 >54000
1987
Tangent
0,5 35
Triangle
8,63 2908 2068
39 46
>54000
0,3
Overall comparison
w/ IBF IBF w/ IBF IBF w/ IBF IBF w/ IBF IBF Global BT 3,3 XXS 3,2 XXS 9,4 XXS 12,4 XXSGlobal BT 0,17 14,1 0,6 15 2,8 18,7 13,3 32,8BT+ 0,11 14,1 0,4 13,6 2,6 17,2 13,1 30,6GBJ 0,1 14,1 0,4 13,5 2,6 17,3 13,1 30,4GPB 0,1 14,2 0,4 13,3 2,7 17,4 13,1 30,53B(GBJ) 0,23 0,68 1,7 2,3 9,7 11 83 88Global BT+ 0,03 0,88 0,03 1,64 0,06 1 0,06 1,21GBJ 0,04 0,75 0,03 1,6 0,02 0,83 0,06 1,19GPB 0,05 0,73 0,03 1,61 0,05 0,88 0,05 1,153B(GBJ) 0,03 0,3 0,05 0,6 0,05 0,2 0,1 0,4Global 3B-BT 0,1 1,32 12,3 160 96 788 136 10943B-BT+ 0,1 1,32 12,7 160 67 703 93 9283B-GBJ 0,1 1,32 12 166 61 682 85 916Global BT+ 0,05 1,26 0,11 1,89 0,13 7,63 0,2 8,15BJ 0,07 1,17 0,11 1,89 0,14 7,69 0,19 8GPB 0,07 1,19 0,1 1,93 0,11 7,69 0,22 8,043B(GBJ) 0,2 0,7 0,2 1,3 0,2 1,3Global BT 9,96 70 40 137 81 241 80 240BT+ 9,96 70 29 99,6 78 102 78 102BJ 9,96 70 29 99,6 78 102 78 102GPB 9,96 70 29 99,6 49 102 49 102
1,E+00 1,E+01 1,E+02
Chair XXS XXS XXS XXS
NCSP IBB1,E-01
XXS
Hour-glass
0,12 1,89 1,47 22,77
Mechanism
XXS XXS XXS
Sierpinski3
3,1 >54000 >54000
1987
Tangent
0,5 35
Triangle
8,63 2908 2068
39 46
>54000
0,3
Overall comparison
Outline IBB: a general framework for solving
decomposed NCSPs Principle Inputs Process
IBB+Interval: an instance of IBB Interval solving Interblock Filtering Experiments
Conclusion & Future directions
Conclusion We have presented a general framework
for solving decomposed NCSPs Instanciating the framework = choosing a BT
process, a set of solving methods, and optionally a set of add-ons
From the experiments, we can say that: Decomposition seems very interesting for NCSPs
with a structure Filtering, a strength of constraint programming,
seems counter-productive when used against the structure
Intelligent BT seems more profitable, and introduces at least no overhead
Future directions Try other instances of IBB, involving
different solvers Intervals + symbolic …
Solver dynamic selection strategies According to blocks’ properties that may change
(block = parametric NCSP) Use other frameworks to solve decomposed
NCSPs Multi-agent systems Solver cooperation frameworks …