The Smallest Upravel
暂无分享,去创建一个
An unravel of a sequence x is a bag of nonempty subsequences of x that when shuffled together can give back x. For example, the sequence “accompany” can be unravelled into three lists “acm”, “an”, and “copy”. The order of these lists is not important but duplications do matter; for example, “peptet” can be unravelled into two copies of “pet”. Thus, an unravel is essentially a bag of sequences and not a list or set. An unravel is called an upravel if all its component sequences are ascending. Since each of “acm”, “an”, and “copy” are ascending, they give an upravel of “accompany”. Each nonempty sequence has at least one upravel, namely the upravel consisting of just singleton sequences. However, of all possible upravels we want to determine one with the least number of elements. The problem of the smallest upravel is one of the most instructive and challenging problems I have ever come across. Indeed, it has been responsible for an important piece of new theory in the derivation of solutions to optimisation problems (namely, Theorem 3 below). The problem was first posed by Lambert Meertens in September 1984, at a meeting of WG2.1 at Pont a Mousson, France (see [5]). Subsequently, Kaldewaij [4] published a quite different solution. Kaldewaij’s solution was based on a constructive proof of a specialisation of Dilworth’s Theorem: the size of a smallest upravel of x is equal to the length of the longest decreasing subsequence of x. This fact can be combined with a well-known algorithm for finding the length of a longest decreasing subsequence in O(n log n) steps to produce an algorithm for the smallest upravel with the same time complexity. Although Kaldewaij’s method is a model of mathematical elegance and brevity ([4] consists of a single page), it is somewhat unsatisfactory from the perspective of a computing scientist interested in the principles of systematic algorithm design. The key notion, that of a longest decreasing sequence, is pulled out of a hat (the technical term is “rabbit”). Our purpose here is to consider more direct approaches
[1] Richard S. Bird,et al. An introduction to the theory of lists , 1987 .
[2] Richard S. Bird,et al. A calculus of functions for program derivation , 1990 .
[3] Richard S. Bird,et al. Lectures on Constructive Functional Programming , 1989 .
[4] Anne Kaldewaij. On the Decomposition of Sequences into Ascending Subsequences , 1985, Inf. Process. Lett..