2.1. Nondeterministic Constraint Logic
Let
G be a 3-regular graph with edge weights among
. A vertex of
G is an
AND vertex if exactly one incident edge has weight 2, and a vertex of
G is an
OR vertex if all the incident edges have weight 2. A graph
G is a
constraint graph if it consists of only AND vertices and OR vertices. An orientation
F of
G is
legal if for every vertex
v of
G, the sum of weights of in-coming edges of
v is at least 2. A
legal move from a legal orientation is the reversal of a single edge that results in another legal orientation.
Figure 1 illustrates all the possible orientations of edges incident to an AND vertex. We can also verify that all the possible legal move of an incident edge of the AND vertex are those depicted by the arrows in
Figure 1. Given a constraint graph
G and two legal orientation
and
of
G, the
nondeterministic constraint logic problem asks whether there is a sequence of legal orientations
such that
is obtained from
by a legal move for each
i with
. Such a sequence of legal orientations is called a
reconfiguration sequence. The nondeterministic constraint logic problem is known to be PSPACE-complete even if the constraint graph is planar [
11]. See [
18] for more information on constraint logic.
For convenience of the reduction, we define a problem slightly different from the nondeterministic constraint logic problem. Let G be a bipartite graph with bipartition such that every vertex of A has degree 3 and every vertex of B has degree 2 or 3. The graph G has edge weights among such that for every vertex of A, exactly one incident edge has weight 2. An orientation F of G is legal if
for every vertex , the sum of weights of in-coming edges of v is at least 2, and
every vertex of B has one or two in-coming edges, but at most one vertex of B has two in-coming edges.
A
legal move from a legal orientation is the reversal of a single edge that results in another legal orientation. Notice that, in the legal moves, the vertices of
A behave in the same way as the AND vertices of the nondeterministic constraint logic problem, that is, as shown in
Figure 1. Given such a bipartite graph
G and two legal orientation
and
of
G, the problem
asks whether there is a sequence of legal orientations
such that
is obtained from
by a legal move for each
i with
. We further add a constraint to the instance of the problem
so that every vertex of
B has exactly one in-coming edge in
and
.
Lemma 1. The problem Π is PSPACE-complete.
Proof. We can observe that the problem
is in PSPACE ([
8], Theorem 1). We thus show a polynomial-time reduction from the nondeterministic constraint logic problem. Let
be an instance of the problem, that is,
G is a constraint graph, consisting of AND vertices and OR vertices, and
and
are two legal orientations of
G. We construct an instance
of the problem
such that
is a yes-instance if and only if
is a yes-instance.
Let
be the bipartite graph obtained from
G by replacing each edge
with two edges
and
so that
and
have the same weight as
, where
w is a newly added vertex. The bipartite graph
with bipartition
is obtained from
by replacing each OR vertex with a subgraph shown in
Figure 2, where
A consists of the AND vertices of
G and the white points in the subgraphs (see
Figure 2) while
B consists of the newly added vertices of
and the gray points in the subgraphs. We can check that all the vertices of
A are incident to one weight-2 edge and two weight-1 edges.
Let
F be a legal orientation of
G. We define a legal orientation
of
associated withF. Let
be the orientation of
obtained from
F by replacing each edge
with two edges
and
, where
w is the newly added vertex. Let
be an orientation of
obtained from
by replacing each OR vertex with the subgraph in
Figure 2 such that if
L is directed inward (resp. outward) in
then the edges
and
and the weight-1 edges between them are directed inward (resp. outward) in
(and similarly for the edges
R and
D). The legal orientation
is obtained from
by reversing the direction of the edges incident to the OR vertices so that exactly one edge of
is directed inward for each OR vertex. Notice that at least one edge of
can be directed inward, since at least one edge of
is directed inward in
F. We can see that
has no vertex of
B having two in-coming edges. The legal orientations
and
are the orientations associated with
and
, respectively. This completes the construction of the instance
of the problem
.
Assume that there is a reconfiguration sequence
from
to
. Let
be a legal orientation of
associated with
. If
is obtained from
by a legal move of an edge joining two AND vertices, we have a reconfiguration sequence from
to
. Suppose that
is obtained by a legal move of an edge incident to an OR vertex. Let
L,
R, and
D be the edges incident to the OR vertex. We assume without loss of generality that
is obtained by a legal move of the edge
L. When
L is directed inward in
, the edge
L is directed outward in
, and thus the edges
R or
D are directed inward in
. Hence, in
the edge
or
can be directed inward (see
Figure 2). Therefore, the edges
and
together with the weight-1 edges between them can be directed outward to obtain
. When
L is directed outward in
and inward in
, in
the edges
and
together with the weight-1 edges between them can be directed inward to obtain
. Since there is a reconfiguration sequence from
to
for any
i with
, the instance
is a yes-instance if
is a yes-instance. Notice that, in the subgraph shown in
Figure 2, if two edges of
are directed outward, then the remaining edge must be directed inward. Thus, a reconfiguration sequence from
to
can be obtained from a reconfiguration sequence from
to
. It follows that the instance
is a yes-instance if
is a yes-instance.
Since the graph and the legal orientations and can be obtained in polynomial time, we have the claim. □
We can further see from the proof of Lemma 1 that the problem
is PSPACE-complete for planar graphs, since the nondeterministic constraint logic problem is PSPACE-complete even if the constraint graph is planar [
11]. We can also see the following observation, which we will use in the proof of Lemma 2.
Proposition 1. Let be an instance of the problem Π with a reconfiguration sequence from to . If i is even, then has no vertex of B having two in-coming edges, while has one vertex of B having two in-coming edges if otherwise. If a vertex has two in-coming edges and in , then we can assume without loss of generality that is obtained from by reversing the direction of the edge , while is obtained from by reversing the direction of the edge .
Proof. Let be a legal orientation such that every vertex of B has exactly one in-coming edge. Suppose that is obtained from by reversing the direction of an edge , where and are the vertices of A and B, respectively. Since all the vertices of B has one in-coming edge in , we have and . Now, has two in-coming edges in . Let be the in-coming edge of in . If we reverse the direction of an edge other than or , then the orientation is no longer legal. Thus, we can reverse the direction of either or to obtain , in which every vertex of B has exactly one in-coming edge. However, if we reverse the direction of , then we have the same orientation as . Thus, we can assume without loss of generality that and . Now, we have the claim. □
2.2. Reduction
Let be an instance of the problem . In this section, we construct a reduction graph H together with two Hamiltonian cycles and such that there is a reconfiguration sequence from to if and only if there is a reconfiguration sequence from to . That is, is a yes-instance if and only if is a yes-instance of the Hamiltonian cycle reconfiguration problem.
We use three types of gadgets corresponding to the vertices in
A, the vertices in
B, and the edges of
G. A gadget for a vertex in
A and a gadget for an edge of
G is shown in
Figure 3a,b respectively. Double lines in the figures denote
edges with ears, where an
ear of an edge
is a path of length 3 joining
u and
w. Recall that, in the legal moves, the vertices in
A behave in the same way as the AND vertices. We thus refer to the gadgets for the vertices in
A as AND gadgets. Let
b be a vertex in
B of degree
k, and recall that
k is 2 or 3. A gadget for
b is a cycle
of length
such that the edge
has a ear for each
i with
(indices are modulo
k).
We construct the reduction graph H from G as follows: (1) Let a be a vertex in A, and let be the edges of G incident to a such that and have weight 1 and has weight 2. We identify the vertices and of the gadget for a with the vertices and of the gadget for , respectively. Similarly, we identify the vertices and of the gadget for a with the vertices and of the gadget for , respectively. Moreover, we identify the vertices and of the gadget for a with the vertices and of the gadget for , respectively. (2) Let b be a vertex in B of degree k, and let be the edges of G incident to b. We identify, for each i with , the vertices and of the gadget for b with the vertices and of the gadget for , respectively. (3) We finally concatenate the gadgets for the vertices in A cyclically using edges with ears joining the vertices and of the gadgets.
Before describing the construction of the Hamiltonian cycles
and
, we consider the possible configurations of a Hamiltonian cycle of the reduction graph
H passing through the gadgets. We will show that all the possible configurations in an AND gadget and an edge gadget are shown in
Figure 4a,b, respectively. We can also verify that all the possible transformations of Hamiltonian cycles by a single switch occurred in a gadget are those depicted by the arrows in the figures. Let
C be a Hamiltonian cycle. We first consider the configurations of
C in an AND gadget. The Hamiltonian cycle
C passes through all the edges on the ears, since interior vertices of an ear has degree 2. Thus,
C passes through any of the edges
,
,
, or
. We also have that
C does not pass through the edges
,
, or
, since when we construct the reduction graph
H the vertices
,
,
,
,
and
are identified with the vertices of the edge gadgets incident to the edges with ears. Suppose that
C passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
, and we have the configuration
in
Figure 4a. Suppose that
C passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
, and we have the configuration
in
Figure 4a. Suppose that
C passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through
, and we have the configuration
in
Figure 4a. Suppose that
C passes through
. Since
C cannot pass through
, it passes through
. Since
C cannot pass through
, it passes through either
or
. If
C passes through
, then it passes through
since it cannot pass through
, and we have the configuration
in
Figure 4a. If
C passes through
, then it passes through
since it cannot pass through
, and we have the configuration
in
Figure 4a. Therefore, all the possible configurations in an AND gadget are shown in
Figure 4a. We next consider the configurations of the Hamiltonian cycle
C in an edge gadget. Since
C passes through all the edges on the ears, it passes through either
or
. If
C passes through
then it passes through
, while if
C passes through
, then it passes through
. We also have that
C does not pass through the edges
or
, since when we construct the reduction graph
H the vertices
,
,
, and
are identified with the vertices of the AND gadgets incident to the edges with ears. Therefore, all the possible configurations in an edge gadget are shown in
Figure 4b.
Let
v be a vertex of
A. We next make a correspondence between the possible configurations of a Hamiltonian cycle in the gadget for
v and the possible orientations of the edges incident to
v such that the configuration
in
Figure 4a corresponds to the orientation
in
Figure 1 for each
. We also make a correspondence between switches occurred in the gadget for
v and legal moves of the edges incident to
v such that switching the configuration from
to
in the gadget for
v corresponds to the legal move from
to
of the edges of
v, where
.
We define a legal orientation
F of
G associated with a Hamiltonian cycle
C of
H so that for each vertex
, the edges incident to
v are oriented
according to the configuration of
C in the gadget for
v. That is, the edges of
v are oriented as
in
F if the configuration of
C in the gadget for
v looks like
(see
Figure 1 and
Figure 4a). Notice that a Hamiltonian cycle
C of
H has exactly one legal orientation of
G associated with
C, but a legal orientation
F may have some Hamiltonian cycles that are associated with
F, due to the two possible configurations in an edge gadget shown in
Figure 4b.
Now, we construct the Hamiltonian cycle
from
as follows, and
is constructed similarly from
. (1) For each vertex
, we take the configuration in the gadget for
v according to the orientations of the edges incident to
v. That is, we take the configuration
in
Figure 4a for the gadget for
v if the edges of
v are oriented as
in
Figure 1. (2) We choose the configuration in each edge gadget arbitrarily among those in
Figure 4b. (3) The remaining parts are uniquely determined, since any Hamiltonian cycle pass through all the edges on the ears.
Figure 5b illustrates the Hamiltonian cycle constructed in this way from the legal orientation in
Figure 5a. Recall that every vertex of
B has exactly one in-coming edge in
and
. This guarantees that
and
are Hamiltonian. This completes the construction of the instance
of the Hamiltonian cycle reconfiguration problem. We remark two facts, which we use in the proof of the following lemma. First, we can see that
and
are associated with
and
, respectively. Second, if every vertex of
B has exactly one in-coming edge in a legal orientation
F, then for any two Hamiltonian cycles that are associated with
, there is a reconfiguration sequence from one to the other, in which the switches occur only in edge gadgets.
Lemma 2. The instance of the problem Π is a yes-instance if and only if of the Hamiltonian cycle reconfiguration problem is a yes-instance.
Proof. We first prove the if direction. Assume that there is a reconfiguration sequence from to . Let be the legal orientation of G associated with (Recall that a Hamiltonian cycle C of H has exactly one legal orientation associated with C). Notice that if and only if is obtained from by a switch occurred in an edge gadget. When for some i with , we remove from the sequence to obtain the reconfiguration sequence from to .
We next prove the only-if direction. Assume that there is a reconfiguration sequence from to . Recall that, for any two Hamiltonian cycles that are associated with , there is a reconfiguration sequence from one to the other, since every vertex of B has exactly one in-coming edge in . Thus, it suffices to show that for each Hamiltonian cycle with , there is a Hamiltonian cycle together with a reconfiguration sequence from to , where and are Hamiltonian cycles associated with and , respectively. Suppose that is obtained from by reversing the direction of an edge , where and are the vertices of A and B, respectively.
We first consider the case when
and
. We have from Proposition 1 that
has no vertex of
B having two in-coming edges. Let
C be a graph obtained from
by switching the configuration in the gadget for
according to the legal move. If
C is a Hamiltonian cycle, the claim holds. However, there is some possibility that
C is disconnected. (In
Figure 5b, for example, when we replace the configuration in the gadget for
from
to
, we have two cycles, while, in
Figure 5a, this replacement corresponds to the reversal of the edge
that results in another legal orientation). In this case, we use two steps as follows: Let
be a graph obtained from
by switching the configuration in the edge gadget for
as shown in
Figure 4b. Let
be a graph obtained from
by switching the configuration in the gadget for
according to the legal move. We show that
and
are Hamiltonian cycles. Suppose that
C is obtained from
by switching edges
and
with edges
and
. Suppose also that
is obtained from
C by switching edges
and
with edges
and
. Since
C is disconnected while
is Hamiltonian, the vertices
,
,
, and
appear on
as
. Since
and the switch occurs in the edge gadget, we can assume without loss of generality that the vertices
,
,
, and
appear on
as
Thus,
and
are the following Hamiltonian cycles.
We can see that is also associated with since the switch occurs in an edge gadget. Hence, is associated with , and the claim holds.
We then consider the case when
and
. Let
C be a graph obtained from
by switching the configuration in the gadget for
according to the legal move. We show that
C is the Hamiltonian cycle. We have from Proposition 1 that there is the vertex
with
such that
while
. Let
be the Hamiltonian cycle associated with
from which
is obtained by a single switch. We can see that this switch occurs in the gadget for
. Suppose that
C is obtained from
by switching edges
and
with edges
and
. Suppose also that
is obtained from
by switching edges
and
with edges
and
. Since
is the only in-coming edge of
in
, the vertices
,
,
, and
appear on
as
. Since
, we can assume without loss of generality that the vertices
and
appear on
as
. Since
is also a Hamiltonian cycle, the vertices
and
appear on
as
Thus,
and
C are the following Hamiltonian cycles.
Since C is associated with , the claim holds. □
Obviously, the reduction graph H is bipartite. We can easily check that H has maximum degree 6 (The vertices and of each AND gadget have degree 6). Since the instance can be constructed from in polynomial time, we have the following.
Theorem 1. The Hamiltonian cycle reconfiguration problem is PSPACE-complete for bipartite graphs with maximum degree 6.
A bipartite graph is chordal bipartite if each cycle in the graph of length greater than 4 has a chord, that is, an edge joining two vertices that are not consecutive on the cycle. Let D be the vertices of the reduction graph H incident with two edges having ears. We construct a graph from H by adding edges for all vertices and all vertices v of H that is in the color class different from u and is not an interior vertex of any ear. It is obvious that is bipartite. Suppose that has a chordless cycle Z of length greater than 4. Clearly, Z has no interior vertices of any ear. We also have that Z has no vertices in D, for otherwise Z would have a chord. Thus, Z is a cycle in a single AND gadget or a single edge gadget, but these gadgets contains no chordless cycle of length greater than 4. Therefore, is a chordal bipartite graph.
Since every added edges in is incident to a vertex in D, any Hamiltonian cycle does not pass through the added edges. Thus, there is a reconfiguration sequence from to in H if and only if there is a reconfiguration sequence from to in . Now, we have the following.
Theorem 2. The Hamiltonian cycle reconfiguration problem is PSPACE-complete for chordal bipartite graphs.