Towards robust DACbased solvers for WCSP - PowerPoint PPT Presentation

1 / 61
About This Presentation
Title:

Towards robust DACbased solvers for WCSP

Description:

t partial assignation. ci(t): Top ? N Upper Bound. C ? N Lower Bound ... Partial assignation = t. Boosting search with LC. BT(X,D,C) if (X= ) then Top :=c. else ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 62
Provided by: larr79
Category:

less

Transcript and Presenter's Notes

Title: Towards robust DACbased solvers for WCSP


1
Towards robust DAC-based solvers for WCSP
  • Federico Heras Javier Larrosa
  • Universitat Politècnica de Catalunya Barcelona,
    Spain

2
Outline
  • Weighted CSP.
  • Solving WCSP.
  • Systematic Search.
  • Local Consistency.
  • Variable ordering for DAC-based solvers.
  • FDAC alternate FDACalt.
  • FDAC 2 passes FDAC2p.
  • FDAC K passes FDACK.
  • Conclusions and Future Work.

3
Outline
  • Weighted CSP.
  • Solving WCSP.
  • Variable ordering for DAC-based solvers.
  • Conclusions and Future Work.

4
Weighted CSP
  • WCSP (X,D,C,Top, C?)
  • Xx1,..., xn variables
  • DD1,..., Dn finite domains
  • Cc1,..., ce cost functions
  • var(ci) scope
  • t partial assignation
  • ci(t) ? ?
  • Top ? N Upper Bound
  • C? ? N Lower Bound

5
Weighted CSP
  • Obj. Function F(X) Si1..N ci(X)
  • Solution F(t) lt Top
  • Goal Find minimal cost solution
  • Complexity NP - Complete

6
WCSP Example
  • 3-coloring a graph
  • Colors
  • Red (r)
  • Green (g)
  • Blue (b)

Maximize the number of blue vertices
7
WCSP Example
ci(xi) xi 0 b 1 g
1 r
Top6
c?0
x3
c(xi,xj) xi xj 6 b
b 0 b g 0
b r 0 g b
6 g g 0 g
r 0 r b 0
r g 6 r r
x2
x1
x4
x5
8
WCSP Example
Xx y z Div w CCxz Cyz Cx Cy
Cz C?
9
WCSP Example
Top4
C? 0
Xx y z Div w CCxz Cyz Cx Cy
Cz C?
x
v
2
2
z
w
0
v
2
1
1
w
1
v
1
0
1
w
0
y
10
WCSP Example
Top4
C? 0
Xx y z Div w CCxz Cyz Cx Cy
Cz C?
x
v
2
2
z
w
0
v
2
1
1
w
1
v
1
0
1
w
0
y
Valuation 212100Top Not a solution
11
WCSP Example
Top4
C? 0
Xx y z Div w CCxz Cyz Cx Cy
Cz C?
x
v
2
2
z
w
0
v
2
1
1
w
1
v
1
0
1
w
0
y
12
WCSP Example
Top4
C? 0
Xx y z Div w CCxz Cyz Cx Cy
Cz C?
x
v
2
2
z
w
0
v
2
1
1
w
1
v
1
0
1
w
0
Valuation 0101002 (optimal) solution
y
13
Outline
  • Weighted CSP.
  • Solving WCSP.
  • Variable ordering for DAC-based solvers.
  • Conclusions and Future Work.

14
Systematic search
Each node is a WCSP subproblem
Partial assignation t
variables
Lower Bound C?
If C? ? Top then prune
Upper Bound Top
15
Boosting search with LC
  • BT(X,D,C)
  • if (X?) then Top c?
  • else
  • xj selectVar(X)
  • forall a?Dj do
  • Condition C with (xj , a)
  • LocalConsistency()
  • if (c?ltTop) then BT(X-xj,D-Dj,C)

