Shortest Reconfiguration of Perfect Matchings via Alternating Cycles
Takehiro Ito, Naonori Kakimura, Naoyuki Kamiyama, Yusuke Kobayashi,, Yoshio Okamoto

TL;DR
This paper investigates the shortest reconfiguration sequences between perfect matchings via alternating cycles, revealing computational complexity results and polynomial-time solutions for specific graph classes.
Contribution
It establishes NP-hardness for the problem in general and planar or bipartite graphs, and provides a polynomial-time algorithm for outerplanar graphs.
Findings
NP-hardness in planar and bipartite graphs
Polynomial-time algorithm for outerplanar graphs
Connection to perfect matching polytopes
Abstract
Motivated by adjacency in perfect matching polytopes, we study the shortest reconfiguration problem of perfect matchings via alternating cycles. Namely, we want to find a shortest sequence of perfect matchings which transforms one given perfect matching to another given perfect matching such that the symmetric difference of each pair of consecutive perfect matchings is a single cycle. The problem is equivalent to the combinatorial shortest path problem in perfect matching polytopes. We prove that the problem is NP-hard even when a given graph is planar or bipartite, but it can be solved in polynomial time when the graph is outerplanar.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Graph Theory Research · Complexity and Algorithms in Graphs · Optimization and Search Problems
Shortest Reconfiguration of Perfect Matchings
via Alternating Cycles
Takehiro Ito
Tohoku University, Japan
[email protected] Partially supported by JST CREST Grant Number JPMJCR1402, and JSPS KAKENHI Grant Numbers JP18H04091 and JP19K11814, Japan.
Naonori Kakimura
Keio University, Japan
[email protected] Supported by JSPS KAKENHI Grant Numbers JP17K00028 and JP18H05291.
Naoyuki Kamiyama
Kyushu University, and JST, PRESTO, Japan
[email protected] Partially supported by JST PRESTO Grant Number JPMJPR1753, Japan.
Yusuke Kobayashi
Kyoto University, Japan
[email protected] Partly supported by JSPS KAKENHI Grant Numbers JP16K16010, JP17K19960, and JP18H05291, Japan.
Yoshio Okamoto
University of Electro-Communications, and
RIKEN Center for Advanced Intelligence Project, Japan
[email protected] Partially supported by JSPS KAKENHI Grant Number 15K00009 and JST CREST Grant Number JPMJCR1402, and Kayamori Foundation of Informational Science Advancement.
Abstract
Motivated by adjacency in perfect matching polytopes, we study the shortest reconfiguration problem of perfect matchings via alternating cycles. Namely, we want to find a shortest sequence of perfect matchings which transforms one given perfect matching to another given perfect matching such that the symmetric difference of each pair of consecutive perfect matchings is a single cycle. The problem is equivalent to the combinatorial shortest path problem in perfect matching polytopes. We prove that the problem is -hard even when a given graph is planar or bipartite, but it can be solved in polynomial time when the graph is outerplanar.
1 Introduction
Combinatorial reconfiguration is a fundamental research subject that sheds light on solution spaces of combinatorial (search) problems, and connects various concepts such as optimization, counting, enumeration, and sampling. In its general form, combinatorial reconfiguration is concerned with properties of the configuration space of a combinatorial problem. The configuration space of a combinatorial problem is often represented as a graph, but its size is usually exponential in the instance size. Thus, algorithmic problems on combinatorial reconfiguration are not trivial, and require novel tools for resolution. For recent surveys, see [27, 15].
Two basic questions have been encountered in the study of combinatorial reconfiguration. The first question asks the existence of a path between two given solutions in the configuration space, namely the reachability of the two solutions. The second question asks the shortest length of a path between two given solutions, if it exists. The second question is usually referred to as a shortest reconfiguration problem.
In this paper, we focus on reconfiguration problems of matchings, namely sets of independent edges. There are several ways of defining the configuration space for matchings, and some of them have already been studied in the literature [16, 19, 14, 6, 4]. We will explain them in Section 1.1.
We study yet another configuration space for matchings, which we call the alternating path/cycle model. The model is motivated by adjacency in matching polytopes, which we will see soon. In the model, we are given an undirected and unweighted graph , and also an integer . The vertex set of the configuration space consists of the matchings in of size at least . Two matchings and in are adjacent in the configuration space if and only if their symmetric difference is a single path or cycle. In particular, we are interested in the case where , namely the reconfiguration of perfect matchings. In that case, the model is simplified to the alternating cycle model since cannot have a path. See Figure 1 as an example.
The reachability of two perfect matchings is trivial under the alternating cycle model: the answer is always yes. This is because the symmetric difference of two perfect matchings always consists of vertex-disjoint cycles. Therefore, we focus on the shortest perfect matching reconfiguration under the alternating cycle model.
1.1 Related Work
Other Configuration Spaces for Matchings
As mentioned, reconfiguration problems of matchings have already been studied under different models [16, 19, 14, 6, 4]. These models chose more elementary changes as the adjacency on the configuration space. Then, the situation changes drastically under such models: even the reachability of two matchings is not guaranteed.
Matching reconfiguration was initiated by the work of Ito et al. [16]. They proposed the token addition/removal model of reconfiguration, in which we are also given an integer , and the vertex set of the configuration space consists of the matchings of size at least .111Precisely, their model is defined in a slightly different way, but it is essentially the same as this definition. Two matchings and are adjacent if and only if they differ in only one edge. Ito et al. [16] proved that the reachability of two given matchings can be checked in polynomial time.
Another model of reconfiguration is token jumping, introduced by Kamiński et al. [19]. In the token jumping model, we are also given an integer , and the vertex set of the configuration space consists of the matchings of size exactly . Two matchings and are adjacent if and only if they differ in only two edges. Kamiński et al. [19, Theorem 1] proved that the token jumping model is equivalent to the token addition/removal model when . Thus, using the result by Ito et al. [16], the reachability can be checked in polynomial time also under the token jumping model [19, Corollary 2].
On the other hand, the shortest matching reconfiguration is known to be hard. Gupta et al. [14] and Bousquet et al. [6] independently proved that the problem is -hard under the token jumping model. Then, the problem is also -hard under the token addition/removal model, because the shortest lengths are preserved under the two models [19, Theorem 1].
Recently, Bonamy et al. [4] studied the reachability of two perfect matchings under a model close to ours, namely the alternating cycle model restricted to length four. In the model, two perfect matchings and are adjacent if and only if their symmetric difference is a cycle of length four. Then, the answer to the reachability is not always yes, and Bonamy et al. [4] proved that the reachability problem is -complete under this restricted model.
Relation to Matching Polytopes
Our alternating cycle model (without any restriction of cycle length) for the perfect matching reconfiguration is natural when we see the connection with the simplex methods for linear optimization, or combinatorial shortest paths of the graphs of convex polytopes.
In the combinatorial shortest path problem of a convex polytope, we are given a convex polytope , explicitly or implicitly, and two vertices of . Then, we want to find a shortest sequence of vertices of such that and forms an edge of for every . Often, we are only interested in the length of such a shortest sequence, and we are also interested in the maximum shortest path length among all pairs of vertices, which is known as the combinatorial diameter of the polytope . The combinatorial diameter of a polytope has attracted much attention in the optimization community from the motivation of better understanding of simplex methods. Simplex methods for linear optimization start at a vertex of the feasible region, follow edges, and arrive at an optimal vertex. Therefore, the combinatorial diameter dictates the best-case behavior of such methods. The famous Hirsch conjecture states that every -dimensional convex polytope with facets has the combinatorial diameter at most . This has been disproved by Santos [33], and the current best upper bound of for the combinatorial diameter was given by Sukegawa [34]. On the other hand, for the 0/1-polytopes (i.e., polytopes in which the coordinates of all vertices belong to ), the Hirsch conjecture holds [26].
The shortest perfect matching reconfiguration under the alternating cycle model can be seen as the combinatorial shortest path problem of a perfect matching polytope. The perfect matching polytope of a graph is defined as follows. The polytope lives in , namely each coordinate corresponds to an edge of . Each vertex of the polytope corresponds to a perfect matching of as if and if . The polytope is defined as the convex hull of those vertices. It is known that two vertices of the perfect matching polytope form an edge if and only if the corresponding perfect matchings have the property that contains only one cycle [9]. This means that the graph of the perfect matching polytope is exactly the configuration space for perfect matchings under the alternating cycle model.
Further Related Work
As mentioned before, the matching reconfiguration has been studied by several authors [16, 19, 14, 6, 4]. Extension to -matchings has been considered, too [25, 17].
Shortest reconfiguration has attracted considerable attention. Starting from an old work on the -puzzle [31], we see the work on pancake sorting [8], triangulations of point sets [21, 29] and simple polygons [2] under flip distances, and also independent set reconfigurations [35], satisfiability reconfiguration [24], coloring reconfiguration [18], token swapping problems [37, 23, 38, 5, 36, 20]. A tantalizing open problem is to determine the complexity of computing the rotation distance of two rooted binary trees (or equivalently the flip distance of two triangulations of a convex polygon, or the combinatorial shortest path of an associahedron).
The computational aspect of the combinatorial shortest path problem on convex polytopes is not well investigated. It is known that the combinatorial diameter is hard to determine [11] even for fractional matching polytopes [32]. In the literature, we find many papers on the adjacency of convex polytopes arising from combinatorial optimization problems [13, 22, 3, 10]. Among others, Papadimitriou [28] proved that determining whether two given vertices are adjacent in a traveling salesman polytope is -complete. This implies that computing the combinatorial shortest path between two vertices of a traveling salesman polytope is -hard. However, to the best of the authors’ knowledge, all known combinatorial polytopes with such adjacency hardness stem from -hard combinatorial optimization problems and the associated polytopes have exponentially many facets. We also point out the work on a randomized algorithm to compute a combinatorial “short” path [7].
1.2 Our Contribution
To the best of the authors’ knowledge, known results under different models do not have direct relations to our alternating cycle model, because their configuration spaces are different. In this paper, we thus investigate the polynomial-time solvability of the shortest perfect matching reconfiguration under the alternating cycle model. The results of our paper are two-fold.
The shortest perfect matching reconfiguration under the alternating cycle model can be solved in polynomial time if the input graph is outerplanar. 2. 2.
The shortest perfect matching reconfiguration under the alternating cycle model is -hard even when the input graph is planar or bipartite.
Since outerplanar graphs form a natural and fundamental subclass of planar graphs, our results exhibit a tractability border among planar graphs.
The hardness result for bipartite graphs implies that the computation of a combinatorial shortest path in a convex polytope is -hard even when an inequality description is explicitly given. This is because a polynomial-size inequality description of the perfect matching polytope can be explicitly written down from a given bipartite graph.
We point out that the hardness results have been independently obtained by Aichholzer et al. [1]. Indeed, they proved the hardness for planar bipartite graphs (i.e., an input graph is planar and bipartite).
Technical Key Points
Compared to recent algorithmic developments on reachability problems, only a few polynomial-time solvable cases are known for shortest reconfiguration problems. We now explain two technical key points, especially for algorithmic results on shortest reconfiguration problems.
The first point is the symmetric difference of two given solutions. Under several known models (not only for matchings) that employ elementary changes as the adjacency on the configuration space, the symmetric difference gives a (good) lower bound on the shortest reconfiguration. This is because any reconfiguration sequence (i.e., a path in the configuration space) between two given solutions must touch all elements in their symmetric difference at least once. For example, in Figure 1, the symmetric difference of two perfect matchings and consists of edges and hence it gives the lower bound of under the alternating cycle model restricted to length [4]. In such a case, if we can find a reconfiguration sequence touching only the elements in the symmetric difference (e.g., the sequence in Figure 1), then it is automatically the shortest under that model. However, this useful property does not hold under our alternating cycle model, because the length of an alternating cycle for reconfiguration is not fixed.
The second point is the characterization of unhappy moves that touch elements contained commonly in two given solutions. For example, the shortest reconfiguration sequence in Figure 1 has an unhappy move, since it touches the edge in twice. In general, analyzing a shortest reconfiguration becomes much more difficult if such unhappy moves are required. A well-known example is the (generalized) -puzzle [31] in which the reachability can be determined in polynomial time, while the shortest reconfiguration is -hard. As illustrated in Figure 1, the shortest perfect matching reconfiguration requires unhappy moves even for outerplanar graphs, and hence we need to characterize the unhappy moves to develop a polynomial-time algorithm.
2 Problem Definition
In this paper, a graph always refers to an undirected graph that might have parallel edges and does not have loops. For a graph , we denote by and the vertex set and edge set of , respectively. An edge subset is called a matching in if no two edges in share the end vertices. A matching is perfect if .
A graph is planar if it can be drawn on the plane without edge crossing. Such a drawing is called a plane drawing of the planar graph. A face of a plane drawing is a maximal region of the plane that contains no point used in the drawing. There is a unique unbounded face, which is called the outer face. A planar graph is outerplanar if it has an outerplane drawing, i.e., a plane drawing in which all vertices are incident to the outer face.
For a matching in a graph , a cycle in is called -alternating if edges in and alternate in . We identify a cycle with its edge set to simplify the notation. We say that two perfect matchings and are reachable (under the alternating cycle model) if there exists a sequence of perfect matchings in such that
- (i)
and ; 2. (ii)
for some -alternating cycle for each .
Such a sequence is called a reconfiguration sequence between and , and its length is defined as .
For two perfect matchings and , the subgraph consists of disjoint -alternating cycles . Thus it is clear that and are always reachable for any two perfect matchings and by setting for . In this paper, we are interested in finding a shortest reconfiguration sequence of perfect matchings. That is, the problem is defined as follows:
- Shortest Perfect Matching Reconfiguration
- Input:
A graph and two perfect matchings and in
- Find:
A shortest reconfiguration sequence between and .
We denote by a tuple an instance of Shortest Perfect Matching Reconfiguration. Also, we denote by the length of a shortest reconfiguration sequence of an instance . We note that it may happen that is much shorter than the number of disjoint -alternating cycles in (see Figure 1).
3 Polynomial-Time Algorithm for Outerplanar Graphs
In this section, we prove that there exists a polynomial-time algorithm for Shortest Perfect Matching Reconfiguration on an outerplanar graph, as follows.
Theorem 3.1**.**
Shortest Perfect Matching Reconfiguration* on outerplanar graphs can be solved in time.*
We give such an algorithm in this section. Let be an instance of the problem such that is an outerplanar graph. We first observe that it suffices to consider the case when is 2-connected.
Lemma 3.2**.**
Let be an instance of Shortest Perfect Matching Reconfiguration, and be the -connected components of . Furthermore, for every , let be an instance of Shortest Perfect Matching Reconfiguration. Then, .
Proof.
Let be 2-connected components in . Then, since any -alternating cycle is contained in some for a perfect matching of , it suffices to solve the problem for each . Specifically, it holds that , where . ∎
Since the 2-connected components of a graph can be found in linear time, the reduction to 2-connected outerplanar graphs can be done in linear time, too.
We fix an outerplane drawing of a given -connected outerplanar graph , and identify with the drawing for the sake of convenience. We denote by the outer face boundary. Then is a simple cycle since is -connected. We denote the set of the inner edges of by . In other words, is the set of chords of .
3.1 Technical Highlight
As mentioned in Introduction, there are two technical key points to develop a polynomial-time algorithm for Shortest Perfect Matching Reconfiguration: a lower bound on the length of a shortest reconfiguration sequence, and the characterization of unhappy moves. We here explain our ideas roughly, and will give detailed descriptions in the next subsections.
Since is planar, we can define its “dual-like” graph . Then, forms a tree since is outerplanar and -connected. (The definition of will be given in Section 3.2, and an example is given in Figure 2.) We make a correspondence between an edge in and a set of edges in . Then, we will define the length of each edge in so that it represents the “gap” between and when we are restricted to the edges in the corresponding set of . It is important to notice that any cycle in corresponds to a subtree of , and vice versa. Indeed, we focus on a cut of clipping the subtree from , that is, the set of edges in leaving the subtree. If we apply an -alternating cycle to a perfect matching of , then it changes lengths of the edges in the corresponding cut .
For our algorithm, we need a (good) lower bound for the length of a shortest reconfiguration sequence between two given perfect matchings and . Recall that does not give a good lower bound under the alternating cycle model. This is because we can take a cycle of an arbitrary (non-fixed) length, and hence can decrease drastically by only a single alternating cycle. Furthermore, no matter how we define the length of each edge in , the total length of all edges in does not give a good lower bound. This is because a cycle of non-fixed length in may correspond to a cut having many edges in , and hence it can change the total length drastically. Our key idea is to focus on the total length of each path in , that is, we take the diameter of (with respect to length ) as a lower bound. Then, because is a tree, any path in can contain at most two edges from the corresponding cut . Therefore, regardless of the cycle length, the diameter of can be changed by only these two edges. By carefully setting the length as in (1), we will prove that the diameter of is not only a lower bound, but indeed gives the shortest length under the assumption that is empty. Therefore, the real difficulty arises when is not empty.
In the latter case, we will characterize the unhappy moves. Assume that we know the set of chords that are not touched in a shortest reconfiguration sequence between and ; in other words, all chords in must be touched for unhappy moves in that sequence. Then, we subdivide a given outerplanar graph into subgraphs along the chords in . Notice that each edge in appears on the outer face boundaries in two of these subgraphs. Furthermore, each chord in these subgraphs satisfies if . Therefore, all chords in these subgraphs are touched for unhappy moves as long as they are in . Under this assumption, we will prove that the diameter of gives the shortest length of a reconfiguration sequence between and . Thus, we can solve the problem in polynomial time if we know which yields a shortest reconfiguration sequence between and . Finally, to find such a set of chords, we construct a polynomial-time algorithm which employs a dynamic programming method along the tree .
3.2 Preliminaries: Constructing a Dual Graph
Let be an instance of Shortest Perfect Matching Reconfiguration such that is a -connected outerplanar graph. Since is planar, we can define the dual of . In fact, we here construct a graph obtained from the dual by applying a slight modification as follows. The construction is illustrated in Figure 2. Let be the set of faces (without the outer face) of . For a face , let be the set of edges around . We denote the set of faces touching the outer face by , i.e., . We make a copy of , denoted by . We set the vertex set of to be . For in , an edge in exists if and only if the faces and share an edge in , i.e., . Also has an edge between and for every . Thus the edge set of is given by
[TABLE]
The first part is denoted by , and the second part is denoted by . We observe that is a tree, since is -connected and outerplanar. A face of that touches only one face (other than the outer face) is called a leaf in . We note that there is a one-to-one correspondence between edges in of and of . For an edge subset , denotes the corresponding edge subset in , that is, . Conversely, for an edge subset , denotes the corresponding edge subset in , that is, . We extend this correspondence to , that is, corresponds to the edge set for , and vice versa.
It follows from the duality that there is a relationship between a cut in and a cycle in . Suppose that we are given a cycle in . Then, since is outerplanar, the cycle surrounds a set of faces such that does not have the outer face. The set induces a connected graph (subtree) in , and the set of edges leaving from yields a cut . Conversely, let be a vertex subset of such that the subgraph induced by is connected. Then the set of edges leaving from yields a cut in , which corresponds to a cycle in .
We classify faces in into two groups. For a face in , the edge set forms a family of disjoint paths. Since and are perfect matchings, each path in is both -alternating and -alternating. In addition, satisfies either
- (i)
, or 2. (ii)
.
Furthermore, we observe that either (i) holds for every path in , or (ii) holds for every path in . Indeed, since consists of disjoint cycles, if some path in satisfies (i), then is included in a cycle in that separates from the outer face. Since the other paths in touch the outer face, they are on . Thus every path satisfies (i), which shows the observation. We divide into two groups and where each face in satisfies (i) for every path, while each face in satisfies (ii) for every path.
For an edge in , we define the length to be
[TABLE]
See Figure 2 for an example. Let be the length of the (unique) path from to in . We define the gap between and in the graph as the diameter of , that is, we define
[TABLE]
This value is simply denoted by if is clear from the context.
3.3 Characterization for the Disjoint Case
Let be an instance of Shortest Perfect Matching Reconfiguration such that is a -connected outerplanar graph. In this subsection, we show that if is empty, we can characterize the optimal value with , which leads to a simple polynomial-time algorithm for this case. We note that if is empty, then no edge in belongs to both and , and hence can only take [math] or ; in addition, if .
Lemma 3.3**.**
It holds that is even.
Proof.
Consider a path whose length is equal to in . We may assume that the end vertices of are in , as otherwise we can extend the path to some vertex in without decreasing the length. Let be the end vertices of . This means that the faces and touch the outer face. Take arbitrary edges and . Then forms a cut in by the duality. By the definition of , for , it holds that if and only if . Hence the parity of is the same as that of . Since and are perfect matchings, the parities of and are the same. Therefore, is even, and thus is also even. ∎
A main theorem of this subsection is to give a characterization of the optimal value with .
Theorem 3.4**.**
Let be an instance of Shortest Perfect Matching Reconfiguration such that is a -connected outerplanar graph. If is empty, then it holds that .
Proof.
To show the theorem, we first prove the following claim.
Claim 1**.**
For any -alternating cycle , it holds that
[TABLE]
Proof of Claim 1.
By the duality, the cycle in corresponds to a cut in such that the inside is connected. Such a cut intersects with any path in at most twice as is a tree, and only the intersected edges can change the length by one. Therefore, the distance can be decreased by at most . ∎
Consider a shortest reconfiguration sequence from to . Then, . For each , it then holds that . By repeatedly applying the above inequalities, we obtain
[TABLE]
since . Hence it holds that .
It remains to show that . We prove the following claim.
Claim 2**.**
There exists an -alternating cycle such that
[TABLE]
Proof of Claim 2.
We prove the claim by induction on the number of edges.
We first observe that we may assume that . Otherwise, we can just delete all the edges in , and apply the induction to find an -alternating cycle that satisfies (2) for the modified graph. Since the deletion does not change the gap, is a desired cycle in as well. Therefore, we may assume that all the edges in have length .
In addition, we may assume that any leaf in belongs to . In other words, and are distinct in . Indeed, suppose that there exists a leaf in . Then . Since any chord is in either or by the above observation and the assumption that , , where is the unique neighbor to in . We delete from , , and , and then delete all the isolated vertices. We denote the obtained graph by . This corresponds to deleting the face with from , and adding to if necessary. We can see that, in the modified graph , we have , as is in either or . Hence this deletion preserves . We then apply the induction to to find an -alternating cycle that satisfies (2). This cycle is a desired one in . Thus we may assume that any leaf in belongs to .
Since is even by Lemma 3.3, we have for some positive integer . Then there exists a vertex of such that, for every , the - path has length at most . Let be a minimal vertex subset of such that
- •
- •
the subgraph induced by is connected in
- •
the cut has only edges in .
Such always exists as satisfies all the conditions. The cut corresponds to a cycle in . An example is given in Figure 3.
We claim that is -alternating. Assume not. Then there exist two consecutive edges , in such that , which implies that as . Since is a perfect matching, the vertex is incident to another edge in . Since is 2-connected and outerplanar, there exists a path from to using the edge that is internally disjoint from . If has more than one edges, then ends with or , since is outerplanar, which contradicts that . Hence has only one edge. However, this implies that has a chord in , which contradicts that was chosen to be minimal. Thus is an -alternating cycle.
Consider taking . Let be the length defined by (1) with and . It follows that, for an edge ,
[TABLE]
We will show that, for any vertex in , we have . This proves the claim, as, for any two vertices in , it holds that
[TABLE]
Since and no vertex in is in , the - path intersects with exactly once. Hence the length of is changed by one by taking . So, if , then . Thus it suffices to consider the case when , i.e., or .
Assume that , which implies that and hence is not a leaf in . In this case, there exists a leaf in such that . Since , we obtain
[TABLE]
which is a contradiction.
Thus, we may assume that . If the - path intersects , then the intersected cut edge has length 1, and hence we see that . Otherwise, that is, if intersects with , then the intersected cut edge is , and hence . Thus, in each case. ∎
For a perfect matching in , it follows from Claim 2 that there exists an -alternating cycle such that . Define , and repeat finding an alternating cycle satisfying the above equation. The repetition ends when , which means that when is empty. The number of repetitions is equal to , and therefore, we have . Thus the proof is complete. ∎
3.4 General Case
Let be an instance of Shortest Perfect Matching Reconfiguration such that is a -connected outerplanar graph. Define . In this subsection, we deal with the general case, that is, is not necessarily empty. Then, there is a case when changing an edge in reduces the number of reconfiguration steps as in Figure 1. We call such a move an unhappy move. The key idea of our algorithm is to detect a set of edges necessary for unhappy moves.
Since is outerplanar and -connected, any divides the inner region of into parts . For each , let be the subgraph of consisting of all the vertices and the edges in and its boundary. Thus, each edge appears on the outer face boundaries in two of these subgraphs. See Figure 4. Let . Note that each graph in is outerplanar and -connected. For each , let . We now show the following theorem.
Theorem 3.5**.**
.
Proof.
Let be a shortest reconfiguration sequence from to . We denote by the -alternating cycle with . Define
[TABLE]
which is the set of edges in that do not touch in the shortest reconfiguration sequence. Then is contained in some , and can be used to obtain a reconfiguration sequence from to in . Therefore, we have
[TABLE]
We can also see that
[TABLE]
for any .
To evaluate for , we slightly modify the instance by replacing every inner edge of contained in by two parallel edges each in and , respectively. The obtained graph is denoted by , and the corresponding instance is denoted by . Since a reconfiguration sequence for can be converted to one for , it holds that , and hence
[TABLE]
holds for any by (4). Moreover, by the definition of , there exists an index such that for any . Therefore, for , the shortest reconfiguration sequence for can be converted to a reconfiguration sequence for . Thus, holds for , and hence
[TABLE]
by (3). By (5) and (6), we obtain
[TABLE]
and is a minimizer of the right-hand side.
By (7) and Theorem 3.4, we obtain
[TABLE]
because each satisfies the condition in Theorem 3.4. Since is obtained from by subdividing some edges of length two into two edges of length one, the diameter of is equal to that of , that is, . Therefore, we obtain the theorem by (8). ∎
As an example, we apply this theorem to the instance in Figure 2. See Figure 4(c). If consists of only the right thick edge in Figure 2(c), then consists two graphs and such that and . Since we can check that such attains the minimum in the right-hand side of Theorem 3.5, we obtain by Theorem 3.5.
In order to compute the value in Theorem 3.5 efficiently, we reduce the problem to Min-Sum Diameter Decomposition, whose definition will be given later.
For , let be the edge subset of corresponding to , and let . Then, consists of components such that coincides with (except for the difference of edges of length zero) for . In particular, for each , we have , where is the length function on defined by the instance . We call the diameter of , which is denoted by . Then, Theorem 3.5 shows that
[TABLE]
Therefore, we can compute by solving the following problem in which and .
- Min-Sum Diameter Decomposition
- Input:
A tree , an edge subset , and a length function .
- Find:
An edge set that minimizes , where the sum is taken over all the components of .
In the subsequent subsection, we show that Min-Sum Diameter Decomposition can be solved in time polynomial in and .
Theorem 3.6**.**
Min-Sum Diameter Decomposition* can be solved in time, where .*
Since (9) shows that Shortest Perfect Matching Reconfiguration on outerplanar graphs is reduced to Min-Sum Diameter Decomposition in which , we obtain Theorem 3.1.
3.5 Algorithm for Min-Sum Diameter Decomposition
The remaining task is to show Theorem 3.6, that is, to give an algorithm for Min-Sum Diameter Decomposition that runs in time. For this purpose, we adopt a dynamic programming approach.
We choose an arbitrary vertex of a given tree , and regard as a rooted tree with the root . For each vertex of , we denote by the subtree of which is rooted at and is induced by all descendants of in . (See Figure 5(a).) Thus, for the root . Let be the children of , ordered arbitrarily. For each , we denote by the subtree of induced by . For example, in Figure 5(b), the subtree is surrounded by a thick dotted rectangle. For notational convenience, we denote by the tree consisting of a single vertex . Then, for each leaf of . Our algorithm computes and extends partial solutions for subtrees from the leaves to the root of by keeping the information required for computing (the sum of) diameters of a partial solution.
We now define partial solutions for subtrees. For a subtree and an edge subset , the frontier for is the component (subtree) in that contains the root of . We sometimes call it the -frontier for to emphasize the root . For three integers , the edge subset is called an -separator of if the following three conditions hold. (See also Figure 5(c).)
- •
, where is the -frontier for . That is, the longest path from to a vertex in is of length .
- •
, that is, denotes the diameter of the -frontier for .
- •
, where the sum is taken over all the components of .
Note that always holds for an -separator of . We then define the following function: for a subtree and two integers , we let
[TABLE]
Note that is defined as if does not have an -separator for any . Then, the optimal objective value to Min-Sum Diameter Decomposition can be computed as .
For a given tree , our algorithm computes for all possible triplets from the leaves to the root of , as follows.
Initialization. We first compute for all vertices (including internal vertices in ). Recall that consists of a single vertex . Therefore, we have
[TABLE]
Notice that we have computed for all leaves of , since if is a leaf.
Update. We now consider the case where . To compute , we classify -separators of into the following two groups (a) and (b). Note that -separators of Group (b) exist only when .
(a) The vertices and are contained in the same component. (See also Figure 6(a).)
In this case, the edge is not deleted, and the -frontier for an -separator of contains both and . Therefore, we can obtain the -frontier for an -separator of by merging the -frontier for some -separator of with the -frontier for some -separator of . Thus, we define
[TABLE]
where the minimum is taken over all integers such that and .
(b) The vertices and are contained in different components. (See also Figure 6(b).)
In this case, the edge is deleted, and hence this case happens only when . Then, the -frontier for an -separator of is the -frontier for some -separator of . Note that is contained in a non-frontier component for the -separator of , but the component forms the -frontier for some -separator of , as illustrated in Figure 6(b). Thus, we need to take the diameter of the -frontier into account when we compute from and . Therefore, we define
[TABLE]
where the minimum is taken over all integers such that and .
Then, we can compute as follows:
[TABLE]
Since , this update can be done in time for each subtree . The number of subtrees is equal to . Therefore, this algorithm runs in time in total.
Note that we can easily modify the algorithm so that we obtain not only the optimal value but also an optimal solution. This completes the proof of Theorem 3.6.
We remark here that the algorithm can be modified so that the running time is bounded by a polynomial in by replacing the domain of and with . This modification is valid, because unless . Since , the modified algorithm runs in time. Note that, although this bound is polynomial only in , it is worse than when .
4 NP-Hardness for Planar Graphs and Bipartite Graphs
In this section, we prove that Shortest Perfect Matching Reconfiguration is -hard even when the input graph is planar or bipartite.
Theorem 4.1**.**
Shortest Perfect Matching Reconfiguration* is -hard even for planar graphs of maximum degree three.*
We reduce the Hamiltonian Cycle Problem problem, which is known to be -complete even when a given graph is -regular and planar [12].
- Hamiltonian Cycle Problem
- Input:
A -regular planar graph
- Question:
Decide whether has a Hamiltonian cycle, i.e., a cycle that goes through all the vertices exactly once.
Proof.
Let be a -regular planar graph, which is an instance of Hamiltonian Cycle Problem. For each vertex , we define a -vertex graph (see also the top right in Figure 7):
[TABLE]
We construct an instance of our problem as follows. (See Figure 7 as an example.) We subdivide each edge in twice, and the obtained vertices are denoted by and , where is closer to . Then, for each vertex , we replace with the graph , and connect to and , to and , where , , are edges incident to and the order follows the planar embedding of . Let . The resulting graph is denoted by , i.e., is defined as follows:
[TABLE]
It follows that is a planar graph of maximum degree three. Furthermore, we define initial and target perfect matchings and in , respectively, to be
[TABLE]
This completes the construction of our corresponding instance . The construction can be done in polynomial time.
We then give the following claims. Recall that is the length of a shortest reconfiguration sequence for the constructed instance .
Claim 3**.**
It holds that .
Proof of Claim 3.
We observe that, if , then must consist of one -alternating cycle, but it is not true for our instance . Thus the length of a reconfiguration sequence is at least two. ∎
We remark that has an -alternating path from to for any with . This implies that, for a cycle in , there exists a corresponding -alternating cycle in such that it goes through vertices of for every and edges for every .
Claim 4**.**
If has a Hamiltonian cycle , then it holds that .
Proof of Claim 4.
We see that has an -alternating cycle , corresponding to of , that has one edge of for each . Then is a perfect matching. In a similar way, has an -alternating cycle , corresponding to , that uses three edges , , and of for each . Then is equal to . Thus we can find a reconfiguration sequence of length two, which is shortest by Claim 3. ∎
The -cycle formed by is denoted by .
Claim 5**.**
If , then has a Hamiltonian cycle.
Proof of Claim 5.
We denote by a shortest reconfiguration sequence of . Let . We may assume that is not for any , as . We will prove that the edge subset forms a Hamiltonian cycle in . We denote by the set of vertices in used in . Let . Since and are distinct for , the symmetric difference has at least disjoint -alternating cycles. Moreover, for a vertex , we see that and , that are distinct. Hence has at least one -alternating cycle disjoint from . Therefore, we have at least disjoint -alternating cycles. However, must consist of one cycle (see Claim 3), implying that . This means that goes through for every , and hence is a Hamiltonian cycle in . Thus the claim holds. ∎
Therefore, it follows that has a Hamiltonian cycle if and only if . This completes the proof of Theorem 4.1. ∎
The hardness for bipartite graphs of maximum degree at most three can be obtained with a similar proof.
Theorem 4.2**.**
Shortest Perfect Matching Reconfiguration* is -hard even for bipartite graphs of maximum degree three.*
We reduce the directed Hamiltonian cycle problem, which is known to be -complete even if digraphs have the maximum in-degree two and the maximum out-degree two [30].
- Directed Hamiltonian Cycle Problem
- Input:
A digraph
- Question:
Decide whether has a directed Hamiltonian cycle, i.e., a directed cycle that goes through all the vertices exactly once.
Proof.
Let be a digraph, which is an instance of the directed Hamiltonian cycle problem. We assume that ; otherwise the problem is trivial. For each vertex , we define a -vertex graph (see the top right in Figure 8):
[TABLE]
The cycle of length four formed by is denoted by .
We construct an instance of our problem as follows. The vertex set and the edge set of are defined as
[TABLE]
respectively. Namely, for each directed edge from to in , we add an undirected edge to between and . This finishes the construction of . Note that is bipartite and its maximum degree is at most three as both the maximum in-degree and the maximum out-degree of are at most two. Let and be defined as
[TABLE]
Refer to Figure 8 for the illustration. Let be the length of a shortest reconfiguration sequence for .
Claim 6**.**
It holds that .
Proof.
If , then must consist of one -alternating cycle, but this is not the case for our instance . Thus, the length of a reconfiguration sequence is at least two. ∎
Claim 7**.**
If has a directed Hamiltonian cycle , then it holds that .
Proof.
We see that has an -alternating cycle , corresponding to of , that has four edges of for each . Then is a perfect matching. In a similar way, has an -alternating cycle , corresponding to , that uses three edges , , and of for each . Then is equal to . Thus we can find a reconfiguration sequence of length two, which is the shortest by Claim 6. ∎
Claim 8**.**
If , then has a directed Hamiltonian cycle.
Proof.
Let be a shortest reconfiguration sequence of . Let . We may assume that is not for any , as . We will prove that the edge subset forms a Hamiltonian cycle in . We denote by the set of vertices in used in . Let . Since and are distinct for , the symmetric difference has at least disjoint -alternating cycles. Moreover, for a vertex , we see that and , that are distinct. Hence has at least one -alternating cycle disjoint from . Therefore, we have at least disjoint -alternating cycles. However, must consist of one cycle (see Claim 6), implying that . This means that goes through for every , and hence is a Hamiltonian cycle in . Thus the claim holds. ∎
Therefore, it follows that has a directed Hamiltonian cycle if and only if . This completes the proof. ∎
Note that the reduction does not produce a planar graph even when the input digraph has a planar underlying graph. The example in Figure 8 contains a -minor.
The proofs actually show that Shortest Perfect Matching Reconfiguration is -hard to approximate within a factor of less than .
5 Conclusion
In this paper, we studied the shortest reconfiguration problem of perfect matchings under the alternating cycle model, which is equivalent to the combinatorial shortest path problem on perfect matching polytopes. We prove that the problem can be solved in polynomial time for outerplanar graphs, but it is -hard, and even -hard for planar graphs and bipartite graphs.
Several questions remain unsolved. For polynomial-time solvability, our algorithm runs only for outerplanar graphs, and it looks difficult to extend the algorithm to other graph classes. A next step would be to try -outerplanar graphs for fixed .
One way to tackle -hard cases is approximation. We only know the -hardness of -approximation. We believe the existence of a polynomial-time constant-factor approximation. Note that we do not obtain a constant-factor approximation by flipping alternating cycles in the symmetric difference of two given perfect matchings one by one.
This paper was mainly concerned with reconfiguration of perfect matchings. Alternatively, we may consider reconfiguration of maximum matchings, or maximum-weight matchings. In those cases, we need to adopt the alternating path/cycle model. Then, the question is related to the combinatorial shortest path problem on faces of matching polytopes. Note that the perfect matching polytope is also a face of the matching polytope. Therefore, the study on maximum-weight matchings will be a generalization of this paper.
To the best of the authors’ knowledge, the combinatorial shortest path problem of -polytopes has not been well investigated while the adjacency in -polytopes has been extensively studied in the literature. This paper opens up a new perspective for the study of combinatorial and computational aspects of polytopes, and connects them with the study of combinatorial reconfiguration.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Oswin Aichholzer, Jean Cardinal, Tony Huynh, Kolja Knauer, Torsten Mütze, Raphael Steiner, and Birgit Vogtenhuber. Flip distances between graph orientations. Co RR , abs/1902.06103, 2019. To appear in WG 2019. ar Xiv:1902.06103 .
- 2[2] Oswin Aichholzer, Wolfgang Mulzer, and Alexander Pilz. Flip distance between triangulations of a simple polygon is NP-complete. Discrete & Computational Geometry , 54(2):368–389, 2015. doi:10.1007/s 00454-015-9709-7 . · doi ↗
- 3[3] Abdo Y. Alfakih and Katta G. Murty. Adjacency on the constrained assignment problem. Discrete Applied Mathematics , 87(1-3):269–274, 1998. doi:10.1016/S 0166-218X(98)00063-8 . · doi ↗
- 4[4] Marthe Bonamy, Nicolas Bousquet, Marc Heinrich, Takehiro Ito, Yusuke Kobayashi, Arnaud Mary, Moritz Mühlenthaler, and Kunihiro Wasa. The perfect matching reconfiguration problem. Co RR , abs/1904.06184, 2019. To appear in MFCS 2019. ar Xiv:1904.06184 .
- 5[5] Édouard Bonnet, Tillmann Miltzow, and Paweł Rzążewski. Complexity of token swapping and its variants. Algorithmica , 80(9):2656–2682, 2018. doi:10.1007/s 00453-017-0387-0 . · doi ↗
- 6[6] Nicolas Bousquet, Tatsuhiko Hatanaka, Takehiro Ito, and Moritz Mühlenthaler. Shortest reconfiguration of matchings. Co RR , abs/1812.05419, 2018. To appear in WG 2019. ar Xiv:1812.05419 .
- 7[7] Tobias Brunsch and Heiko Röglin. Finding short paths on polytopes by the shadow vertex algorithm. In Fedor V. Fomin, Rusins Freivalds, Marta Z. Kwiatkowska, and David Peleg, editors, Automata, Languages, and Programming - 40th International Colloquium, ICALP 2013, Riga, Latvia, July 8-12, 2013, Proceedings, Part I , volume 7965 of Lecture Notes in Computer Science , pages 279–290. Springer, 2013. doi:10.1007/978-3-642-39206-1_24 . · doi ↗
- 8[8] Laurent Bulteau, Guillaume Fertin, and Irena Rusu. Pancake flipping is hard. J. Comput. Syst. Sci. , 81(8):1556–1574, 2015. doi:10.1016/j.jcss.2015.02.003 . · doi ↗
