Abstract
The Hamiltonian cycle reconfiguration problem asks, given two Hamiltonian cycles and of a graph G, whether there is a sequence of Hamiltonian cycles such that can be obtained from by a switch for each i with , where a switch is the replacement of a pair of edges and on a Hamiltonian cycle with the edges and of G, given that and did not appear on the cycle. We show that the Hamiltonian cycle reconfiguration problem is PSPACE-complete, settling an open question posed by Ito et al. (2011) and van den Heuvel (2013). More precisely, we show that the Hamiltonian cycle reconfiguration problem is PSPACE-complete for chordal bipartite graphs, strongly chordal split graphs, and bipartite graphs with maximum degree 6. Bipartite permutation graphs form a proper subclass of chordal bipartite graphs, and unit interval graphs form a proper subclass of strongly chordal graphs. On the positive side, we show that, for any two Hamiltonian cycles of a bipartite permutation graph and a unit interval graph, there is a sequence of switches transforming one cycle to the other, and such a sequence can be obtained in linear time.
1. Introduction
A reconfiguration problem asks, given two feasible solutions of a combinatorial problem together with some transformation rules between the solutions, whether there is a step-by-step transformation from one solution to the other such that all intermediate states are also feasible. The reconfiguration problems have attracted much attention recently because of their applications as well as theoretical interest. See, for example, a survey [1] and references of [2,3].
In this paper, we study a reconfiguration problem for Hamiltonian cycles. A Hamiltonian cycle of a graph is a cycle that contains all the vertices of the graph. Given two Hamiltonian cycles and of a graph G, the Hamiltonian cycle reconfiguration problem asks whether there is a sequence of Hamiltonian cycles such that and differ in two edges for each i with . Such a sequence of Hamiltonian cycles is called a reconfiguration sequence. The Hamiltonian cycle reconfiguration problem also can be defined in terms of the transformation rule, which is called switch (Switches are also used for sampling and counting perfect matchings [4,5] and transforming graphs with the same degree sequence ([6,7], p.46)). Let C be a Hamiltonian cycle of a graph G. A switch is the replacement of a pair of edges and on C with the edges and of G, given that and did not appear on C. The Hamiltonian cycle reconfiguration problem asks whether there is a sequence of switches transforming one cycle to the other such that all intermediate cycles are also Hamiltonian.
The complexity of the reconfiguration problem for Hamiltonian cycles has been implicitly posed as an open question by Ito et al. [8] (Precisely, they asked the complexity of the reconfiguration of the travelling salesman problem, which is a generalization of the Hamiltonian cycle problem) and revisited by van den Heuvel [1]. The Hamiltonian cycle problem, which asks whether a given graph has a Hamiltonian cycle, is one of the well-known NP-complete problems [9], but the complexity of its reconfiguration version still seems to be open.
1.1. Our Contribution
In this paper, we show that the Hamiltonian cycle reconfiguration problem is PSPACE-complete, even for chordal bipartite graphs, strongly chordal split graphs, and bipartite graphs with maximum degree 6. Our reduction for PSPACE-hardness follows from the reduction by Müller [10] for proving the NP-hardness of the Hamiltonian cycle problem for chordal bipartite graphs. However, while Müller shows a polynomial-time reduction from the satisfiability problem, we show a reduction from the nondeterministic constraint logic problem [11], which is used to show the PSPACE-hardness of some reconfiguration problems [11,12].
Unit interval graphs form a proper subclass of strongly chordal graphs, and bipartite permutation graphs form a proper subclass of chordal bipartite graphs (See [13] for example). A Hamiltonian cycle of a unit interval graph and a bipartite permutation graph can be obtained in linear time [14,15,16,17]. On the positive side, we show that, for any two Hamiltonian cycles of a unit interval graph and a bipartite permutation graph, there is a sequence of switches transforming one cycle to the other. Moreover, we show that such a sequence can be obtained in linear time. In order to show these results, we introduce the canonical Hamiltonian cycle (canonical cycle for short) of a unit interval graph and a bipartite permutation graph, using vertex ordering characterizations of these graphs [14,17]. We then show that each Hamiltonian cycle of a unit interval graph (resp. a bipartite permutation graph) can be transformed into the canonical cycle with at most switches (resp. at most switches), where n is the number of vertices of the graph. It follows that, for any two Hamiltonian cycles of a unit interval graph (resp. a bipartite permutation graph), there is a sequence of at most switches (resp. at most switches) from one cycle to the other.
1.2. Notation
In this paper, we will deal only with finite graphs having no loops and multiple edges. Unless stated otherwise, graphs are assumed to be undirected, but we also deal with directed graphs. We write for the undirected edge joining a vertex u and a vertex v, and we write for the directed edge from u to v. For a graph , we sometimes write for the vertex set V of G and write for the edge set E of G.
An independent set of a graph is a subset such that for any two vertices . A graph G is a bipartite graph if its vertex set V can be partitioned into two independent set U and W. The independent sets U and W are called color classes of G, and the pair is called bipartition of G. We sometimes use the notation for the bipartite graph with bipartition .
An orientation of an undirected graph is a graph obtained from G by orienting each edge in E, that is, replacing each edge with either or . An oriented graph is an orientation of some graph. Notice that an oriented graph contains no pair of edges and for some vertices . We will denote an orientation of a graph only by its edge set, since the vertex set is clear from the context.
2. PSPACE-Completeness
We can observe that the Hamiltonian cycle reconfiguration problem is in PSPACE ([8], Theorem 1). In this section, we show the reduction from the nondeterministic constraint logic problem, which is known to be PSPACE-complete [11], to the Hamiltonian cycle reconfiguration problem.
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.
Figure 1.
All the possible orientations of edges incident to an AND vertex, where (blue) thick arrows denote the edges with weight 2, and (red) thin arrows denote the edges with weight 1. Each dotted circle represents a possible orientation of the edges, and two circles are joined by an arrow if one is obtained from the other by reversing the direction of a single edge.
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.
Figure 2.
The reduction from the nondeterministic constraint logic problem to the problem . White points denote the vertices of A, and gray points denote the vertices of B. Thick (blue) lines denote the edges with weight 2, and thin (red) lines denote the edges with weight 1.
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).
Figure 3.
Gadgets. Double lines denote edges with ears. (a) an AND gadget; (b) an edge gadget.
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.
Figure 4.
All the possible configurations of a Hamiltonian cycle passing through gadgets. The edges on the cycle are indicated by thick lines, but the ears are omitted; the edges out of the cycle are indicated by dotted lines. Each dotted square represents a possible configuration, and two squares are joined by an arrow if one is obtained from the other by a single switch.
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.
Figure 5.
(a) a legal orientation of the problem . White points denote the vertices of A, and gray points denote the vertices of B. Thick (blue) lines denote the edges with weight 2, and thin (red) lines denote the edges with weight 1; (b) the Hamiltonian cycle obtained from the legal orientation in Figure 5a. We take the configuration for the gadget for , since the edges of are oriented as in Figure 5a. Notice that, when we replace the configuration from to , we have two cycles.
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.
2.3. Strongly Chordal Split Graphs
A graph is chordal if each cycle in the graph of length greater than 3 has a chord. A clique of is a subset such that for any two vertices . A graph is a split graph if its vertex set can be partitioned into a clique and an independent set. A chordal graph is strongly chordal [19] if each cycle of even length at least 6 has an odd chord, that is, an edge joining two vertices having odd distance on the cycle. Strongly chordal graphs are closely related to chordal bipartite graphs. Let be a bipartite graph. We define a split graph , where . It is known that a bipartite graph G is a chordal bipartite graph if and only if is strongly chordal. See ([20,21], Lemma 12.4).
Let be a bipartite graph with . Obviously, any Hamiltonian cycle of does not pass through the edges in . Thus, there is a reconfiguration sequence from a Hamiltonian cycle of G to another Hamiltonian cycle of G if and only if there is a reconfiguration sequence from to in . Now, we have the following from Theorem 2.
Theorem 3.
The Hamiltonian cycle reconfiguration problem is PSPACE-complete for strongly chordal split graphs.
3. Canonical Hamiltonian Cycles
Unit interval graphs form a proper subclass of strongly chordal graphs, and bipartite permutation graphs form a proper subclass of chordal bipartite graphs (See [13], for example). In this section, we introduce the canonical Hamiltonian cycle (canonical cycle for short) of a unit interval graph and the canonical cycle of a bipartite permutation graph. We then show that each Hamiltonian cycle of a unit interval graph and a bipartite permutation graph can be transformed into the canonical cycle by a sequence of switches.
3.1. Unit Interval Graphs
A graph is an interval graph if each vertex can be assigned an interval on the real line so that two vertices are adjacent if and only if their assigned intervals intersect. An interval graph is a unit interval graph if each vertex can be assigned an interval of unit length. There are some linear-time algorithms to find a Hamiltonian cycle of a unit interval graph [14,15,16]. We follow the algorithm of Chen et al. [14], which uses the following vertex ordering characterization.
Theorem 4
([14,22]). A consecutive ordering of a graph G is a sequence of vertices of G such that for any three vertices with , if then . A graph is a unit interval graph if and only if it has a consecutive ordering. Moreover, a consecutive ordering of a unit interval graph can be obtained in linear time.
Notice that, in the consecutive ordering of a graph G, the vertices in are consecutive for every vertex , where .
It is known that a unit interval graph has a Hamiltonian cycle if and only if it is biconnected [14,15,16]. Biconnected unit interval graphs are characterized as follows.
Theorem 5
([14]). A unit interval graph G with a consecutive ordering is biconnected if and only if for every i and j with .
We can observe that such a unit interval graph G has a Hamiltonian cycle consisting of the edges , , and for every i with [14]; we define it as the canonical Hamiltonian cycle (canonical cycle for short) of G.
Theorem 6.
Let G be a unit interval graph. For each Hamiltonian cycle of G, there is a sequence of at most switches transforming it to the canonical cycle of G.
The following is a useful fact about consecutive orderings.
Lemma 3.
Let be four vertices of G with and . If , then .
Proof.
We have that implies by the definition of consecutive orderings. If , then and implies . If , then implies . □
Proof of Theorem 6.
We assume , since the claim trivially holds when . Let G have a consecutive ordering , and let be the canonical cycle of G. Let be a Hamiltonian cycle of G. It suffices to show a sequence of Hamiltonian cycles that satisfy the following conditions for each i with :
- contains the edges on induced by ,
- is obtained from by at most one switch.
Notice that is the canonical cycle by the following reason: since is Hamiltonian, ; we thus have .
We first construct from . When , we define as . We then consider the case when . Let be the vertices of G such that
Note that there is some possibility that or . It is clear that . Since , we have by Lemma 3. We define that is the Hamiltonian cycle obtained from by switching the edges and with the edges and , that is,
We now construct from with . Recall that contains the edges on induced by . When , we define as . We then consider the case when . Let be the vertices of G such that
Note that there is some possibility that or . We have by the definition of . Since is Hamiltonian, , and thus . We also have from . Moreover, we have by the definition of and . Since , we have by Lemma 3. We define that is the Hamiltonian cycle obtained from by switching the edges and with the edges and , that is,
Therefore, we have the sequence of at most switches transforming into the canonical cycle . □
We also have the following from Theorem 6.
Corollary 1.
For each Hamiltonian cycle of a unit interval graph G, we can compute a sequence of switches transforming to the canonical cycle of G in time, provided that a consecutive ordering of G is given.
Proof.
The algorithm follows the steps of the proof of Theorem 6. We analyze the implementation details and the running time. We store in a circular doubly linked list L as a sequence of vertices; we store the consecutive ordering in an array A, in which the element of position i has a pointer to the vertex in L for each i with . In order to compute the Hamiltonian cycle from , it suffices to take the vertices in L, where and is the successor or the predecessor of and , respectively. Similarly in order to compute from with , it suffices to take the vertices in L, where and is the successor or the predecessor of and , respectively. Since one iteration takes a constant time, we have the claim. □
Now, we have the following from Theorem 6 and Corollary 1.
Corollary 2.
For any two Hamiltonian cycles of a unit interval graph, there is a sequence of at most switches transforming one cycle to the other. Moreover, we can compute such a sequence in time, provided that a consecutive ordering of G is given.
3.2. Bipartite Permutation Graphs
A graph G with the vertex set is a permutation graph if there is a permutation on such that if and only if for every . A permutation graph is a bipartite permutation graph [17] if it is bipartite. A Hamiltonian cycle of a bipartite permutation graph can be obtained in linear time [17]. We follow this algorithm, which uses the following vertex ordering characterization.
Theorem 7
([17]). A strong ordering of a bipartite graph is a pair of total orderings of U and of W such that for every with and , if and then and . A bipartite graph is a bipartite permutation graph if and only if it has a strong ordering. Moreover, a strong ordering of a bipartite permutation graph can be obtained in linear time.
A bipartite graph is balanced if . Notice that, if a bipartite permutation graph G has a Hamiltonian cycle, then G is biconnected and balanced with , but the converse does not hold. See Figure 6 for example. Bipartite permutation graphs having a Hamiltonian cycle are characterized as follows.
Figure 6.
A biconnected bipartite permutation graph having no Hamiltonian cycles.
Theorem 8
([17]). Let be a bipartite permutation graph with , and let G have a strong ordering of U and of W. The graph G has a Hamiltonian cycle if and only if the vertices form a cycle of length 4 for every i with .
We can observe that such a bipartite permutation graph G has a Hamiltonian cycle consisting of the edges , , , and for every i with [17]; we define it as the canonical Hamiltonian cycle (canonical cycle for short) of G.
Theorem 9.
Let be a bipartite permutation graph with . For each Hamiltonian cycle of G, there is a sequence of at most switches transforming it to the canonical cycle of G.
Proof.
We assume , since the claim trivially holds when . Let G have a strong ordering of U and of W, and let be the canonical cycle of G. Let be a Hamiltonian cycle of G. It suffices to show a sequence of Hamiltonian cycles that satisfy the following conditions for each i with :
- contains the edges on induced by , where , , , , …, , ;
- is obtained from by at most one switch.
Notice that is the canonical cycle by the following reason: since is Hamiltonian, ; we thus have .
We first construct from . When , we define as . We then consider the case when . Let be the vertices of G such that
It is clear that . Since , we have by the definition of strong orderings. We define that is the Hamiltonian cycle obtained from by switching the edges and with the edges and , that is,
We next construct from with . Recall that contains the edges on induced by . When , we define as . We then consider the case when . Let be the vertices of G such that
We have by the definition of . Since is Hamiltonian, , and thus . We also have from . We have by the definition of . Since , we have , and thus . Since , we have by the definition of strong orderings. We define that is the Hamiltonian cycle obtained from by switching the edges and with the edges and , that is,
We finally construct from with . Recall that contains the edges on induced by , When , we define as . We then consider the case when . Let be the vertices of G such that
We have by the definition of . Since , we have . We also have by the definition of . Since , we have , and thus . Since , we have by the definition of strong orderings. We define that is the Hamiltonian cycle obtained from by switching the edges and with the edges and , that is,
Therefore, we have the sequence of at most switches transforming into the canonical cycle . □
We also have the following from Theorem 9.
Corollary 3.
For each Hamiltonian cycle of a bipartite permutation graph G, we can compute a sequence of switches transforming it to the canonical cycle of G in time, provided that a strong ordering of G is given.
Proof.
The proof is similar to that of Corollary 1, and is omitted. □
Now, we have the following from Theorem 9 and Corollary 3.
Corollary 4.
For any two Hamiltonian cycles of a bipartite permutation graph, there is a sequence of at most switches transforming one cycle to the other. Moreover, we can compute such a sequence in time, provided that a strong ordering of G is given.
Funding
This research received no external funding.
Acknowledgments
We are grateful to the reviewers for careful reading and helpful comments.
Conflicts of Interest
The author declares no conflict of interest.
References
- Van den Heuvel, J. The complexity of change. In Surveys in Combinatorics 2013; Blackburn, S.R., Gerke, S., Wildon, M., Eds.; London Mathematical Society Lecture Note Series; Cambridge University Press: Cambridge, UK, 2013; Volume 409, pp. 127–160. [Google Scholar]
- Haddadan, A.; Ito, T.; Mouawad, A.E.; Nishimura, N.; Ono, H.; Suzuki, A.; Tebbal, Y. The complexity of dominating set reconfiguration. Theor. Comput. Sci. 2016, 651, 37–49. [Google Scholar] [CrossRef]
- Lokshtanov, D.; Mouawad, A.E. The complexity of independent set reconfiguration on bipartite graphs. In Proceedings of the Twenty-Ninth Annual ACM-SIAM Symposium on Discrete Algorithms (SODA 2018), New Orleans, LA, USA, 7–10 January 2018; pp. 185–195. [Google Scholar]
- Diaconis, P.; Graham, R.; Holmes, S.P. Statistical problems involving permutations with restricted positions. In State of the Art in Probability and Statistics; de Gunst, M., Klaasen, C., van der Vaart, A., Eds.; Lecture Notes–Monograph Series; Institute of Mathematical Statistics: Bethesda, MD, USA, 2001; Volume 36, pp. 195–222. [Google Scholar]
- Dyer, M.E.; Jerrum, M.; Müller, H. On the Switch Markov Chain for Perfect Matchings. J. ACM 2017, 64, 12:1–12:33. [Google Scholar] [CrossRef]
- Bereg, S.; Ito, H. Transforming Graphs with the Same Graphic Sequence. J. Inf. Process. 2017, 25, 627–633. [Google Scholar] [CrossRef]
- West, D.B. Introduction to Graph Theory, 2nd ed.; Prentice Hall: Upper Saddle River, NJ, USA, 2000. [Google Scholar]
- Ito, T.; Demaine, E.D.; Harvey, N.J.A.; Papadimitriou, C.H.; Sideri, M.; Uehara, R.; Uno, Y. On the complexity of reconfiguration problems. Theor. Comput. Sci. 2011, 412, 1054–1065. [Google Scholar] [CrossRef]
- Garey, M.R.; Johnson, D.S. Computers and Intractability: A Guide to the Theory of NP-Completeness; W. H. Freeman & Co.: New York, NY, USA, 1979. [Google Scholar]
- Müller, H. Hamiltonian circuits in chordal bipartite graphs. Discr. Math. 1996, 156, 291–298. [Google Scholar] [CrossRef]
- Hearn, R.A.; Demaine, E.D. PSPACE-completeness of sliding-block puzzles and other problems through the nondeterministic constraint logic model of computation. Theor. Comput. Sci. 2005, 343, 72–96. [Google Scholar] [CrossRef]
- Osawa, H.; Suzuki, A.; Ito, T.; Zhou, X. The Complexity of (List) Edge-Coloring Reconfiguration Problem. IEICE Trans. 2018, 101-A, 232–238. [Google Scholar] [CrossRef]
- Brandstädt, A.; Le, V.B.; Spinrad, J.P. Graph Classes: A Survey; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 1999. [Google Scholar]
- Chen, C.; Chang, C.; Chang, G.J. Proper interval graphs and the guard problem. Discr. Math. 1997, 170, 223–230. [Google Scholar] [CrossRef]
- Ibarra, L. A simple algorithm to find Hamiltonian cycles in proper interval graphs. Inf. Process. Lett. 2009, 109, 1105–1108. [Google Scholar] [CrossRef]
- Panda, B.S.; Das, S.K. A linear time recognition algorithm for proper interval graphs. Inf. Process. Lett. 2003, 87, 153–161. [Google Scholar] [CrossRef]
- Spinrad, J.P.; Brandstädt, A.; Stewart, L. Bipartite permutation graphs. Discrete Appl. Math. 1987, 18, 279–292. [Google Scholar] [CrossRef]
- Hearn, R.A.; Demaine, E.D. Games, Puzzles and Computation; A. K. Peters Ltd.: Natick, MA, USA, 2009. [Google Scholar]
- Farber, M. Characterizations of strongly chordal graphs. Discr. Math. 1983, 43, 173–189. [Google Scholar] [CrossRef]
- Dahlhaus, E. Chordale Graphen im besonderen Hinblick auf parallele Algorithmen. Habilitation Thesis, University of Bonn, Bonn, Germany, 1991. (In German). [Google Scholar]
- Spinrad, J.P. Efficient Graph Representations: Fields Institute Monographs; American Mathematical Society: Providence, RI, USA, 2003; Volume 19. [Google Scholar]
- Looges, P.J.; Olariu, S. Optimal greedy algorithms for indifference graphs. Comput. Math. Appl. 1993, 25, 15–25. [Google Scholar] [CrossRef]
© 2018 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).