-
Shortest cover after edit
Authors:
Kazuki Mitani,
Takuya Mieno,
Kazuhisa Seto,
Takashi Horiyama
Abstract:
This paper investigates the (quasi-)periodicity of a string when the string is edited. A string $C$ is called a cover (as known as a quasi-period) of a string $T$ if each character of $T$ lies within some occurrence of $C$. By definition, a cover of $T$ must be a border of $T$; that is, it occurs both as a prefix and as a suffix of $T$. In this paper, we focus on the changes in the longest border…
▽ More
This paper investigates the (quasi-)periodicity of a string when the string is edited. A string $C$ is called a cover (as known as a quasi-period) of a string $T$ if each character of $T$ lies within some occurrence of $C$. By definition, a cover of $T$ must be a border of $T$; that is, it occurs both as a prefix and as a suffix of $T$. In this paper, we focus on the changes in the longest border and the shortest cover of a string when the string is edited only once. We propose a data structure of size $O(n)$ that computes the longest border and the shortest cover of the string in $O(\ell \log n)$ time after an edit operation (either insertion, deletion, or substitution of some string) is applied to the input string $T$ of length $n$, where $\ell$ is the length of the string being inserted or substituted. The data structure can be constructed in $O(n)$ time given string $T$.
△ Less
Submitted 25 April, 2024; v1 submitted 27 February, 2024;
originally announced February 2024.
-
Theoretical Aspects of Generating Instances with Unique Solutions: Pre-assignment Models for Unique Vertex Cover
Authors:
Takashi Horiyama,
Yasuaki Kobayashi,
Hirotaka Ono,
Kazuhisa Seto,
Ryu Suzuki
Abstract:
The uniqueness of an optimal solution to a combinatorial optimization problem attracts many fields of researchers' attention because it has a wide range of applications, it is related to important classes in computational complexity, and an instance with only one solution is often critical for algorithm designs in theory. However, as the authors know, there is no major benchmark set consisting of…
▽ More
The uniqueness of an optimal solution to a combinatorial optimization problem attracts many fields of researchers' attention because it has a wide range of applications, it is related to important classes in computational complexity, and an instance with only one solution is often critical for algorithm designs in theory. However, as the authors know, there is no major benchmark set consisting of only instances with unique solutions, and no algorithm generating instances with unique solutions is known; a systematic approach to getting a problem instance guaranteed having a unique solution would be helpful. A possible approach is as follows: Given a problem instance, we specify a small part of a solution in advance so that only one optimal solution meets the specification. This paper formulates such a ``pre-assignment'' approach for the vertex cover problem as a typical combinatorial optimization problem and discusses its computational complexity. First, we show that the problem is $Σ^P_2$-complete in general, while the problem becomes NP-complete when an input graph is bipartite. We then present an $O(2.1996^n)$-time algorithm for general graphs and an $O(1.9181^n)$-time algorithm for bipartite graphs, where $n$ is the number of vertices. The latter is based on an FPT algorithm with $O^*(3.6791^τ)$ time for vertex cover number $τ$. Furthermore, we show that the problem for trees can be solved in $O(1.4143^n)$ time.
△ Less
Submitted 16 December, 2023;
originally announced December 2023.
-
Finding Top-k Longest Palindromes in Substrings
Authors:
Kazuki Mitani,
Takuya Mieno,
Kazuhisa Seto,
Takashi Horiyama
Abstract:
Palindromes are strings that read the same forward and backward. Problems of computing palindromic structures in strings have been studied for many years with a motivation of their application to biology. The longest palindrome problem is one of the most important and classical problems regarding palindromic structures, that is, to compute the longest palindrome appearing in a string $T$ of length…
▽ More
Palindromes are strings that read the same forward and backward. Problems of computing palindromic structures in strings have been studied for many years with a motivation of their application to biology. The longest palindrome problem is one of the most important and classical problems regarding palindromic structures, that is, to compute the longest palindrome appearing in a string $T$ of length $n$. The problem can be solved in $O(n)$ time by the famous algorithm of Manacher [Journal of the ACM, 1975]. This paper generalizes the longest palindrome problem to the problem of finding top-$k$ longest palindromes in an arbitrary substring, including the input string $T$ itself. The internal top-$k$ longest palindrome query is, given a substring $T[i..j]$ of $T$ and a positive integer $k$ as a query, to compute the top-$k$ longest palindromes appearing in $T[i.. j]$. This paper proposes a linear-size data structure that can answer internal top-$k$ longest palindromes query in optimal $O(k)$ time. Also, given the input string $T$, our data structure can be constructed in $O(n\log n)$ time. For $k = 1$, the construction time is reduced to $O(n)$.
△ Less
Submitted 17 June, 2023; v1 submitted 4 October, 2022;
originally announced October 2022.
-
RePair Grammars are the Smallest Grammars for Fibonacci Words
Authors:
Takuya Mieno,
Shunsuke Inenaga,
Takashi Horiyama
Abstract:
Grammar-based compression is a loss-less data compression scheme that represents a given string $w$ by a context-free grammar that generates only $w$. While computing the smallest grammar which generates a given string $w$ is NP-hard in general, a number of polynomial-time grammar-based compressors which work well in practice have been proposed. RePair, proposed by Larsson and Moffat in 1999, is a…
▽ More
Grammar-based compression is a loss-less data compression scheme that represents a given string $w$ by a context-free grammar that generates only $w$. While computing the smallest grammar which generates a given string $w$ is NP-hard in general, a number of polynomial-time grammar-based compressors which work well in practice have been proposed. RePair, proposed by Larsson and Moffat in 1999, is a grammar-based compressor which recursively replaces all possible occurrences of a most frequently occurring bigrams in the string. Since there can be multiple choices of the most frequent bigrams to replace, different implementations of RePair can result in different grammars. In this paper, we show that the smallest grammars generating the Fibonacci words $F_k$ can be completely characterized by RePair, where $F_k$ denotes the $k$-th Fibonacci word. Namely, all grammars for $F_k$ generated by any implementation of RePair are the smallest grammars for $F_k$, and no other grammars can be the smallest for $F_k$. To the best of our knowledge, Fibonacci words are the first non-trivial infinite family of strings for which RePair is optimal.
△ Less
Submitted 14 April, 2022; v1 submitted 16 February, 2022;
originally announced February 2022.
-
Interval-Memoized Backtracking on ZDDs for Fast Enumeration of All Lower Cost Solutions
Authors:
Shin-ichi Minato,
Mutsunori Banbara,
Takashi Horiyama,
Jun Kawahara,
Ichigaku Takigawa,
Yutaro Yamaguchi
Abstract:
In this paper, we propose a fast method for exactly enumerating a very large number of all lower cost solutions for various combinatorial problems. Our method is based on backtracking for a given decision diagram which represents all the feasible solutions. The main idea is to memoize the intervals of cost bounds to avoid duplicate search in the backtracking process. In contrast to usual pseudo-po…
▽ More
In this paper, we propose a fast method for exactly enumerating a very large number of all lower cost solutions for various combinatorial problems. Our method is based on backtracking for a given decision diagram which represents all the feasible solutions. The main idea is to memoize the intervals of cost bounds to avoid duplicate search in the backtracking process. In contrast to usual pseudo-polynomial-time dynamic programming approaches, the computation time of our method does not directly depend on the total cost values, but is bounded by the input and output size of the decision diagrams. Therefore, it can be much faster if the cost values are large but the input/output decision diagrams are well-compressed. We demonstrate its practical efficiency by comparing our method to current available enumeration methods: for nontrivial size instances of the Hamiltonian path problem, our method succeeded in exactly enumerating billions of all lower cost solutions in a few seconds, which was hundred or much more times faster. Our method can be regarded as a novel search algorithm which integrates the two classical techniques, branch-and-bound and dynamic programming. This method would have many applications in various fields, including operations research, data mining, statistical testing, hardware/software system design, etc.
△ Less
Submitted 27 April, 2022; v1 submitted 20 January, 2022;
originally announced January 2022.
-
Solving Rep-tile by Computers: Performance of Solvers and Analyses of Solutions
Authors:
Mutsunori Banbara,
Kenji Hashimoto,
Takashi Horiyama,
Shin-ichi Minato,
Kakeru Nakamura,
Masaaki Nishino,
Masahiko Sakai,
Ryuhei Uehara,
Yushi Uno,
Norihito Yasuda
Abstract:
A rep-tile is a polygon that can be dissected into smaller copies (of the same size) of the original polygon. A polyomino is a polygon that is formed by joining one or more unit squares edge to edge. These two notions were first introduced and investigated by Solomon W. Golomb in the 1950s and popularized by Martin Gardner in the 1960s. Since then, dozens of studies have been made in communities o…
▽ More
A rep-tile is a polygon that can be dissected into smaller copies (of the same size) of the original polygon. A polyomino is a polygon that is formed by joining one or more unit squares edge to edge. These two notions were first introduced and investigated by Solomon W. Golomb in the 1950s and popularized by Martin Gardner in the 1960s. Since then, dozens of studies have been made in communities of recreational mathematics and puzzles. In this study, we first focus on the specific rep-tiles that have been investigated in these communities. Since the notion of rep-tiles is so simple that can be formulated mathematically in a natural way, we can apply a representative puzzle solver, a MIP solver, and SAT-based solvers for solving the rep-tile problem in common. In comparing their performance, we can conclude that the puzzle solver is the weakest while the SAT-based solvers are the strongest in the context of simple puzzle solving. We then turn to analyses of the specific rep-tiles. Using some properties of the rep-tile patterns found by a solver, we can complete analyses of specific rep-tiles up to certain sizes. That is, up to certain sizes, we can determine the existence of solutions, clarify the number of the solutions, or we can enumerate all the solutions for each size. In the last case, we find new series of solutions for the rep-tiles which have never been found in the communities.
△ Less
Submitted 7 October, 2021;
originally announced October 2021.
-
Finding well-optimized special quasirandom structures with decision diagram
Authors:
Kohei Shinohara,
Atsuto Seko,
Takashi Horiyama,
Isao Tanaka
Abstract:
The advanced data structure of the zero-suppressed binary decision diagram (ZDD) enables us to efficiently enumerate nonequivalent substitutional structures. Not only can the ZDD store a vast number of structures in a compressed manner, but also can a set of structures satisfying given constraints be extracted from the ZDD efficiently. Here, we present a ZDD-based efficient algorithm for exhaustiv…
▽ More
The advanced data structure of the zero-suppressed binary decision diagram (ZDD) enables us to efficiently enumerate nonequivalent substitutional structures. Not only can the ZDD store a vast number of structures in a compressed manner, but also can a set of structures satisfying given constraints be extracted from the ZDD efficiently. Here, we present a ZDD-based efficient algorithm for exhaustively searching for special quasirandom structures (SQSs) that mimic the perfectly random substitutional structure. We demonstrate that the current approach can extract only a tiny number of SQSs from a ZDD composed of many substitutional structures (>$10^{12}$). As a result, we find SQSs that are optimized better than those proposed in the literature. A series of SQSs should be helpful for estimating the properties of substitutional solid solutions. Furthermore, the present ZDD-based algorithm should be useful for applying the ZDD to the other structure enumeration problems.
△ Less
Submitted 29 November, 2021; v1 submitted 15 July, 2021;
originally announced July 2021.
-
Efficient Folding Algorithms for Regular Polyhedra
Authors:
Tonan Kamata,
Akira Kadoguchi,
Takashi Horiyama,
Ryuhei Uehara
Abstract:
We investigate the folding problem that asks if a polygon P can be folded to a polyhedron Q for given P and Q. Recently, an efficient algorithm for this problem has been developed when Q is a box. We extend this idea to regular polyhedra, also known as Platonic solids. The basic idea of our algorithms is common, which is called stam**. However, the computational complexities of them are differen…
▽ More
We investigate the folding problem that asks if a polygon P can be folded to a polyhedron Q for given P and Q. Recently, an efficient algorithm for this problem has been developed when Q is a box. We extend this idea to regular polyhedra, also known as Platonic solids. The basic idea of our algorithms is common, which is called stam**. However, the computational complexities of them are different depending on their geometric properties. We developed four algorithms for the problem as follows. (1) An algorithm for a regular tetrahedron, which can be extended to a tetramonohedron. (2) An algorithm for a regular hexahedron (or a cube), which is much efficient than the previously known one. (3) An algorithm for a general deltahedron, which contains the cases that Q is a regular octahedron or a regular icosahedron. (4) An algorithm for a regular dodecahedron. Combining these algorithms, we can conclude that the folding problem can be solved pseudo-polynomial time when Q is a regular polyhedron and other related solid.
△ Less
Submitted 29 May, 2021;
originally announced May 2021.
-
Efficient Segment Folding is Hard
Authors:
Takashi Horiyama,
Fabian Klute,
Matias Korman,
Irene Parada,
Ryuhei Uehara,
Katsuhisa Yamanaka
Abstract:
We introduce a computational origami problem which we call the segment folding problem: given a set of $n$ line-segments in the plane the aim is to make creases along all segments in the minimum number of folding steps. Note that a folding might alter the relative position between the segments, and a segment could split into two. We show that it is NP-hard to determine whether $n$ line segments ca…
▽ More
We introduce a computational origami problem which we call the segment folding problem: given a set of $n$ line-segments in the plane the aim is to make creases along all segments in the minimum number of folding steps. Note that a folding might alter the relative position between the segments, and a segment could split into two. We show that it is NP-hard to determine whether $n$ line segments can be folded in $n$ simple folding operations.
△ Less
Submitted 14 January, 2022; v1 submitted 20 December, 2020;
originally announced December 2020.
-
Longest Common Subsequence in Sublinear Space
Authors:
Masashi Kiyomi,
Takashi Horiyama,
Yota Otachi
Abstract:
We present the first $\mathrm{o}(n)$-space polynomial-time algorithm for computing the length of a longest common subsequence. Given two strings of length $n$, the algorithm runs in $\mathrm{O}(n^{3})$ time with $\mathrm{O}\left(\frac{n \log^{1.5} n}{2^{\sqrt{\log n}}}\right)$ bits of space.
We present the first $\mathrm{o}(n)$-space polynomial-time algorithm for computing the length of a longest common subsequence. Given two strings of length $n$, the algorithm runs in $\mathrm{O}(n^{3})$ time with $\mathrm{O}\left(\frac{n \log^{1.5} n}{2^{\sqrt{\log n}}}\right)$ bits of space.
△ Less
Submitted 17 September, 2020;
originally announced September 2020.
-
Derivative structure enumeration using binary decision diagram
Authors:
Kohei Shinohara,
Atsuto Seko,
Takashi Horiyama,
Masakazu Ishihata,
Junya Honda,
Isao Tanaka
Abstract:
A derivative structure is a nonequivalent substitutional atomic configuration derived from a given primitive cell. The enumeration of derivative structures plays an essential role in searching for the ground states in multicomponent systems. However, it is computationally hard to enumerate derivative structures if the number of derivative structures of a target system becomes huge. In the present…
▽ More
A derivative structure is a nonequivalent substitutional atomic configuration derived from a given primitive cell. The enumeration of derivative structures plays an essential role in searching for the ground states in multicomponent systems. However, it is computationally hard to enumerate derivative structures if the number of derivative structures of a target system becomes huge. In the present study, we introduce a novel compact data structure of the zero-suppressed binary decision diagram (ZDD) to enumerate derivative structures much more efficiently. The present study shows its simple applications to the enumeration of structures derived from the face-centered cubic and hexagonal close-packed lattices in binary, ternary, and quaternary systems. The present ZDD-based procedure should significantly contribute not only to various computational approaches based on the derivative structures but also to a wide range of combinatorial issues in physics and materials science.
△ Less
Submitted 13 July, 2020; v1 submitted 28 February, 2020;
originally announced February 2020.
-
Compiling Crossing-free Geometric Graphs with Connectivity Constraint for Fast Enumeration, Random Sampling, and Optimization
Authors:
Yu Nakahata,
Takashi Horiyama,
Shin-ichi Minato,
Katsuhisa Yamanaka
Abstract:
Given $n$ points in the plane, we propose algorithms to compile connected crossing-free geometric graphs into directed acyclic graphs (DAGs). The DAGs allow efficient counting, enumeration, random sampling, and optimization. Our algorithms rely on Wettstein's framework to compile several crossing-free geometric graphs. One of the remarkable contributions of Wettstein is to allow dealing with geome…
▽ More
Given $n$ points in the plane, we propose algorithms to compile connected crossing-free geometric graphs into directed acyclic graphs (DAGs). The DAGs allow efficient counting, enumeration, random sampling, and optimization. Our algorithms rely on Wettstein's framework to compile several crossing-free geometric graphs. One of the remarkable contributions of Wettstein is to allow dealing with geometric graphs with connectivity, since it is known to be difficult to efficiently represent geometric graphs with such global property. To achieve this, Wettstein proposed specialized techniques for crossing-free spanning trees and crossing-free spanning cycles and invented compiling algorithms running in $\mathrm{O}(7.044^n)$ time and $\mathrm{O}(5.619^n)$ time, respectively.
Our first contribution is to propose a technique to deal with the connectivity constraint more simply and efficiently. It makes the design and analysis of algorithms easier, and yields improved time complexity. Our algorithms achieve $\mathrm{O}(6^n)$ time and $\mathrm{O}(4^n)$ time for compiling crossing-free spanning trees and crossing-free spanning cycles, respectively. As the second contribution, we propose an algorithm to optimize the area surrounded by crossing-free spanning cycles. To achieve this, we modify the DAG so that it has additional information. Our algorithm runs in $\mathrm{O}(4.829^n)$ time to find an area-minimized (or maximized) crossing-free spanning cycle of a given point set. Although the problem was shown to be NP-complete in 2000, as far as we know, there were no known algorithms faster than the obvious $\mathrm{O}(n!)$ time algorithm for 20 years.
△ Less
Submitted 24 January, 2020;
originally announced January 2020.
-
Geodesic Folding of Tetrahedron
Authors:
Seri Nishimoto,
Takashi Horiyama,
Tomohiro Tachi
Abstract:
In this work, we show the geometric properties of a family of polyhedra obtained by folding a regular tetrahedron along regular triangular grids. Each polyhedron is identified by a pair of nonnegative integers. The polyhedron can be cut along a geodesic strip of triangles to be decomposed and unfolded into one or multiple bands (homeomorphic to a cylinder). The number of bands is the greatest comm…
▽ More
In this work, we show the geometric properties of a family of polyhedra obtained by folding a regular tetrahedron along regular triangular grids. Each polyhedron is identified by a pair of nonnegative integers. The polyhedron can be cut along a geodesic strip of triangles to be decomposed and unfolded into one or multiple bands (homeomorphic to a cylinder). The number of bands is the greatest common divisor of the two numbers. By a proper choice of pairs of numbers, we can create a common triangular band that folds into different multiple polyhedra that belongs to the family.
△ Less
Submitted 3 December, 2019;
originally announced December 2019.
-
Implicit Enumeration of Topological-Minor-Embeddings and Its Application to Planar Subgraph Enumeration
Authors:
Yu Nakahata,
Jun Kawahara,
Takashi Horiyama,
Shin-ichi Minato
Abstract:
Given graphs $G$ and $H$, we propose a method to implicitly enumerate topological-minor-embeddings of $H$ in $G$ using decision diagrams. We show a useful application of our method to enumerating subgraphs characterized by forbidden topological minors, that is, planar, outerplanar, series-parallel, and cactus subgraphs. Computational experiments show that our method can find all planar subgraphs i…
▽ More
Given graphs $G$ and $H$, we propose a method to implicitly enumerate topological-minor-embeddings of $H$ in $G$ using decision diagrams. We show a useful application of our method to enumerating subgraphs characterized by forbidden topological minors, that is, planar, outerplanar, series-parallel, and cactus subgraphs. Computational experiments show that our method can find all planar subgraphs in a given graph at most five orders of magnitude faster than a naive backtracking-based method.
△ Less
Submitted 18 November, 2019;
originally announced November 2019.
-
Decomposing a Graph into Unigraphs
Authors:
Takashi Horiyama,
Jun Kawahara,
Shin-ichi Minato,
Yu Nakahata
Abstract:
Unigraphs are graphs uniquely determined by their own degree sequence up to isomorphism. There are many subclasses of unigraphs such as threshold graphs, split matrogenic graphs, matroidal graphs, and matrogenic graphs. Unigraphs and these subclasses are well studied in the literature. Nevertheless, there are few results on superclasses of unigraphs. In this paper, we introduce two types of genera…
▽ More
Unigraphs are graphs uniquely determined by their own degree sequence up to isomorphism. There are many subclasses of unigraphs such as threshold graphs, split matrogenic graphs, matroidal graphs, and matrogenic graphs. Unigraphs and these subclasses are well studied in the literature. Nevertheless, there are few results on superclasses of unigraphs. In this paper, we introduce two types of generalizations of unigraphs: $k$-unigraphs and $k$-strong unigraphs. We say that a graph $G$ is a $k$-unigraph if $G$ can be partitioned into $k$ unigraphs. $G$ is a $k$-strong unigraph if not only each subgraph is a unigraph but also the whole graph can be uniquely determined up to isomorphism, by using the degree sequences of all the subgraphs in the partition. We describe a relation between $k$-strong unigraphs and the subgraph isomorphism problem. We show some properties of $k$-(strong) unigraphs and algorithmic results on calculating the minimum $k$ such that a graph $G$ is a $k$-(strong) unigraph. This paper will open many other research topics.
△ Less
Submitted 20 April, 2019;
originally announced April 2019.
-
Rigid Foldability is NP-Hard
Authors:
Hugo Akitaya,
Erik D. Demaine,
Takashi Horiyama,
Thomas C. Hull,
Jason S. Ku,
Tomohiro Tachi
Abstract:
In this paper, we show that deciding rigid foldability of a given crease pattern using all creases is weakly NP-hard by a reduction from Partition, and that deciding rigid foldability with optional creases is strongly NP-hard by a reduction from 1-in-3 SAT. Unlike flat foldability of origami or flexibility of other kinematic linkages, whose complexity originates in the complexity of the layer orde…
▽ More
In this paper, we show that deciding rigid foldability of a given crease pattern using all creases is weakly NP-hard by a reduction from Partition, and that deciding rigid foldability with optional creases is strongly NP-hard by a reduction from 1-in-3 SAT. Unlike flat foldability of origami or flexibility of other kinematic linkages, whose complexity originates in the complexity of the layer ordering and possible self-intersection of the material, rigid foldability from a planar state is hard even though there is no potential self-intersection. In fact, the complexity comes from the combinatorial behavior of the different possible rigid folding configurations at each vertex. The results underpin the fact that it is harder to fold from an unfolded sheet of paper than to unfold a folded state back to a plane, frequently encountered problem when realizing folding-based systems such as self-folding matter and reconfigurable robots.
△ Less
Submitted 3 December, 2018;
originally announced December 2018.
-
Enumerating Cryptarithms Using Deterministic Finite Automata
Authors:
Yuki Nozaki,
Diptarama Hendrian,
Ryo Yoshinaka,
Takashi Horiyama,
Ayumi Shinohara
Abstract:
A cryptarithm is a mathematical puzzle where given an arithmetic equation written with letters rather than numerals, a player must discover an assignment of numerals on letters that makes the equation hold true. In this paper, we propose a method to construct a DFA that accepts cryptarithms that admit (unique) solutions for each base. We implemented the method and constructed a DFA for bases…
▽ More
A cryptarithm is a mathematical puzzle where given an arithmetic equation written with letters rather than numerals, a player must discover an assignment of numerals on letters that makes the equation hold true. In this paper, we propose a method to construct a DFA that accepts cryptarithms that admit (unique) solutions for each base. We implemented the method and constructed a DFA for bases $k \le 7$. Those DFAs can be used as complete catalogues of cryptarithms,whose applications include enumeration of and counting the exact numbers $G_k(n)$ of cryptarithm instances with $n$ digits that admit base-$k$ solutions. Moreover, explicit formulas for $G_2(n)$ and $G_3(n)$ are given.
△ Less
Submitted 26 July, 2018;
originally announced July 2018.
-
Swap** Colored Tokens on Graphs
Authors:
Katsuhisa Yamanaka,
Takashi Horiyama,
J. Mark Keil,
David Kirkpatrick,
Yota Otachi,
Toshiki Saitoh,
Ryuhei Uehara,
Yushi Uno
Abstract:
We investigate the computational complexity of the following problem. We are given a graph in which each vertex has an initial and a target color. Each pair of adjacent vertices can swap their current colors. Our goal is to perform the minimum number of swaps so that the current and target colors agree at each vertex. When the colors are chosen from {1,2,...,c}, we call this problem c-Colored Toke…
▽ More
We investigate the computational complexity of the following problem. We are given a graph in which each vertex has an initial and a target color. Each pair of adjacent vertices can swap their current colors. Our goal is to perform the minimum number of swaps so that the current and target colors agree at each vertex. When the colors are chosen from {1,2,...,c}, we call this problem c-Colored Token Swap** since the current color of a vertex can be seen as a colored token placed on the vertex. We show that c-Colored Token Swap** is NP-complete for c = 3 even if input graphs are restricted to connected planar bipartite graphs of maximum degree 3. We then show that 2-Colored Token Swap** can be solved in polynomial time for general graphs and in linear time for trees. Besides, we show that, the problem for complete graphs is fixed-parameter tractable when parameterized by the number of colors, while it is known to be NP-complete when the number of colors is unbounded.
△ Less
Submitted 19 March, 2018;
originally announced March 2018.