http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927

The problems of finding a longest common subsequence of two sequences A and B and a shortest edit script for transforming A into B have long been known to be dual problems. In this paper, they are shown to be equivalent to finding a shortest/longest path in an edit graph. Using this perspective, a simple O(ND) time and space algorithm is developed where N is the sum of the lengths of A and B and D is the size of the minimum edit script for A and B. The algorithm performs well when differences are small (sequences are similar) and is consequently fast in typical applications. The algorithm is shown to have O(N +D expected-time performance under a basic stochastic model. A refinement of the algorithm requires only O(N) space, and the use of suffix trees leads to an O(NlgN +D ) time variation.

Myers1986AnONDDifferenceAlgorithm.pdf http://se-pubs.dbs.uni-leipzig.de/files/Myers1986AnONDDifferenceAlgorithm.pdf

An O(ND) Difference Algorithm and Its Variations∗ EUGENE W. MYERS Department of Computer Science, University of Arizona, Tucson, AZ 85721, U.S.A. ABSTRACT The problems of finding a longest common subsequence of two sequences A and B and a shortest edit script for transforming A into B have long been known to be dual problems. In this paper, they are shown to be equivalent to finding a shortest/longest path in an edit graph. Using this perspective, a simple O(ND) time and space algorithm is developed where N is the sum of the lengths of A and B and D is the size of the minimum edit script for A and B. The algorithm performs well when differences are small (sequences are similar) and is consequently fast in typical applications. The algorithm is shown to have O(N + D 2 ) expected-time performance under a basic stochastic model. A refinement of the algorithm requires only O(N) space, and the use of suffix trees leads to an O(NlgN + D 2 ) time variation.

An O(ND) Difference Algorithm and Its Variations (1986)的更多相关文章

  1. Falcon Genome Assembly Tool Kit Manual

    Falcon Falcon: a set of tools for fast aligning long reads for consensus and assembly The Falcon too ...

  2. 动态规划处理diff算法 Myers Diff (正向)

    Eugene W. Myers 在他1986年发表于"Algorithmica"的论文"An O(ND) Difference Algorithm and Its Var ...

  3. 【原创】Google的文本内容对比代码

    /* * Diff Match and Patch * * Copyright 2006 Google Inc. * http://code.google.com/p/google-diff-matc ...

  4. Myers差分算法的理解、实现、可视化

    作者:Oto_G QQ: 421739728 目录 简介 基础 差异的描述 好的差异比较 算法介绍 名词解释 两个定理 绘制编辑图 感谢 简介 本文章对Myers差分算法(Myers Diff Alg ...

  5. Android DiffUtil

    Android 的recyclerview-v7:24.2.0 发布后多了个DiffUtil工具类,这个工具类能够大大解放了Android开发者的一个苦恼:RecyclerView局部刷新和重新刷新时 ...

  6. linux timing profile

    double getUnixTime(void) { struct timespec tv; ) ; return (((double) tv.tv_sec) + (double) (tv.tv_ns ...

  7. 【翻译】理解 LSTM 及其图示

    目录 理解 LSTM 及其图示 本文翻译自 Shi Yan 的博文 Understanding LSTM and its diagrams,原文阐释了作者对 Christopher Olah 博文 U ...

  8. Leetcode 446.等差数列划分II 子序列

    等差数列划分II 子序列 如果一个数列至少有三个元素,并且任意两个相邻元素之差相同,则称该数列为等差数列. 例如,以下数列为等差数列: 1, 3, 5, 7, 9 7, 7, 7, 7 3, -1, ...

  9. Code Project精彩系列(转)

    Code Project精彩系列(转)   Code Project精彩系列(转)   Applications Crafting a C# forms Editor From scratch htt ...

随机推荐

  1. ASP.NET上传大文件404报错

    报错信息: Failed to load resource: the server responded with a status of 404 (Not Found) 尝试1: 仅修改Web.con ...

  2. ajax dome案例

    一.首先HTML页面 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...

  3. JSPatch安全部署

    前言 这个事JSPatch集成到客户端的第二篇,第一篇链接:http://www.cnblogs.com/hxwj/p/5163158.html 安全部署链接:http://blog.cnbang.n ...

  4. bzoj3743 [Coci2015]Kamp 常州模拟赛d6t2

    3743: [Coci2015]Kamp Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 484  Solved: 229[Submit][Status ...

  5. 【CCF】交通规划 Dijstra变形 优先级队列重载

    [题意] 给定一个无向图,求这个图满足所有点到顶点的最短路径不变的最小生成树 [AC] 注意双向边要开2*maxm 注意优先级队列 参考https://www.cnblogs.com/cielosun ...

  6. PHP文件上传类(页面和调用部分)

    <!--upform.html内容--> <form action="upload.php" method="post" enctype=&q ...

  7. Centos 安装Python3的方法

    由于centos7原本就安装了Python2,而且这个Python2不能被删除,因为有很多系统命令,比如yum都要用到. [root@VM_105_217_centos Python-3.6.2]# ...

  8. uva 1426 离散平方根

    1426 - Discrete Square Roots Time limit: 3.000 seconds A square root of a number x <tex2html_verb ...

  9. [转发]Android 系统稳定性 - ANR(三)

    文章都为原创,转载请注明出处,未经允许而盗用者追究法律责任. 很久之前写的了,留着有点浪费,共享之. 编写者:李文栋 http://rayleeya.iteye.com/blog/1956056 1. ...

  10. Day 1 计算机基础

    计算机基础 一.为什么学习计算机基础? 编程语言的作用:人类使机器明白并动作的指令.类似:人文社会的英语.   关系:计算机硬件 —— 操作系统(OS) —— 软件(编程语言成品,学习成果). 自语: ...