Let us call a sequence of numbers heapable if they can be sequentially inserted to form a binary tree with the heap property, where each insertion subsequent to the first occurs at a leaf of the tree, i.e. below a previously placed number. In this paper we consider a variety of problems related to heapable sequences and subsequences that do not appear to have been studied previously. Our motivation for introducing these concepts is two-fold. First, such problems correspond to natural extensions of the well-known secretary problem for hiring an organization with a hierarchical structure. Second, from a purely combinatorial perspective, our problems are interesting variations on similar longest increasing subsequence problems, a problem paradigm that has led to many deep mathematical connections.
We provide several basic results. We obtain an efficient algorithm for determining the heapability of a sequence, and also prove that the question of whether a sequence can be arranged in a complete binary heap is NP-hard. Regarding subsequences we show that, with high probability, the longest heapable subsequence of a random permutation of n numbers has length (1 - o(1)) n, and a subsequence of length (1 - o(1)) n can in fact be found online with high probability. We similarly show that for a random permutation a subsequence that yields a complete heap of size αn for a constant αcan be found with high probability. Our work highlights the interesting structure underlying this class of subsequence problems, and we leave many further interesting variations open for future work.
Polynomial-Time Solutions for Longest Common Subsequence Related Problems Between a Sequence and a Pangenome Graph
College of Big Data Statistics, Guizhou University of Finance and Economics(贵州财经大学大数据统计学院);Algorithm and Computational Complexity Laboratory of School of Information, Guizhou University of Finance and Economics(贵州财经大学信息学院算法与计算复杂性实验室)
Analysis of the Relationships among Longest Common Subsequences, Shortest Common Supersequences and Patterns and its application on Pattern Discovery in Biological Sequences
对于一组多重序列,它们的模式,最长共同子序列(LCS)和最短共同超序列(SCS)代表了这些序列图谱的不同方面,它们都可以用于生物序列的比较和分析。揭示模式和LCS之间的关系,SCS可能会为我们提供一个更深层次的生物序列的模式,反过来导致更好地理解他们。然而,关于模式、语言控制系统和认知系统之间的关系还没有仔细的研究。本文分析了它们之间的关系,并给出了一些引理。基于它们之间的关系,提出了一组发现生物序列模式的算法,称为PALS(PAttering by Lcs and Scs)算法。这些算法首先通过启发式算法产生序列的LCS和SCS的结果,然后从这些结果中得到模式。实验表明,PALS算法在各种序列上都有很好的性能(效率和准确性)。PALS方法还为SCS和LCS的启发式结果之间的转换提供了解决方案。