首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 281 毫秒
1.
最长公共子序列问题的改进快速算法   总被引:1,自引:0,他引:1  
现在几个最常用的解决最长公共子序列(LCS)问题的算法的时间复杂度分别是O(pn),O(n(m-p)).这里m、n为两个待比较字符串的长度,p是最长公共子串的长度.给出一种时间复杂度为O(p(m-p)),空间复杂度为O(m+n)的算法.与以前的算法相比,不管在p<相似文献   

2.
孙焘  朱晓明 《计算机科学》2017,44(2):270-274
多条序列的最长公共子序列可以代表多条序列的公共信息,其在诸多领域里有着重要的应用,如信息检索、基因序列匹配等。求解多条序列的最长公共子序列是著名的NP难问题,本质为多解问题。一些近似算法虽然时间复杂度较低,但只能求出单解,对于有多解的序列集合,求得的结果信息量损失较大。因此提出一个新的近似算法来解决最长公共子序列问题。算法引入了代数结构“格”,通过动态规划求解出两条序列的公共格,并递归求解当前格与当前序列的公共格。公共格中的路径保存了多条公共子序列使得最终求解出的最长公共子序列为多个。对算法的相关定理给出了理论证明,并通过实验验证了算法的正确性。  相似文献   

3.
最长公共子充列问题的改进快速算法   总被引:1,自引:0,他引:1  
现在几个最常用的解决最长公共子序列(LCS)问题的算法的时间复杂度分别是O(pn),O(n(mp))。这里M、n为两个待比较字符串的长度,P是最长公共子串的长度。给出一种时间复杂度为O(p(mp)),空间复杂度为O(m+n)的算法。与以前的算法相比,不管在P〈〈m的情况下,还是在P接近M时,这种算法都有更快的速度。  相似文献   

4.
《软件》2019,(7):31-34
本文采用分治策略和动态规划策略探讨了最长递增子序列问题的两种解法,并分析了算法的计算复杂度。结果表明,本文算法的时间复杂度和空间复杂度分别为O(nlogn)和O(n)。  相似文献   

5.
探讨了生物信息挖掘中ó模式子序列问题的一个特例,即最长递增子序列(LIS)问题。对于LIS问题,分别用LCS算法、动态规划、动态规划结合二分法进行求解,并分析了这三种算法的时间和空间复杂度,对其中两种算法进行了实现,验证了时间和空间复杂性理论分析的正确性,最后得出了一种高效的LIS算法。  相似文献   

6.
郑子君 《计算机应用研究》2020,37(11):3334-3337,3358
最长循环公共子序列(LCCS)是两个字符串在所有可能的循环移位操作下能得到的最长公共子序列(LCS)。针对穷举移位量求解LCCS效率过低的问题,设法对候选移位量进行筛选。通过证明循环移位操作对两字符串间LCS长度增量影响的上下限,得到最优移位量的必要条件,从而减小了求解LCCS的枚举量;在此基础上,建立了求解LCCS的迭代方法,只经过少数几次迭代便可消除绝大部分无效候选移位量;此外,还提出一个可在◢O(mn)◣时间复杂度下快速估算LCCS长度的近似算法。大量随机模拟表明,当两字符串间的相似度明显高于随机字符串的相似度时,提出的两种算法表现良好。  相似文献   

7.
LCS即最长公共子串,例如给定两个序列,A={abcbdab},B={bdcaba},那么序列{bcba}就是它们的最长公共子串。当然这样的子串不一定唯一,比如{bcab}也是,只要找到其中一个即可。这个问题已经研究得很深入,一般是用动态规划法求解,时间复杂度为O(MN),即两个序列长度的乘积。很多算法书都有介绍,是根据状态转移方程求解。但  相似文献   

8.
张毅超  车玫  马骏 《计算机仿真》2007,24(12):97-100,116
高效求解2个字符串的最长公共子串(Longest Common Substring)是实现很多字符串算法的关键.文中首先给出了求解LCP问题的动态规划算法,广义后缀树算法,研究并分析了这两种算法,得出动态规划算法易于理解,但时间复杂度较高;广义后缀树算法的时间复杂度较低,但实现较为复杂并且广义后缀树占用的空间也较多.最后提出了一个新算法,该算法使用2个字符串的广义后缀数组,在保持和广义后缀树时间复杂度相等的基础上,可以简单地实现并且占用较少的空间.  相似文献   

9.
寻找两个序列X、Y的差异内容,产生Y相对X的差异信息Z,使得X能够根据Z变化为Y。如果X、Y是同一种文件的不同版本,Z往往比Y小得多,这样存储或传送Z将比直接存储或传送Y更节约资源。提出一种基于序列结构因素的启发式算法,对两个序列进行划分,再进行相同内容的匹配。算法时间复杂度为O((n+m)log(min(n,m))),空间复杂度为O(n+m),其中n、m分别为X、Y的长度。在实际应用中该算法的执行速度是接近线性的。  相似文献   