16
Local Consistency
  • Incomplete Inference methods
  • Local property enforceable in polynomial time
    that makes the problem more explicit
  • Well known in classical CSP
  • NC, AC, PC, ...

17
WCSP Local consistencies
NC O(nd)
AC O(n 2d 3)
DAC O(ed 2)
FDAC O(end 3)
18
Node Consistency (NC)
  • For all variable i
  • ?a, C? Ci (a)ltT
  • ? a, Ci (a) 0
  • Complexity
  • O(nd)

19
Node Consistency (NC)
  • For all variable i
  • ?a, C? Ci (a)ltT
  • ? a, Ci (a) 0
  • Complexity
  • O(nd)

20
Node Consistency (NC)
  • For all variable i
  • ?a, C? Ci (a)ltT
  • ? a, Ci (a) 0
  • Complexity
  • O(nd)

21
Node Consistency (NC)
  • For all variable i
  • ?a, C? Ci (a)ltT
  • ? a, Ci (a) 0
  • Complexity
  • O(nd)

22
Node Consistency (NC)
  • For all variable i
  • ?a, C? Ci (a)ltT
  • ? a, Ci (a) 0
  • Complexity
  • O(nd)

Top3
C? 1
x
y
v
v
1
0
w
w
0
23
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 0
x
y
2
v
v
0
0
w
w
0
1
1
24
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 0
x
y
2
v
v
0
0
w
w
0
1
1
25
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 0
x
y
1
v
v
0
1
w
w
0
1
26
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 0
x
y
1
v
v
0
1
w
w
0
1
27
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 1
x
y
1
v
v
0
0
w
w
0
0
28
Arc Consistency (AC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) 0
  • b is a support
  • complexity
  • O(n 2d 3)

Top2
C? 1
x
y
1
v
v
0
0
w
w
0
0
29
Directional AC (DAC)
  • NC
  • For all Cij (iltj)
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • b is a full-support
  • complexity
  • O(ed 2)

Top2
C? 0
X lt y
y
x
1
v
v
0
0
w
w
1
1
30
Directional AC (DAC)
  • NC
  • For all Cij (iltj)
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • b is a full-support
  • complexity
  • O(ed 2)

Top2
C? 0
X lt y
y
x
1
v
v
0
0
1
1
w
w
0
1
31
Directional AC (DAC)
  • NC
  • For all Cij (iltj)
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • b is a full-support
  • complexity
  • O(ed 2)

Top2
C? 0
X lt y
y
x
v
v
1
0
1
w
w
0
1
32
Directional AC (DAC)
  • NC
  • For all Cij (iltj)
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • b is a full-support
  • complexity
  • O(ed 2)

Top2
C? 0
X lt y
y
x
v
v
1
0
1
w
w
0
1
33
Directional AC (DAC)
  • NC
  • For all Cij (iltj)
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • b is a full-support
  • complexity
  • O(ed 2)

Top2
C? 1
X lt y
y
x
v
v
0
0
1
w
w
0
0
34
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
0
1
z
w
0
v
0
w
1
35
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
0
1
z
w
0
1
v
0
1
w
0
36
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
1
z
w
0
v
0
1
w
0
37
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
1
z
w
0
v
0
1
w
0
38
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
0
1
z
w
0
1
v
0
1
w
0
39
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
0
1
z
w
0
v
0
w
1
40
Full AC (FAC)
  • NC
  • For all Cij
  • ?a ? b
  • Cij(a,b) Cj(b) 0
  • (full support)

Top4
C? 0
x
v
0
1
z
w
0
v
0
w
1
Thats our starting point! No termination!!!
41
Full DAC (FDAC)
FDAC AC DAC
Support
Full-Support
iltj
igtj
complexity O(end 3)
42
Boosting search with LC
MFDAC
MAC/MDAC
MNC
BT
43
Outline
  • Weighted CSP.
  • Solving WCSP.
  • Variable ordering for DAC-based solvers.
  • Conclusions and Future Work.

