Document 7347361

Download Report

Transcript Document 7347361

Tackling
Post’s Correspondence Problem
Ling Zhao
Department of Computing Science
University of Alberta
July 31, 2001
Preconceptions
•
•
•
•
Easy to state, impossible to solve!
Some instances can be solved
Purely theoretical problem before
A few solving methods were raised recently
Lorentz, R.J., Creating difficult instances of the Post
Correspondence Problem, (CG2000), 145-159, 2000.
An example of a PCP instance
1
100
1
2
3
0
1
100 00
Rules:
1. Select pairs
2. Make the concatenated top string and
bottom string identical
1 3 1 1 3 2 2
100 1 100 100 1 0 0
1 00 1 1
00 100 100
1001100100100
1001100100100
Instance solved!
Definitions
Given an alphabet  ={0, 1}, one instance of Post’s correspondence
problem of size s is a finite set of pairs of strings (gi , hi) ( i = 1…s, s
 1) over the alphabet . A solution of length n  1 to this instance
is a sequence i1 i2 ... in of selections such that the strings gi1gi2 ... gin
and hi1hi2 ... hin formed by concatenation are identical.
Size: the number of pairs Width: the length of longest string
Optimal solution: the solution with shortest length
Optimal length: the length of the optimal solution
Configuration: the longer portion that one side goes beyond the other.
Configuration is either at the top or at the bottom.
Theoretical place
• Raised by Emil L. Post in 1946 as an classic
undecidable problem
• Bounded version is NP-complete
• The PCP of size 2 is decidable
• The PCP of size 7 is undecidable
• Open problem: decidability of PCP of size
between 3 and 6
• Application: to prove the undecidability of other
problems
Facts & Motivations
• Some PCP instances have no solutions
• Some instances have solutions
• Some instances have more than one optimal
solution
• Only a small portion of instances have long
optimal solutions (the difficult instances).
Progress in three directions
1. Searching optimal solutions efficiently
and quickly
2. Prove instances with no solutions
3. Creating difficult instances
Search optimal solutions
• Basically a single-agent search problem
• Traditional search techniques and methods
can be migrated to solve PCP instances
• Due to the special characteristics of PCP,
some new application-dependent methods
are invented
Search optimal solutions (cont’d)
•
•
•
•
•
Iterative-deepening depth-first search
Cache scheme
Mask method
Bidirectional probing
Heuristic pruning
Mask method
Mask method: use the possibility of ending the
configurations on one side to prune nodes
Critical configuration: a non-empty configuration
that can be fully matched or be turned over.
1
100
1
2
3
0
1
100 00
Two critical configurations at
the top:
‘1’ and ’10’
Mask method
1 2 3 4
01 00 1 001
0 011 101 1
1. Find all critical configurations
2. Test whether these configuration are
valid, i.e., possible to be generated
1. Only one critical configuration at the top
exist: ’10’.
2. It can not be generated because configuration
’01’ at the bottom in its reversal can not lead
to a solution
3. It has the top mask
Reversal:
1 2 3 4
10 00 1 100
0 110 101 1
Bidirectional pruning
• Let P: (gi , hi ) ( i = 1…s) be a PCP instance. P’s
reversal is (giR, hiR) ( i = 1…s), while giR, hiR are
the reversals of string gi and hi respectively.
• A PCP instance has the same solvability as its
reversal in the sense that it has a solution if and
only if its reversal has, and it has the same
number of optimal solutions and the same
optimal length as its reversal.
Bidirectional pruning
• Solving any direction is enough
• Yet search difficulties in two directions may
differ greatly
• Using probing scheme to decide which
direction is promising
• Predicting correctly in most cases because
of the stable branching factors
Heuristic pruning
• Learned from the well-known search
algorithms such as A* and IDA*
• But use the heuristic value to prune
hopeless nodes
c: a configuration
g(c): current depth for c
h(c): heuristic value for c
if ( g(c) + h(c) > depth threshold )
then c can be pruned
Heuristic pruning example
1
110
1
2
3
0
1
111 01
1. Suppose a configuration in the top
has 81 bits and its depth is 60.
2. Search depth threshold is 100.
3. The maximum shrinking length in
every step is 2.
4. Impossible to get a solution below
depth 100. This configuration can
be pruned.
Heuristic pruning facts
• The simple heuristic can reduce the number
of visited node by roughly 80%
• Complicated heuristic value can be obtained
by pre-computing the matching results of
shorter configurations (similar to the pattern
database in 15-puzzle).
• Influence the use of move ordering
Prove instances with no solutions
•
•
•
•
Filters
Mask method
Exclusion method
Pattern method
Filters
1. Prefix/postfix filter
000 0 1
1 100 0
2. Length balance filter
000 100 1
0 10 0
3. Element balance filter
101 1 01
10 01 0
Mask method
• The mask method is also useful to prove an
instance has no solutions
• the masks of one instance and its reversal
are interdependent. The discovering process
of masks need to be iterated until no
changes come out.
Exclusion method
Basic idea: exclude pairs that can not be used
1
2
3
When starting from pair 2, the following
selection can only be pair 1 or pair 2.
1
0 101
Reason: Any combinations of the
0 001 1
bottom strings in pair 1 and pair 2 can
not generate a substring ‘101’, the top
string in pair 3.
Pattern method
• Basic idea: If a configuration has a prefix, and
any path starting from it always generates a
configuration having such prefix, it leads to no
solutions.
4 types of patterns:
Type 1: prefix pattern
αA =>αB
Type 2: postfix pattern
Aα = > Bα
Type 3: infix pattern
AαB => CαD
Type 4: prefix & postfix pattern αAβ=>αBβ
This method is very difficult to be automated!
Creating difficult instances
• Combination of a random instance
generator and a solver
• A strong PCP solver has more chance to
discover hard PCP instances.
• It can find optimal solutions very quickly
and reject instances with no solutions
earlier.
Creating difficult instances
• Use the number of visited nodes and cutoff
nodes as the threshold.
• Prohibit instances having one pair consisting of
all zeros or ones.
• Neighboring effects: replacing the infrequently
used pair in the solution may generate a harder
instance. 1010 101 1 110 1010 010 1 110
1 1111 1011 01
Optimal length=120
1 1111 1011 01
Optimal length=200
Experimental results
• All methods discussed above were
implemented except the pattern method.
• Can only give qualitative evaluations on the
improvements derived from the mask
method and the exclusion method.
• Bidirectional probing is crucial to some
instances.
• Even a simple heuristic function can
improve efficiency greatly.
Experimental results
• Go through all unexamined instances of size
3 and width 3. Now in this subclass only
one instance is still unsolved (1).
• Strengthen the conjecture that the hardest
instance in this subclass is (2) with optimal
length of 75.
(1)
(2)
10 0 001
0 001 1
100 0
1
1
100 0
Experimental results
• Create more than 100 hard instances of size 4
and width 4 with optimal lengths more than
100.
• Two instances set new PCP instance records:
101 1
1
01
010
1101
1010 11 0 01
100 1011 1 0
Optimal length=216
Optimal length=256
hardest in PCP[3,4]
hardest in PCP[4,4]
Difficulties & Differences
• Theoretically not all instances can be solved
by a program.
• Unbounded search space is different from
the normal single-agent search problems or
two-play games.
• Small branching factor. For an instance in
PCP[3], typically its branching factor is a
little more than 1.
Speculations
• The mask method, the exclusion method
and bidirectional probing are done earlier in
the solving scheme and cost little overhead.
• The more properties discovered, the easier
to solve!
What’s the use of PCP?
• Provide a new and different test bed for
search enhancements: iterative deepening,
cache scheme, heuristic pruning,
bidirectional search, etc.
• The data gathered through practical
approaches may result in the breakthrough
in theory, i.e., proving the decidablity of
PCP[3].
Future work
• One instance is still unresolved.
• The pattern method need automated
• Incorporate more enhancements, e.g.
complicated heuristic and bidirectional
search.
• Continue examining the subclasses
PCP[3,4], PCP[3,5] and so on.
Links
• PCP websites
http://www.cs.ualberta.ca/~zhao/PCP/intro.htm
http://www.informatik.uni-leipzig.de/~pcp/
• PCP Paper
Tackling Post’s correspondence problem