Various forms of sorting problems have been studied over the years. Recently, two kinds of sorting puzzle apps are popularized. In these puzzles, we are given a set of bins filled with colored units, balls or water, and some empty bins. These puzzles allow us to move colored units from a bin to another when the colors involved match in some way or the target bin is empty. The goal of these puzzles is to sort all the color units in order. We investigate computational complexities of these puzzles. We first show that these two puzzles are essentially the same from the viewpoint of solvability. That is, an instance is sortable by ball-moves if and only if it is sortable by water-moves. We also show that every yes-instance has a solution of polynomial length, which implies that these puzzles belong to in NP. We then show that these puzzles are NP-complete. For some special cases, we give polynomial-time algorithms. We finally consider the number of empty bins sufficient for making all instances solvable and give non-trivial upper and lower bounds in terms of the number of filled bins and the capacity of bins.
翻译:多年来已经研究过多种分类问题 。 最近, 两种排序谜题应用程序被普及了 。 在这些谜题中, 我们得到了一组包含有色单位、 球或水的垃圾箱, 以及一些空的垃圾箱。 这些谜题允许我们将彩色单位从一个垃圾箱移到另一个文件箱, 当所涉及的颜色以某种方式匹配或目标箱是空的。 这些谜题的目标是按照顺序排序所有的颜色单位。 我们对这些谜题的计算复杂性进行调查 。 我们首先从溶解的角度来显示这两个谜题实质上是相同的 。 也就是说, 一个实例可以由球移动来排序, 只有当它可以通过水移动来排序 。 我们还显示, 每一个有色单位都有多元长度的解决方案。 这意味着这些谜题属于 NP 。 我们然后显示这些谜题是 NP 完整的 。 对于某些特殊的情况, 我们给出了 IPnomilal- time 算法 。 我们最后考虑的是, 空箱的数量足够了, 来制作所有可溶性、 且不具有硬性、 上和 硬的硬和上的硬质的硬质数。