44
Variable ordering for DAC based solvers
  • Remember DAC and FDAC rely on a variable
    ordering.
  • Observation The performance of the algorithm
    will depend greatly of the variable ordering
    fixed.
  • N! possible variable orderings.
  • Little is known about good variable ordering for
    DAC-based algorithms.

45
Variable ordering for DAC based solvers
  • Notation
  • Lex. ord. 1,2,3,,N.
  • Reverse-lex. ord. N,N-1,N-2,,1.
  • DAC with lex. ord. DAC.
  • DAC with rev.-lex. ord. DACr.
  • Similar for FDAC and FDACr.

46
Lexicographical VS reverse lexicographical
CPU TIMES PENTIUM III 800 MHZ
47
Lexicographical VS reverse lexicographical
  • Example
  • N10 and j3.
  • Which variables get costs from j?
  • FDAC i1,2.
  • FDACr i10,9,8,7,6,5,4.
  • Idea We combine lexicographical and
    reverse-lexicographical ordering (or any ordering
    and its reverse).

48
FDACAlt (FDAC alternate)
  • At even level of the search tree apply FDAC.
  • At odd level of the search tree apply FDACr.

FDAC
FDACr
FDAC
FDACr
FDAC
49
FDAC2p (FDAC 2 passes)
  • At each node of the search tree, apply first FDAC
    and then FDACr.
  • DAC property is accomplished only in the reverse
    order.

FDAC FDACr
FDAC FDACr
FDAC FDACr
FDAC FDACr
FDAC FDACr
50
Experimental results
CPU TIMES PENTIUM III 800 MHZ
51
Experimental results
2
1
3
2
4
2
52
Experimental results
CPU TIME
VISITED NODES
TIME IMPROVEMENT 25
FDAC2p
NODE IMPROVEMENT 300
53
Experimental results
  • Experimental results indicate that FDAC2p is the
    best option.
  • Can we improve even further?
  • FDAC2p Only execute two passes at each node.
  • We can extend FDAC2p to a FDAC algorithm that
    executes K passes.

54
FDACK (FDAC K passes)
  • At each node of the search tree, apply first FDAC
    and then FDACr K times.
  • For K1 we obtain FDAC2p.
  • For K ? algorithm must stop when it cannot
  • Increment the LB.
  • Prune values.

(FDAC FDACr) K times
(FDAC FDACr) K times
(FDAC FDACr) K times
(FDAC FDACr) K times
(FDAC FDACr) K times
55
Experimental results FDACK
VISITED NODES 1/1000
56
Experimental results FDACK
CPU TIMES PENTIUM III 800 MHZ
57
Selecting one strategy
  • Empirical results indicate that FDAC2p is the
    best option.
  • Since FDAC2p executes two passes at each node,
    the overhead is doubled
  • So it is necessary to visit less than half of the
    nodes in order to improve.

58
Outline
  • Weighted CSP.
  • Solving WCSP.
  • Variable ordering for DAC-based solvers.
  • Conclusions and Future Work.

59
Conclusions
  • DAC-Based algorithms performance rely on a
    variable ordering.
  • Alternating variable ordering from any order to
    its reverse extracts a lot of useful information.
  • Empirically, we have shown that FDAC2p is the
    best option.

60
Future work
  • Find heuristics for variable ordering in
    DAC-based algorithms. Two types of heuristics
  • Static Before entering the branch and bound
    stablish a variable ordering that will be used
    trought all the search tree.
  • Dynamic At each node of search tree a new
    variable ordering is stablished.

61
Final remarks
  • Experiments performed with Toolbar
  • State-of-art solver for WCSP.
  • Free software for windows and linux operative
    systems.
  • Obtain it http//carlit.toulouse.inra.fr/cgi-bin
    /viewcvs.cgi/WCSP/.
Write a Comment
User Comments (0)
About PowerShow.com