Professional Documents
Culture Documents
www.cse.unl.edu/~choueiry/F11-496-896
Reading
Required reading
Recommended reading
Outline
Review of terminology of search
Hybrid backtracking algorithms
Variable instantiation
(Current) path
Var 1
v1
v2
Current variable
Past variables
Future variables
Shallow/deep levels /nodes
Search space / search tree
Back-checking
Backtracking
Outline
Review of terminology of search
Hybrid backtracking algorithms
Vanilla: BT
Improving back steps: {BJ, CBJ}
Improving forward step: {BM, FC}
2. Consistency checking:
Backtracking
To recover from dead-ends
1. Chronological (BT)
2. Intelligent
Backjumping (BJ)
Conflict directed backjumping (CBJ)
With learning algorithms (Dechter Chapt 6.4)
Etc.
Consistency checking
To expand consistent paths
1. Back-checking: against past variables
Backmarking (BM)
Hybrid algorithms
Backtracking + checking = new hybrids
BT
BJ
CBJ
BM
BMJ
BM-CBJ
FC
FC-BJ
FC-CBJ
Evaluation:
Empirical: Prosser 93. 450 instances of Zebra
Theoretical: Kondrak & Van Beek 95
Problem Solving with Constraints
10
11
12
bt-unlabel
13
BT-label
1.
2.
3.
4.
14
BT-unlabel
1.
2.
FUNCTION bt-unlabel(i,consistent):INTEGER
BEGIN
3. h i -1
4. current-domain[i] domain[i]
5. current-domain[h] remove(v[h],current-domain[h])
6. consistent current-domain[h] nil
7. return(h)
Is called when consistent=false and current-domain[i]=nil
8.
END
Selects vh to backtrack to
15
V1
V2
V3
v[0]
v[1]
v[2]
v[3]
CV3,V4={(V3=1,V4=3)}
{1,2,3,4,5}
V4
v[4]
etc
CV2,V5={(V2=5,V5=1),(V2=5,V5=4)}
{1,2,3,4,5}
V5
v[5]
16
Outline
Review of terminology of search
Hybrid backtracking algorithms
Vanilla: BT
Improving back steps: BJ, CBJ
Improving forward step: BM, FC
17
18
Backjumping (BJ)
Tries to reduce thrashing by saving some
backtracking effort
When v[i] is instantiated, BJ remembers
v[h], the deepest node of past variables
that v[i] has checked against.
Uses: max-check[i], global, initialized to 0
At level i, when check(i,h) succeeds
1
2
3
0
1
2
3
h-1
h
h-2
h
0
0
h-1
max-check[i] max(max-check[i], h)
Past variable
Current variable
19
BJ: label/unlabel
1
2
3
0
1
2
3
h-1
h
h-2
h
0
0
h-1
0
Problem Solving with Constraints
20
Example: BJ
v[0] = 0
{1,2,3,4,5}
V1
{1,2,3,4,5}
V2
v[1]
v[2]
v[3]
Max-check[1] = 0
Max-check[2] = 1
CV2,V5={(V2=5,V5=1)}
{1,2,3,4,5} V3
CV2,V4={(V2=1,V4=3)}
{1,2,3,4,5}
V4
CV1,V5={(V1=1,V5=2)}
{1,2,3,4,5}
V5
21
CBJ improves on BJ
BacktrackingAlgorithms
Intelligent Backtracking
22
conf-set
conf-set[g] {0}
conf-set[h] {0}
conf-set[i]
{0}
{0}
{0}
{0}
23
CBJ: conflict-set
1
2
3
Past variables
conf-set[g] {x}
{x, 3,1}
h-1
h
conf-set[h] {3}
{3,1, g}
Current variable i
conf-set[i] {1, g, h}
2. Updates
conf-set[h] conf-set[h] (conf-set[i] \{h})
{0}
{0}
{0}
24
Example CBJ
V1
V2
V3
{1,2,3,4,5}
{1,2,3,4,5}
{1,2,3,4,5}
V5
{1,2,3,4,5}
{1,2,3,4,5}
{1,2,3,4,5}
v[1]
conf-set[1] = {0}
v[2]
conf-set[2] = {0}
v[3]
conf-set[3] = {0}
v[4] 1
2
conf-set[4] = {2}
{(V1=1, V5=3)}
v[5] 1
conf-set[5] = {1}
v[6] 1
{(V4=5, V6=3)}
V6
v[0] = 0
{(V1=1,
2
2
conf-set[4] = {1, 2}
3
3
conf-set[6] = {1}
conf-set[6] = {1}
conf-set[6] = {1,4}
V6=3)}
conf-set[6] = {1,4}
conf-set[6] = {1,4}
25
26
27
In unlabel
if (cbf[i]=1)
28
Backtracking: summary
Chronological backtracking
Backjumping
Conflict-directed backjumping
29
Outline
Review of terminology of search
Hybrid backtracking algorithms
Vanilla: BT
Improving back steps: BJ, CBJ
Improving forward step: BM, FC
30
Backmarking: goal
Tries to reduce amount of consistency
checking
Situation:
v[i] about to be re-assigned k
v[i]k was checked against v[h]g
v[h] = g
v[i]
31
BM: motivation
Two situations
v[h] = g
v[i]
v[h] = g
v[i]
32
0 0 0 0
0
0
0
0
Number of variables n
Number of variables n
33
0 0 0 0
0
0
0
0
34
Number of variables n
35
When mcl[i,k]=mbl[i]=j
BM is aware that
So
v[j]
v[i] k
mbl[i] = j
36
Type a savings
When mcl[i,k] < mbl[i], do not check v[i] k because it will fail
v[h]
v[j]
v[i]
mcl[i,k]=h
37
Type b savings
When mcl[i,k] mbl[i], do not check (i,h<j) because they will succeed
v[j]
v[g]
v[i]
mcl[i,k]=g
k
mcl[i,k]mbl[i]
mbl[i] = j
Problem Solving with Constraints
38
Hybrids of BM
mcl can be used to allow backjumping in
BJ
Mixing BJ & BM yields BMJ
39
v[m]
v[m]
v[m]
v[f]
Backmarking of v[h]:
v[g]
v[g]
v[g]
v[h]
v[h]
v[h]
v[i]
v[i]
v[i]
v[h]
40
41
v[i]
v[k]
v[m]
v[j]
v[l]
v[n]
42
check-forward
undo-reductions
update-current-domain
fc-label
fc-unlabel
43
FC: functions
check-forward(i,j) is called when instantiating v[i]
It performs Revise(j,i)
Returns false if current-domain[j] is empty, true
otherwise
Values removed from current-domain[j] are pushed,
as a set, into reductions[j]
44
FC: functions
update-current-domain
fc-label
45
Hybrids of FC
FC suffers from thrashing: it is based on BT
FC-BJ:
FC-CBJ:
46
Backmarking
Forward-checking
47
Experiments
Empirical evaluations on Zebra
48
Analysis of experiments
Algorithms compared with respect to:
1. Number of consistency checks (average)
49
Additional developments
Other backtracking algorithms exist:
Graph-based backjumping (GBJ), etc.
Pseudo-trees [Freuder 85]
[Dechter]
Theoretical comparisons
50
51