10.
针对传统的生物计算中DNA序列保守序列的识别(模体识别)和最长公共子序列计算需要较大的数据量、计算量,以及功耗大等问题,文中提出了两种基于PAAG多态并行处理器的并行算法,该并行处理器能够支持数据、线程、指令多种并行。通过编程在PAAG多态并行处理的处理单元( PE)上开发了相应的串行和并行程序,将计算的不同过程分派到不同的处理单元( PE)上进行处理,实现了不同粒度算法的并行。实验结果表明,文中提出的并行算法使模体识别和最长公共子序列的计算效率得到明显提高。  相似文献   

11.
This paper presents a new practical bit-vector algorithm for solving the well-known Longest Common Subsequence (LCS) problem. Given two strings of length m and n, nm, we present an algorithm which determines the length p of an LCS in O(nm/w) time and O(m/w) space, where w is the number of bits in a machine word. This algorithm can be thought of as column-wise “parallelization” of the classical dynamic programming approach. Our algorithm is very efficient in practice, where computing the length of an LCS of two strings can be done in linear time and constant (additional/working) space by assuming that mw.  相似文献   

12.
Given two strings A and B of lengths na and nb, respectively, the All-substrings Longest Common Subsequence (ALCS) problem obtains, for any substring B' of B, the length of the longest string that is a subsequence of both A and B'. The sequential algorithm for this problem takes O(na nb) time and O(nb) space. We present a parallel algorithm for the ALCS problem on the Coarse-Grained Multicomputer (BSP/CGM) model with p < √na processors, that takes O(na nb/p) time, O(log p) communication rounds and O(nb √na) space per processor. The proposed algorithm also solves the basic Longest Common Subsequence (LCS) problem that finds the longest string (and not only its length) that is a subsequence of both A and B. To our knowledge, this is the best BSP/CGM algorithm in the literature for the LCS and ALCS problems.  相似文献   

13.
为视频序列匹配提出一个高效精确的最大公共子序列(Efficient and Effective Longest Common Subsequence,EELCS)算法。首先,利用矢量量化(Vector Quantization,VQ)将多维最大公共子序列算法(Multi-dimensional LCS,MLCS)中元素对匹配过程中的实际距离的计算简化成比较操作,较原始的最大公共子序列匹配算法(Original LCS,OLCS),该处理不仅可以继承MLCS的可应用到实际多维时序匹配问题中的优点,同时大大降低了匹配的复杂度;然后进一步区分待匹配序列中由于匹配子序列和未匹配子序列在时间轴上连续性而产生的差异;最后将该算法应用到视频片段的匹配中。实验结果表明,与具有代表性的基于时间规扭曲的最大公共子序列(Time-Warped LCS,T-WLCS)和连续最大公共子序列(Continuous LCS,CLCS)相比,该算法能较好地应用于视频序列的匹配。  相似文献   

14.
An efficient algorithm is presented that solves a generalization of the Longest Common Subsequence problem, in which both of the input strings consists of sets of symbols which may be permuted.  相似文献   

15.
An efficient algorithm is presented that solves a generalization of the Longest Common Subsequence problem, in which one of the two input strings contains sets of symbols which may be permuted. This problem arises from a music application.  相似文献   

16.
An efficient algorithm is presented that solves a generalization of the Longest Common Subsequence problem, in which one of the two input strings contains sets of symbols which may be permuted. This problem arises from a music application.  相似文献   

17.
The Longest Common Subsequence problem seeks a longest subsequence of every member of a given set of strings. It has applications, among others, in data compression, FPGA circuit minimization, and bioinformatics. The problem is NP-hard for more than two input strings, and the existing exact solutions are impractical for large input sizes. Therefore, several approximation and (meta) heuristic algorithms have been proposed which aim at finding good, but not necessarily optimal, solutions to the problem. In this paper, we propose a new algorithm based on the constructive beam search method. We have devised a novel heuristic, inspired by the probability theory, intended for domains where the input strings are assumed to be independent. Special data structures and dynamic programming methods are developed to reduce the time complexity of the algorithm. The proposed algorithm is compared with the state-of-the-art over several standard benchmarks including random and real biological sequences. Extensive experimental results show that the proposed algorithm outperforms the state-of-the-art by giving higher quality solutions with less computation time for most of the experimental cases.  相似文献   

18.
An efficient algorithm is presented that solves a generalization of the Longest Common Subsequence problem, in which both of the input strings consists of sets of symbols which may be permuted.  相似文献   

19.
Longest common subsequence is a widely used measure to compare strings, in particular in computational biology. Recently, several variants of the longest common subsequence have been introduced to tackle the comparison of genomes. In particular, the Repetition Free Longest Common Subsequence (RFLCS) problem is a variant of the LCS problem that asks for a longest common subsequence of two input strings with no repetition of symbols. In this paper, we investigate the parameterized complexity of RFLCS. First, we show that the problem does not admit a polynomial kernel. Then, we present a randomized FPT algorithm for the RFLCS problem, improving the time complexity of the existent FPT algorithm.  相似文献   

20.
提出一种基于句子相似度的论文抄袭检测模型。利用局部词频指纹算法对大规模文档进行快速检测,找出疑似抄袭文档。根据最长有序公共子序列算法计算句子间的相似度,并标注抄袭细节,给出抄袭依据。在标准中文数据集SOGOU-T上进行的实验表明,该模型具有较强的局部信息挖掘能力,在一定程度上克服了现有的论文抄袭检测算法精度不高的缺点。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号