Applying Structural Decomposition Methods to Crossword Puzzle Problems
description
Transcript of Applying Structural Decomposition Methods to Crossword Puzzle Problems
October 2nd, 2005 Zheng – DocProg CP’05 1
Constraint Systems Laboratory
Applying Structural Decomposition Methods to Crossword P
uzzle Problems
Student: Yaling ZhengAdvisor: Berthe Y. Choueiry
Constraint Systems LaboratoryDepartment of Computer Science & Engineering
University of Nebraska-Lincoln
October 2nd, 2005 Zheng – DocProg CP’05 2
Constraint Systems Laboratory
HINGETCLUSTER
Gyssens et al., 1994HYPERCUTSETGottlob et al., 2000
TCLUSTERDechter & Pearl,
1989
BICOMPFreuder, 1985
HYPERTREEGottlob et al., 2002
HINGEGyssens et al.,
1994
CaT
CUT
HINGE+ TRAVERSE
CUTSETDechter, 1987
Structural decomposition methods
Criteria for comparing decomposition methods:1. Width of an x-decomposition = largest number of hyperedges i
n a node of the tree generated by x-decomposition2. CPU time for generating the tree
October 2nd, 2005 Zheng – DocProg CP’05 3
Constraint Systems Laboratory
S1 S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
Constraint hypergraph
• A vertex represents a variable• A hyperedge represents a constraint (delimits it
s scope)• Cut is a set of hyperedges whose removal discon
nects the graph• Cut size is the number of hyperedges in the cut
October 2nd, 2005 Zheng – DocProg CP’05 4
Constraint Systems Laboratory
S2
S4
S3 S5 S7S6 S8
S12 S13 S14S11
S9
width = 12
S1 S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
S10S9
S16S9
S15S9
S17S11
S1 S2
In HINGE, the cut size is limited to 1
HINGE [Gyssens et al., 94]
October 2nd, 2005 Zheng – DocProg CP’05 5
Constraint Systems Laboratory
HINGE+: maximum cut size is a parameter
S2
S4
S3
S5
S7
S6
S12
S13
S11S9
S16
S17
S9
S11
S5
S4S6
S12
S8
S14
width = 5
S1 S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
S8
S14
S7
S13
S10S9
S15S9
S1 S2
HINGE+ with maximum cut size of 2:
October 2nd, 2005 Zheng – DocProg CP’05 6
Constraint Systems Laboratory
CUT
S2
S4
S3 S7
S8
S13
S14
S11S9
S17
S5
S6
S12
S7
S13
S8
S14
S6 S12
S4
S3
S11
S5
S6
S12
S1 S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
width = 4
S10S9
S16S9
S15S9
S1 S2
A tree node contains at most 2 of the selected cuts
October 2nd, 2005 Zheng – DocProg CP’05 7
Constraint Systems Laboratory
TRAVERSE-I
S1
S2
S3
S4
S5
S11
S6
S12
S17
S7
S13
S8
S14
S9
S10
S15
S16
S1 S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
width = 3
• TRAVERSE-I starts from one set of hyperedges, and• Sweeps through the network
October 2nd, 2005 Zheng – DocProg CP’05 8
Constraint Systems Laboratory
TRAVERSE-II
S2
S3
S4
S5
S11
S6
S12
S17
S7
S13
S8
S14
S9
S10
S15
S9
S16
S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16S17
width = 3
• TRAVERSE-II starts from one set of hyperedges {s1},• Sweeps the network, and • Ends at another set of hyperedges {s9, s16}.
S1
S1
October 2nd, 2005 Zheng – DocProg CP’05 9
Constraint Systems Laboratory
CaT: combines CUT and TRAVERSE
S1
S2
S3
S4
S7
S8
S13
S14
S11
S10
S9
S17
S2
S9S5
S6
S12
S7
S13
S6 S12
S11
S5
CUT
S1S2
S4
S3 S5 S7S6
S15
S8
S12 S13 S14S11
S10
S9
S16
S17
S4
S3S6
S12
S8
S14
S16S9
S15S9
S1S7 S8
S13 S14S11
S10
S9
S17
S5
S4
S3 S6
S12S16
S15
S2
width = 2
Original
CaT
width = 4
October 2nd, 2005 Zheng – DocProg CP’05 10
Constraint Systems Laboratory
Experiments• Test problems:
– Random CSPs– 51 instances of fully interlocked CPPs, from C
rossword Puzzle Grid Library puzzles.about.com/library
• Compared: – HINGE, HINGE+, CUT, TRAVERSE, and CaT – (Hypertree was too expensive to run on CPPs)
• Criteria: width and CPU time
October 2nd, 2005 Zheng – DocProg CP’05 11
Constraint Systems Laboratory
Results on random CSPs
• CPU time:
• Width:
TRAVERSE CUT CaT HINGE+ HYPERTREE
TRAVERSEHYPERTREE CaT HINGE+ CUT HINGE
HINGE
October 2nd, 2005 Zheng – DocProg CP’05 12
Constraint Systems Laboratory
CPPs: CPU time (ms)
0
100000
200000
300000
400000
500000
600000
700000
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 HINGE
HINGE+
CaT
TRAVERSE
Instance ID
October 2nd, 2005 Zheng – DocProg CP’05 13
Constraint Systems Laboratory
CPPs: width
HINGE
HINGE+
CaT
TRAVERSE
Instance ID
0
20
40
60
80
100
120
140
160
180
200
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51
October 2nd, 2005 Zheng – DocProg CP’05 14
Constraint Systems Laboratory
CPP: Notable exception
• On only 1 CPP, HINGE outperforms CaT
HINGE CaT
October 2nd, 2005 Zheng – DocProg CP’05 15
Constraint Systems Laboratory
Current investigations
• Test on special constraint hypergraphs • Study the cost of solving the CSPs after
decomposition [Jégou and Tierroux, 03]
• Preprocessing by ‘subproblem’ elimination– Recursively eliminate vertices that appear in
one hyperedge– Solve and eliminate subproblems that have f
ew solutions (tight constraints)
October 2nd, 2005 Zheng – DocProg CP’05 16
Constraint Systems Laboratory
Thank you for your attention.
Research supported by CAREER Award #0133568 from NSF. Experiments conducted on PrairieFire of the Research Computing Facilities (RCF) of CSE-UNL.
Questions…
October 2nd, 2005 Zheng – DocProg CP’05 17
Constraint Systems Laboratory
Additional Slides
October 2nd, 2005 Zheng – DocProg CP’05 18
Constraint Systems Laboratory
How do we choose a cut?
S2
S4
S3 S5 S7S6 S8
S12 S13 S14S11
S9
S17
S2
S4
S3 S5 S7S6 S8
S12 S13 S14S11
S9
S17
When there are multiple cuts to choose, we choose the cut whose removal makesthe greatest number of hyperedges in a connected hypergraph the smallest.
8
7
October 2nd, 2005 Zheng – DocProg CP’05 19
Constraint Systems Laboratory
TRAVERSE
When applying TRAVERSE to these CPPs, we choose the decomposition whose width is the smallest among all the decompositions that starts from an arbitrary hyperedge.