In this section, we will prove Theorem 1. We present a polynomial-time transformation from an arbitrary instance f of the 3SAT problem to a string puzzle such that f is satisfiable if and only if the string puzzle is solvable.
3.1. 3SAT Problem
The definition of 3SAT is mostly from [
18]. Let
be a set of Boolean
variables. Boolean variables take on values 0 (false) and 1 (true). If
x is a variable in
U, then
x and
are
literals over
U. The value of
is 1 (true) if and only if
x is 0 (false). A
clause over
U is a set of literals over
U, such as
. It represents the disjunction of those literals and is
satisfied by a truth assignment if and only if at least one of its members is true under that assignment.
An instance of 3SAT is a collection of clauses over U such that for . The 3SAT problem asks whether there exists some truth assignment for U that simultaneously satisfies all the clauses in f. For example, , , and , , provide an instance of 3SAT. For this instance, the answer is “yes”, since there is a truth assignment satisfying all clauses.
3.2. A Board, Holes, and Corridors
In order to transform the instance of 3SAT, we will design holes on a board and construct strings entangled with the board through the holes.
There are two types of holes,
square holes and
corridors. In
Figure 1(a), a looped string goes through square holes A and B. Each square hole has length
t in height, width, and depth. The thickness of the board is also
t (see
Figure 1(b)). Let
d be the distance between the centers of square holes A and B. In this paper, we assume that the value of
t is regarded to be negligibly small as compared with
d. Under this assumption, we say that the length of the looped string is at least
, and the string is
tight if its length is exactly
. In the following, square holes are simply called
holes.
Consider the board of
Figure 1(c). This is a board with hole C and corridor connecting D to G through E and F. The distances from C to D and from C to G are both
d, and the distance from C to E is
. Suppose the looped string goes through C and D, and the length of the string is
. The coil-like portion labeled with
in
Figure 1(c) represents string
slack.
We can move the string from D to E (see
Figure 1(d)). When the string reaches E, the amount of the slack is zero, and the string is tight. Furthermore, we can move the string from E to G (see
Figure 1(e)). At position G, the amount of the slack is
. A slack whose amount is
is simply called a “slack
”. (
Figure 1 is used only for explanations of holes, corridors, strings, slacks, and so on.)
3.3. A Gadget for
We first construct a gadget simulating variable
on a board. In
Figure 2(a), there are four corridors and 14 holes in the gadget. Corridors and holes of the gadget are left-right symmetric. On the left half of the gadget, there are two corridors which are composed of C-shaped corridors followed by vertical corridors. Each C-shaped corridor is composed of many short straight corridors so that any point in the C-shaped corridors is almost equidistant
d from the top end of the vertical corridors.
In
Figure 2(a), there are two blue strings and a red string. Each blue string goes through holes and corridors six times, and the red string goes through holes and corridors 12 times. The red string twines around each blue string (see green quadrilateral areas A and D). We assume that the six areas A through F are negligibly small compared with the value of
d. (In the figure, distance
d is not so long due to space limitation. However, one can see that constructing the gadget of
Figure 2(a) for a sufficiently large
d is not difficult.)
Since the quadrilateral areas are negligibly small, the part of a string in a quadrilateral area also has negligibly small length. Hence, we can regard the length of the left blue string as . The right blue string also has length , since it has slack and it connects D and F. The red string is entangled with the left blue string in area A and with the right blue string in area D. The left blue string has no slack, and the right blue string has slack . This situation represents and .
In
Figure 2(a), 14 holes are rectangular prisms, and four corridors are polyhedrons of 17 or 18 faces. Each such polyhedron can be represented by a set of its faces, where each face is represented by a sequence of the coordinates of the vertices. Thus, holes and corridors of
Figure 2(a) can be encoded into sequences. The left blue string of
Figure 2(a) is composed of 17 line segments. (Note that six of the 17 segments are vertical segments between the surface and the reverse surface of the board.) The left blue string can be represented by a sequence of the coordinates of 17 segment extremes. In this way, blue and red strings of
Figure 2(a) can also be encoded into sequences.
A gadget of
Figure 2(a) is embedded in an area of size constant, and
n such gadgets for variables
can be embedded in an area of size polynomial in
n. Arbitrary points in the polynomial-size area can be represented by bit-sequences of length
if they have integral coordinates. Therefore, all
n gadgets can be encoded into a sequence of length polynomial. Hence, the transformation from the set of
n variables to the sequence representing
n gadgets can be computed in polynomial time.
In the following, the gadget in
Figure 2(a) is simply illustrated as
Figure 2(b). In this figure, the jagged-shape portion labeled with
is the slack, and the height of the right blue looped string is increased by
d when the slack
is smoothed out.
The red string has slack
in
Figure 2(a). If the entanglement in D is moved to F (see the down-pointing arrow in
Figure 3), then the amount of the slack of the red string changes from
to 0 (and the red string becomes tight). At the same time, the amount of the slack of the right blue string also changes from
to 0. Furthermore, if the entanglement is moved from F to B, the amount of the slack of the red string changes from 0 to
(see the top two slacks in
Figure 3). During the movement from F to B, the slack of the right blue string is almost zero, since any point in the corridor from F to B is almost equidistant
d from D.
Now we can move the entanglement in area A to C via E (see
Figure 4(a)). After this movement, the left blue string has slack
, and the right blue string has no slack. This situation represents
and
.
It should be noted that, when the amount of the slack of the red string is
(see
Figure 2(a)), the entanglement in A cannot go to C. This is because the distance between A and E is
(which requires slack
). Therefore, if the value of
is 1 (
i.e., the right blue string has slack
), then the value of
is 0 (the left blue string has no slack). The right blue string can have slack
only if the left blue string has no slack.
3.4. Disjunction Gadgets
Figure 5(a) is the left and right turns of a string. Suppose that a literal
is true; namely, the gadget
has slack
. We can translate the slack
to any place by using the gadget of
Figure 5(a). When the slack
of the blue string is smoothed out (see
Figure 5(b)), the end of another string is moved down.
Figure 5(c) is the simplified illustration of
Figure 5(a). One of the purposes of the gadget is to use the slack from one string to extend the end of another string.
Figure 6(a) is a disjunction gadget. The red string has slack
. This slack plays a key role in this gadget. For example, suppose there is a clause
. This clause is satisfied if at least one of the three literals is true. In the figure, each of blue strings
and
has slack
, and blue string
has no slack. This is the case when the truth assignment is
. In this case, if two slacks
of blue strings
and
are smoothed out (see
Figure 6(b)), then the corresponding two black strings obtain slacks of which the amount is
in total. However, the amount of the slack of the red string was only
. Thus, the amount of slack which the green string obtains is
.
Therefore, if at least one of the three blue strings has slack
, then the green string obtains slack
. It should be noted that the amount of slack the green string obtains is at most
. In
Figure 6(a), we can suppose that the value of
q is negligibly small, since the diameter of any string and the size of the holes of
Figure 5(a) are assumed to be negligibly small.
We construct a gadget of
Figure 6(a) for every clause
. If a literal
appears in
k clauses, then the blue string
is connected to
k black strings.
The number of clauses is bounded by a polynomial in n. By an observation similar to variable gadgets, one can see that the transformation from the set of m clauses to the sequence representing m disjunction gadgets can be computed in polynomial time.
3.5. Conjunction Gadgets
The lower ends of the
m green strings
(see
Figure 6) are grouped together (see the top of
Figure 7(a)) by using left and right turn gadgets of
Figure 5. Finally, we need one new red string and one new black string (see
Figure 7(a)). The red string is connected to all the
m green strings
. The black string is the target string, which straddles the red string (see
Figure 7(b)). Both ends of the target string are hooked on the U-shaped corridors. All the
m green strings have slacks
if and only if the target string can be disentangled from the board.
In
Figure 7(a), the value of
r is negligibly small from the same reason as the value
q in
Figure 6(a). In
Figure 7(b), the height of each U-shaped corridor is
, and the width is negligibly small as compared with the height. The construction of the conjunction gadget can be done in polynomial time from the reason similar to disjunction gadgets.
Strictly speaking, the left blue string of
Figure 2 is not tight, since it is entangled with the red string in area A. So, the lower end of the left blue string can move down slightly when it has no coil-like slack. Such a slight movement is transmitted to the target string of
Figure 7 via disjunction gadgets of
Figure 6. However, if we assume that the value
of
Figure 7(b) is sufficiently large compared to the amount of the slight movement, then the target string cannot be disentangled from the board when at least one of the clauses is not satisfied.
From this construction, (1) all the clauses of the 3SAT instance are satisfied if and only if the target string is disentangled from the board, and (2) the transformation of the 3SAT instance to the string puzzle can be done in polynomial time. This completes the proof of Theorem 1.