CINXE.COM
Edit distance - Wikipedia
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-sticky-header-enabled vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Edit distance - Wikipedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-sticky-header-enabled vector-toc-available";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy", "wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"cabe2446-8fe1-4788-ae2c-703bd5bda912","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Edit_distance","wgTitle":"Edit distance","wgCurRevisionId":1259445915,"wgRevisionId":1259445915,"wgArticleId":406427,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles with short description","Short description is different from Wikidata","String metrics"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Edit_distance","wgRelevantArticleId":406427,"wgIsProbablyEditable":true,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}}, "wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":20000,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q5338467","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness","fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready" ,"user.options":"loading","ext.cite.styles":"ready","ext.math.styles":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","jquery.makeCollapsible.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["ext.cite.ux-enhancements","site","mediawiki.page.ready","jquery.makeCollapsible","mediawiki.toc","skins.vector.js","ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.ReferenceTooltips","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022", "ext.checkUser.clientHints","ext.growthExperiments.SuggestedEditSession"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.math.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cext.wikimediamessages.styles%7Cjquery.makeCollapsible.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.16"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Edit distance - Wikipedia"> <meta property="og:type" content="website"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikipedia.org/wiki/Edit_distance"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Edit_distance&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/Edit_distance"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Edit_distance rootpage-Edit_distance skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" title="Main menu" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-contents" class="mw-list-item"><a href="/wiki/Wikipedia:Contents" title="Guides to browsing Wikipedia"><span>Contents</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Current_events" title="Articles related to current events"><span>Current events</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Visit a randomly selected article [x]" accesskey="x"><span>Random article</span></a></li><li id="n-aboutsite" class="mw-list-item"><a href="/wiki/Wikipedia:About" title="Learn about Wikipedia and how it works"><span>About Wikipedia</span></a></li><li id="n-contactpage" class="mw-list-item"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia"><span>Contact us</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Contribute </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia"><span>Help</span></a></li><li id="n-introduction" class="mw-list-item"><a href="/wiki/Help:Introduction" title="Learn how to edit Wikipedia"><span>Learn to edit</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Community_portal" title="The hub for editors"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes to Wikipedia [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_upload_wizard" title="Add images or other media for use on Wikipedia"><span>Upload file</span></a></li><li id="n-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages"><span>Special pages</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Main_Page" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="The Free Encyclopedia" src="/static/images/mobile/copyright/wikipedia-tagline-en.svg" width="117" height="13" style="width: 7.3125em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search Wikipedia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=en.wikipedia.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Edit+distance" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Edit+distance" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Log in and more options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign=en.wikipedia.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Edit+distance" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Edit+distance" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">(Top)</div> </a> </li> <li id="toc-Types_of_edit_distance" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Types_of_edit_distance"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Types of edit distance</span> </div> </a> <ul id="toc-Types_of_edit_distance-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Formal_definition_and_properties" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Formal_definition_and_properties"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Formal definition and properties</span> </div> </a> <button aria-controls="toc-Formal_definition_and_properties-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Formal definition and properties subsection</span> </button> <ul id="toc-Formal_definition_and_properties-sublist" class="vector-toc-list"> <li id="toc-Example" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Example"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Example</span> </div> </a> <ul id="toc-Example-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Properties" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Properties"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Properties</span> </div> </a> <ul id="toc-Properties-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Computation" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Computation"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Computation</span> </div> </a> <button aria-controls="toc-Computation-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Computation subsection</span> </button> <ul id="toc-Computation-sublist" class="vector-toc-list"> <li id="toc-Common_algorithm" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Common_algorithm"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>Common algorithm</span> </div> </a> <ul id="toc-Common_algorithm-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Improved_algorithms" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Improved_algorithms"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>Improved algorithms</span> </div> </a> <ul id="toc-Improved_algorithms-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Applications" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Applications"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Applications</span> </div> </a> <ul id="toc-Applications-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Language_edit_distance" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#Language_edit_distance"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Language edit distance</span> </div> </a> <ul id="toc-Language_edit_distance-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-References" class="vector-toc-list-item vector-toc-level-1 vector-toc-list-item-expanded"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>References</span> </div> </a> <ul id="toc-References-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" title="Table of Contents" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Edit distance</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Go to an article in another language. Available in 3 languages" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-3" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">3 languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-et mw-list-item"><a href="https://et.wikipedia.org/wiki/Teisenduskaugus" title="Teisenduskaugus – Estonian" lang="et" hreflang="et" data-title="Teisenduskaugus" data-language-autonym="Eesti" data-language-local-name="Estonian" class="interlanguage-link-target"><span>Eesti</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Distance_d%27%C3%A9dition_sur_les_arbres" title="Distance d'édition sur les arbres – French" lang="fr" hreflang="fr" data-title="Distance d'édition sur les arbres" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E7%B7%A8%E8%BC%AF%E8%B7%9D%E9%9B%A2" title="編輯距離 – Chinese" lang="zh" hreflang="zh" data-title="編輯距離" data-language-autonym="中文" data-language-local-name="Chinese" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q5338467#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Edit_distance" title="View the content page [c]" accesskey="c"><span>Article</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Talk:Edit_distance" rel="discussion" title="Discuss improvements to the content page [t]" accesskey="t"><span>Talk</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Edit_distance"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Edit_distance&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Edit_distance&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Edit_distance"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Edit_distance&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Edit_distance&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Edit_distance" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Edit_distance" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="//en.wikipedia.org/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Edit_distance&oldid=1259445915" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Edit_distance&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=Edit_distance&id=1259445915&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEdit_distance"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FEdit_distance"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Edit_distance&action=show-download-screen" title="Download this page as a PDF file"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Edit_distance&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q5338467" title="Structured data on this page hosted by Wikidata [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div> </div> <div id="contentSub"><div id="mw-content-subtitle"></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">Computer science metric of string similarity</div> <p>In <a href="/wiki/Computational_linguistics" title="Computational linguistics">computational linguistics</a> and <a href="/wiki/Computer_science" title="Computer science">computer science</a>, <b>edit distance</b> is a <a href="/wiki/String_metric" title="String metric">string metric</a>, i.e. a way of quantifying how dissimilar two <a href="/wiki/String_(computing)" class="mw-redirect" title="String (computing)">strings</a> (e.g., words) are to one another, that is measured by counting the minimum number of operations required to transform one string into the other. Edit distances find applications in <a href="/wiki/Natural_language_processing" title="Natural language processing">natural language processing</a>, where automatic <a href="/wiki/Spell_checker" title="Spell checker">spelling correction</a> can determine candidate corrections for a misspelled word by selecting words from a dictionary that have a low distance to the word in question. In <a href="/wiki/Bioinformatics" title="Bioinformatics">bioinformatics</a>, it can be used to quantify the similarity of <a href="/wiki/DNA" title="DNA">DNA</a> sequences, which can be viewed as strings of the letters A, C, G and T. </p><p>Different definitions of an edit distance use different sets of like operations. <a href="/wiki/Levenshtein_distance" title="Levenshtein distance">Levenshtein distance</a> operations are the removal, insertion, or substitution of a character in the string. Being the most common metric, the term <i>Levenshtein distance</i> is often used interchangeably with <i>edit distance</i>.<sup id="cite_ref-navarnarutoro_1-0" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Types_of_edit_distance">Types of edit distance</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=1" title="Edit section: Types of edit distance"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Different types of edit distance allow different sets of string operations. For instance: </p> <table class="wikitable"> <caption> </caption> <tbody><tr> <th>Algorithm </th> <th colspan="4">Operations Allowed </th></tr> <tr> <td> </td> <th>Insertions </th> <th>Deletions </th> <th>Substitutions </th> <th><a href="/wiki/Transposition_(mathematics)" class="mw-redirect" title="Transposition (mathematics)">Transposition</a> </th></tr> <tr> <td><a href="/wiki/Levenshtein_distance" title="Levenshtein distance">Levenshtein Distance</a> </td> <td>✓ </td> <td>✓ </td> <td>✓ </td> <td> </td></tr> <tr> <td><a href="/wiki/Longest_common_subsequence" title="Longest common subsequence">Longest Common Subsequence</a> (LCS) </td> <td>✓ </td> <td>✓ </td> <td> </td> <td> </td></tr> <tr> <td><a href="/wiki/Hamming_distance" title="Hamming distance">Hamming Distance</a> </td> <td> </td> <td> </td> <td>✓ </td> <td> </td></tr> <tr> <td><a href="/wiki/Damerau%E2%80%93Levenshtein_distance" title="Damerau–Levenshtein distance">Damerau–Levenshtein Distance</a> </td> <td>✓ </td> <td>✓ </td> <td>✓ </td> <td>✓ </td></tr> <tr> <td><a href="/wiki/Jaro_distance" class="mw-redirect" title="Jaro distance">Jaro distance</a> </td> <td> </td> <td> </td> <td> </td> <td>✓ </td></tr></tbody></table> <p>Some edit distances are defined as a parameterizable metric calculated with a specific set of allowed edit operations, and each operation is assigned a cost (possibly infinite). This is further generalized by DNA <a href="/wiki/Sequence_alignment" title="Sequence alignment">sequence alignment</a> algorithms such as the <a href="/wiki/Smith%E2%80%93Waterman_algorithm" title="Smith–Waterman algorithm">Smith–Waterman algorithm</a>, which make an operation's cost depend on where it is applied. </p> <div class="mw-heading mw-heading2"><h2 id="Formal_definition_and_properties">Formal definition and properties</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=2" title="Edit section: Formal definition and properties"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Given two strings <span class="texhtml mvar" style="font-style:italic;">a</span> and <span class="texhtml mvar" style="font-style:italic;">b</span> on an alphabet <span class="texhtml">Σ</span> (e.g. the set of <a href="/wiki/ASCII" title="ASCII">ASCII</a> characters, the set of <a href="/wiki/Byte" title="Byte">bytes</a> [0..255], etc.), the edit distance <span class="nowrap">d(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>)</span> is the minimum-weight series of edit operations that transforms <span class="texhtml mvar" style="font-style:italic;">a</span> into <span class="texhtml mvar" style="font-style:italic;">b</span>. One of the simplest sets of edit operations is that defined by Levenshtein in 1966:<sup id="cite_ref-slp_2-0" class="reference"><a href="#cite_note-slp-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><b>Insertion</b> of a single symbol. If <span class="texhtml mvar" style="font-style:italic;">a</span> = <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">v</span>, then inserting the symbol <span class="texhtml mvar" style="font-style:italic;">x</span> produces <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">x</span><span class="texhtml mvar" style="font-style:italic;">v</span>. This can also be denoted ε→<span class="texhtml mvar" style="font-style:italic;">x</span>, using ε to denote the empty string.</dd> <dd><b>Deletion</b> of a single symbol changes <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">x</span><span class="texhtml mvar" style="font-style:italic;">v</span> to <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">v</span> (<span class="texhtml mvar" style="font-style:italic;">x</span>→ε).</dd> <dd><b>Substitution</b> of a single symbol <span class="texhtml mvar" style="font-style:italic;">x</span> for a symbol <span class="texhtml mvar" style="font-style:italic;">y</span> ≠ <span class="texhtml mvar" style="font-style:italic;">x</span> changes <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">x</span><span class="texhtml mvar" style="font-style:italic;">v</span> to <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">y</span><span class="texhtml mvar" style="font-style:italic;">v</span> (<span class="texhtml mvar" style="font-style:italic;">x</span>→<span class="texhtml mvar" style="font-style:italic;">y</span>).</dd></dl> <p>In Levenshtein's original definition, each of these operations has unit cost (except that substitution of a character by itself has zero cost), so the Levenshtein distance is equal to the minimum <i>number</i> of operations required to transform <span class="texhtml mvar" style="font-style:italic;">a</span> to <span class="texhtml mvar" style="font-style:italic;">b</span>. A more general definition associates non-negative weight functions <span class="texhtml mvar" style="font-style:italic;">w</span><sub>ins</sub>(<span class="texhtml mvar" style="font-style:italic;">x</span>), <span class="texhtml mvar" style="font-style:italic;">w</span><sub>del</sub>(<span class="texhtml mvar" style="font-style:italic;">x</span>) and <span class="texhtml mvar" style="font-style:italic;">w</span><sub>sub</sub>(<span class="texhtml mvar" style="font-style:italic;">x</span>, <span class="texhtml mvar" style="font-style:italic;">y</span>) with the operations.<sup id="cite_ref-slp_2-1" class="reference"><a href="#cite_note-slp-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> </p><p>Additional primitive operations have been suggested. <a href="/wiki/Damerau%E2%80%93Levenshtein_distance" title="Damerau–Levenshtein distance">Damerau–Levenshtein distance</a> counts as a single edit a common mistake: <b>transposition</b> of two adjacent characters, formally characterized by an operation that changes <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">x</span><span class="texhtml mvar" style="font-style:italic;">y</span><span class="texhtml mvar" style="font-style:italic;">v</span> into <span class="texhtml mvar" style="font-style:italic;">u</span><span class="texhtml mvar" style="font-style:italic;">y</span><span class="texhtml mvar" style="font-style:italic;">x</span><span class="texhtml mvar" style="font-style:italic;">v</span>.<sup id="cite_ref-ukkonen83_3-0" class="reference"><a href="#cite_note-ukkonen83-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-ssm_4-0" class="reference"><a href="#cite_note-ssm-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> For the task of correcting <a href="/wiki/Optical_character_recognition" title="Optical character recognition">OCR</a> output, <b>merge</b> and <b>split</b> operations have been used which replace a single character into a pair of them or vice versa.<sup id="cite_ref-ssm_4-1" class="reference"><a href="#cite_note-ssm-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> </p><p>Other variants of edit distance are obtained by restricting the set of operations. <a href="/wiki/Longest_common_subsequence_problem" class="mw-redirect" title="Longest common subsequence problem">Longest common subsequence (LCS)</a> distance is edit distance with insertion and deletion as the only two edit operations, both at unit cost.<sup id="cite_ref-navarnarutoro_1-1" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 37">: 37 </span></sup> Similarly, by only allowing substitutions (again at unit cost), <a href="/wiki/Hamming_distance" title="Hamming distance">Hamming distance</a> is obtained; this must be restricted to equal-length strings.<sup id="cite_ref-navarnarutoro_1-2" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> <a href="/wiki/Jaro%E2%80%93Winkler_distance" title="Jaro–Winkler distance">Jaro–Winkler distance</a> can be obtained from an edit distance where only transpositions are allowed. </p> <div class="mw-heading mw-heading3"><h3 id="Example">Example</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=3" title="Edit section: Example"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The <a href="/wiki/Levenshtein_distance" title="Levenshtein distance">Levenshtein distance</a> between "kitten" and "sitting" is 3. A minimal edit script that transforms the former into the latter is: </p> <ol><li><b>k</b>itten → <b>s</b>itten (substitute "s" for "k")</li> <li>sitt<b>e</b>n → sitt<b>i</b>n (substitute "i" for "e")</li> <li>sittin → sittin<b>g</b> (insert "g" at the end)</li></ol> <p>LCS distance (insertions and deletions only) gives a different distance and minimal edit script: </p> <ol><li><b>k</b>itten → itten (delete "k" at 0)</li> <li>itten → <b>s</b>itten (insert "s" at 0)</li> <li>sitt<b>e</b>n → sittn (delete "e" at 4)</li> <li>sittn → sitt<b>i</b>n (insert "i" at 4)</li> <li>sittin → sittin<b>g</b> (insert "g" at 6)</li></ol> <p>for a total cost/distance of 5 operations. </p> <div class="mw-heading mw-heading3"><h3 id="Properties">Properties</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=4" title="Edit section: Properties"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Edit distance with non-negative cost satisfies the axioms of a <a href="/wiki/Metric_(mathematics)" class="mw-redirect" title="Metric (mathematics)">metric</a>, giving rise to a <a href="/wiki/Metric_space" title="Metric space">metric space</a> of strings, when the following conditions are met:<sup id="cite_ref-navarnarutoro_1-3" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 37">: 37 </span></sup> </p> <ul><li>Every edit operation has positive cost;</li> <li>for every operation, there is an inverse operation with equal cost.</li></ul> <p>With these properties, the metric axioms are satisfied as follows: </p> <dl><dd><span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>) = 0 if and only if a=b, since each string can be trivially transformed to itself using exactly zero operations.</dd> <dd><span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>) > 0 when <span class="texhtml mvar" style="font-style:italic;">a</span> ≠ <span class="texhtml mvar" style="font-style:italic;">b</span>, since this would require at least one operation at non-zero cost.</dd> <dd><span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>) = <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">b</span>, <span class="texhtml mvar" style="font-style:italic;">a</span>) by equality of the cost of each operation and its inverse.</dd> <dd>Triangle inequality: <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">c</span>) ≤ <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>) + <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">b</span>, <span class="texhtml mvar" style="font-style:italic;">c</span>).<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup></dd></dl> <p>Levenshtein distance and LCS distance with unit cost satisfy the above conditions, and therefore the metric axioms. Variants of edit distance that are not proper metrics have also been considered in the literature.<sup id="cite_ref-navarnarutoro_1-4" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> </p><p>Other useful properties of unit-cost edit distances include: </p> <ul><li>LCS distance is bounded above by the sum of lengths of a pair of strings.<sup id="cite_ref-navarnarutoro_1-5" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 37">: 37 </span></sup></li> <li>LCS distance is an upper bound on Levenshtein distance.</li> <li>For strings of the same length, Hamming distance is an upper bound on Levenshtein distance.<sup id="cite_ref-navarnarutoro_1-6" class="reference"><a href="#cite_note-navarnarutoro-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup></li></ul> <p>Regardless of cost/weights, the following property holds of all edit distances: </p> <ul><li>When <span class="texhtml mvar" style="font-style:italic;">a</span> and <span class="texhtml mvar" style="font-style:italic;">b</span> share a common prefix, this prefix has no effect on the distance. Formally, when <span class="texhtml mvar" style="font-style:italic;">a</span> = <span class="texhtml mvar" style="font-style:italic;">uv</span> and <span class="texhtml mvar" style="font-style:italic;">b</span> = <span class="texhtml mvar" style="font-style:italic;">uw</span>, then <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">a</span>, <span class="texhtml mvar" style="font-style:italic;">b</span>) = <span class="texhtml mvar" style="font-style:italic;">d</span>(<span class="texhtml mvar" style="font-style:italic;">v</span>, <span class="texhtml mvar" style="font-style:italic;">w</span>).<sup id="cite_ref-ssm_4-2" class="reference"><a href="#cite_note-ssm-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> This allows speeding up many computations involving edit distance and edit scripts, since common prefixes and suffixes can be skipped in linear time.</li></ul> <div class="mw-heading mw-heading2"><h2 id="Computation">Computation</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=5" title="Edit section: Computation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The first algorithm for computing minimum edit distance between a pair of strings was published by <a href="/wiki/Frederick_J._Damerau" title="Frederick J. Damerau">Damerau</a> in 1964.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading3"><h3 id="Common_algorithm">Common algorithm</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=6" title="Edit section: Common algorithm"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1236090951">.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Wagner%E2%80%93Fischer_algorithm" title="Wagner–Fischer algorithm">Wagner–Fischer algorithm</a></div> <p>Using Levenshtein's original operations, the (nonsymmetric) edit distance from <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle a=a_{1}\ldots a_{m}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>a</mi> <mo>=</mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>…<!-- … --></mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>m</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle a=a_{1}\ldots a_{m}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa05f4c5868023d9fd5f9a2e83c435da612ec502" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:13.015ex; height:2.009ex;" alt="{\displaystyle a=a_{1}\ldots a_{m}}"></span> to <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b=b_{1}\ldots b_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>b</mi> <mo>=</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>…<!-- … --></mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle b=b_{1}\ldots b_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3309d61d2ad02ea8293da4e166450fe0c449b449" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:11.861ex; height:2.509ex;" alt="{\displaystyle b=b_{1}\ldots b_{n}}"></span> is given by <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{mn}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>m</mi> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle d_{mn}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65dc535bfabf91fffb04553387ec98324c286c5f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.87ex; height:2.509ex;" alt="{\displaystyle d_{mn}}"></span>, defined by the <a href="/wiki/Recursive_definition" title="Recursive definition">recurrence</a><sup id="cite_ref-slp_2-2" class="reference"><a href="#cite_note-slp-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}d_{i0}&=\sum _{k=1}^{i}w_{\mathrm {del} }(a_{k}),&&\quad {\text{for}}\;1\leq i\leq m\\d_{0j}&=\sum _{k=1}^{j}w_{\mathrm {ins} }(b_{k}),&&\quad {\text{for}}\;1\leq j\leq n\\d_{ij}&={\begin{cases}d_{i-1,j-1}&{\text{for}}\;a_{i}=b_{j}\\\min {\begin{cases}d_{i-1,j}+w_{\mathrm {del} }(a_{i})\\d_{i,j-1}+w_{\mathrm {ins} }(b_{j})\\d_{i-1,j-1}+w_{\mathrm {sub} }(a_{i},b_{j})\end{cases}}&{\text{for}}\;a_{i}\neq b_{j}\end{cases}}&&\quad {\text{for}}\;1\leq i\leq m,1\leq j\leq n.\end{aligned}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true"> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mn>0</mn> </mrow> </msub> </mtd> <mtd> <mi></mi> <mo>=</mo> <munderover> <mo>∑<!-- ∑ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </munderover> <msub> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal">d</mi> <mi mathvariant="normal">e</mi> <mi mathvariant="normal">l</mi> </mrow> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msub> <mo stretchy="false">)</mo> <mo>,</mo> </mtd> <mtd /> <mtd> <mspace width="1em" /> <mrow class="MJX-TeXAtom-ORD"> <mtext>for</mtext> </mrow> <mspace width="thickmathspace" /> <mn>1</mn> <mo>≤<!-- ≤ --></mo> <mi>i</mi> <mo>≤<!-- ≤ --></mo> <mi>m</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>0</mn> <mi>j</mi> </mrow> </msub> </mtd> <mtd> <mi></mi> <mo>=</mo> <munderover> <mo>∑<!-- ∑ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi>j</mi> </mrow> </munderover> <msub> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal">i</mi> <mi mathvariant="normal">n</mi> <mi mathvariant="normal">s</mi> </mrow> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msub> <mo stretchy="false">)</mo> <mo>,</mo> </mtd> <mtd /> <mtd> <mspace width="1em" /> <mrow class="MJX-TeXAtom-ORD"> <mtext>for</mtext> </mrow> <mspace width="thickmathspace" /> <mn>1</mn> <mo>≤<!-- ≤ --></mo> <mi>j</mi> <mo>≤<!-- ≤ --></mo> <mi>n</mi> </mtd> </mtr> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mi>j</mi> </mrow> </msub> </mtd> <mtd> <mi></mi> <mo>=</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo>{</mo> <mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mo>−<!-- − --></mo> <mn>1</mn> <mo>,</mo> <mi>j</mi> <mo>−<!-- − --></mo> <mn>1</mn> </mrow> </msub> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext>for</mtext> </mrow> <mspace width="thickmathspace" /> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo>=</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>j</mi> </mrow> </msub> </mtd> </mtr> <mtr> <mtd> <mo movablelimits="true" form="prefix">min</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow> <mo>{</mo> <mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false"> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mo>−<!-- − --></mo> <mn>1</mn> <mo>,</mo> <mi>j</mi> </mrow> </msub> <mo>+</mo> <msub> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal">d</mi> <mi mathvariant="normal">e</mi> <mi mathvariant="normal">l</mi> </mrow> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">)</mo> </mtd> </mtr> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mo>,</mo> <mi>j</mi> <mo>−<!-- − --></mo> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal">i</mi> <mi mathvariant="normal">n</mi> <mi mathvariant="normal">s</mi> </mrow> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>j</mi> </mrow> </msub> <mo stretchy="false">)</mo> </mtd> </mtr> <mtr> <mtd> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mo>−<!-- − --></mo> <mn>1</mn> <mo>,</mo> <mi>j</mi> <mo>−<!-- − --></mo> <mn>1</mn> </mrow> </msub> <mo>+</mo> <msub> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="normal">s</mi> <mi mathvariant="normal">u</mi> <mi mathvariant="normal">b</mi> </mrow> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo>,</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>j</mi> </mrow> </msub> <mo stretchy="false">)</mo> </mtd> </mtr> </mtable> <mo fence="true" stretchy="true" symmetric="true"></mo> </mrow> </mrow> </mtd> <mtd> <mrow class="MJX-TeXAtom-ORD"> <mtext>for</mtext> </mrow> <mspace width="thickmathspace" /> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo>≠<!-- ≠ --></mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>j</mi> </mrow> </msub> </mtd> </mtr> </mtable> <mo fence="true" stretchy="true" symmetric="true"></mo> </mrow> </mrow> </mtd> <mtd /> <mtd> <mspace width="1em" /> <mrow class="MJX-TeXAtom-ORD"> <mtext>for</mtext> </mrow> <mspace width="thickmathspace" /> <mn>1</mn> <mo>≤<!-- ≤ --></mo> <mi>i</mi> <mo>≤<!-- ≤ --></mo> <mi>m</mi> <mo>,</mo> <mn>1</mn> <mo>≤<!-- ≤ --></mo> <mi>j</mi> <mo>≤<!-- ≤ --></mo> <mi>n</mi> <mo>.</mo> </mtd> </mtr> </mtable> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}d_{i0}&=\sum _{k=1}^{i}w_{\mathrm {del} }(a_{k}),&&\quad {\text{for}}\;1\leq i\leq m\\d_{0j}&=\sum _{k=1}^{j}w_{\mathrm {ins} }(b_{k}),&&\quad {\text{for}}\;1\leq j\leq n\\d_{ij}&={\begin{cases}d_{i-1,j-1}&{\text{for}}\;a_{i}=b_{j}\\\min {\begin{cases}d_{i-1,j}+w_{\mathrm {del} }(a_{i})\\d_{i,j-1}+w_{\mathrm {ins} }(b_{j})\\d_{i-1,j-1}+w_{\mathrm {sub} }(a_{i},b_{j})\end{cases}}&{\text{for}}\;a_{i}\neq b_{j}\end{cases}}&&\quad {\text{for}}\;1\leq i\leq m,1\leq j\leq n.\end{aligned}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/69b7a79599eeadd727a2d8564abd34dd1a11a5c2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -13.005ex; width:82.808ex; height:27.176ex;" alt="{\displaystyle {\begin{aligned}d_{i0}&=\sum _{k=1}^{i}w_{\mathrm {del} }(a_{k}),&&\quad {\text{for}}\;1\leq i\leq m\\d_{0j}&=\sum _{k=1}^{j}w_{\mathrm {ins} }(b_{k}),&&\quad {\text{for}}\;1\leq j\leq n\\d_{ij}&={\begin{cases}d_{i-1,j-1}&{\text{for}}\;a_{i}=b_{j}\\\min {\begin{cases}d_{i-1,j}+w_{\mathrm {del} }(a_{i})\\d_{i,j-1}+w_{\mathrm {ins} }(b_{j})\\d_{i-1,j-1}+w_{\mathrm {sub} }(a_{i},b_{j})\end{cases}}&{\text{for}}\;a_{i}\neq b_{j}\end{cases}}&&\quad {\text{for}}\;1\leq i\leq m,1\leq j\leq n.\end{aligned}}}"></span></dd></dl> <p>This algorithm can be generalized to handle transpositions by adding another term in the recursive clause's minimization.<sup id="cite_ref-ukkonen83_3-1" class="reference"><a href="#cite_note-ukkonen83-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> </p><p>The straightforward, <a href="/wiki/Recursion_(computer_science)" title="Recursion (computer science)">recursive</a> way of evaluating this recurrence takes <a href="/wiki/Exponential_time" class="mw-redirect" title="Exponential time">exponential time</a>. Therefore, it is usually computed using a <a href="/wiki/Dynamic_programming" title="Dynamic programming">dynamic programming</a> algorithm that is commonly credited to <a href="/wiki/Wagner%E2%80%93Fischer_algorithm" title="Wagner–Fischer algorithm">Wagner and Fischer</a>,<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> although it has a history of multiple invention.<sup id="cite_ref-slp_2-3" class="reference"><a href="#cite_note-slp-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-ukkonen83_3-2" class="reference"><a href="#cite_note-ukkonen83-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> After completion of the Wagner–Fischer algorithm, a minimal sequence of edit operations can be read off as a backtrace of the operations used during the dynamic programming algorithm starting at <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{mn}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>d</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>m</mi> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle d_{mn}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65dc535bfabf91fffb04553387ec98324c286c5f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.87ex; height:2.509ex;" alt="{\displaystyle d_{mn}}"></span>. </p><p>This algorithm has a <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a> of Θ(<span class="texhtml mvar" style="font-style:italic;">m</span><span class="texhtml mvar" style="font-style:italic;">n</span>) where <span class="texhtml mvar" style="font-style:italic;">m</span> and <span class="texhtml mvar" style="font-style:italic;">n</span> are the lengths of the strings. When the full dynamic programming table is constructed, its <a href="/wiki/Space_complexity" title="Space complexity">space complexity</a> is also <span class="nowrap">Θ(<span class="texhtml mvar" style="font-style:italic;">m</span><span class="texhtml mvar" style="font-style:italic;">n</span>)</span>; this can be improved to <span class="nowrap">Θ(min(<span class="texhtml mvar" style="font-style:italic;">m</span>,<span class="texhtml mvar" style="font-style:italic;">n</span>))</span> by observing that at any instant, the algorithm only requires two rows (or two columns) in memory. However, this optimization makes it impossible to read off the minimal series of edit operations.<sup id="cite_ref-ukkonen83_3-3" class="reference"><a href="#cite_note-ukkonen83-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> A linear-space solution to this problem is offered by <a href="/wiki/Hirschberg%27s_algorithm" title="Hirschberg's algorithm">Hirschberg's algorithm</a>.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 634">: 634 </span></sup> A general recursive divide-and-conquer framework for solving such recurrences and extracting an optimal sequence of operations cache-efficiently in space linear in the size of the input is given by Chowdhury, Le, and Ramachandran.<sup id="cite_ref-CLR-08_9-0" class="reference"><a href="#cite_note-CLR-08-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading3"><h3 id="Improved_algorithms">Improved algorithms</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=7" title="Edit section: Improved algorithms"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Improving on the Wagner–Fisher algorithm described above, <a href="/wiki/Esko_Ukkonen" title="Esko Ukkonen">Ukkonen</a> describes several variants,<sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> one of which takes two strings and a maximum edit distance <span class="texhtml mvar" style="font-style:italic;">s</span>, and returns <span class="nowrap">min(<span class="texhtml mvar" style="font-style:italic;">s</span>, <span class="texhtml mvar" style="font-style:italic;">d</span>)</span>. It achieves this by only computing and storing a part of the dynamic programming table around its diagonal. This algorithm takes time <span class="nowrap">O(<span class="texhtml mvar" style="font-style:italic;">s</span>×min(<span class="texhtml mvar" style="font-style:italic;">m</span>,<span class="texhtml mvar" style="font-style:italic;">n</span>))</span>, where <span class="texhtml mvar" style="font-style:italic;">m</span> and <span class="texhtml mvar" style="font-style:italic;">n</span> are the lengths of the strings. Space complexity is <span class="nowrap">O(<span class="texhtml mvar" style="font-style:italic;">s</span><sup>2</sup>)</span> or <span class="nowrap">O(<span class="texhtml mvar" style="font-style:italic;">s</span>)</span>, depending on whether the edit sequence needs to be read off.<sup id="cite_ref-ukkonen83_3-4" class="reference"><a href="#cite_note-ukkonen83-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> </p><p>Further improvements by <a href="/wiki/Gad_Landau" title="Gad Landau">Landau</a>, <a href="/wiki/Eugene_Myers" title="Eugene Myers">Myers</a>, and Schmidt <a rel="nofollow" class="external autonumber" href="https://dblp.org/pers/hd/s/Schmidt:Jeanette_P=">[1]</a> give an <span class="nowrap">O(<span class="texhtml mvar" style="font-style:italic;">s</span><sup>2</sup> + max(<span class="texhtml mvar" style="font-style:italic;">m</span>,<span class="texhtml mvar" style="font-style:italic;">n</span>))</span> time algorithm.<sup id="cite_ref-11" class="reference"><a href="#cite_note-11"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> </p><p>For a finite alphabet and edit costs which are multiples of each other, the fastest known exact algorithm is of Masek and Paterson<sup id="cite_ref-12" class="reference"><a href="#cite_note-12"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> having worst case runtime of O(nm/logn). </p> <div class="mw-heading mw-heading2"><h2 id="Applications">Applications</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=8" title="Edit section: Applications"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Edit distance finds applications in <a href="/wiki/Computational_biology" title="Computational biology">computational biology</a> and natural language processing, e.g. the correction of spelling mistakes or OCR errors, and <a href="/wiki/Approximate_string_matching" title="Approximate string matching">approximate string matching</a>, where the objective is to find matches for short strings in many longer texts, in situations where a small number of differences is to be expected. </p><p>Various algorithms exist that solve problems beside the computation of distance between a pair of strings, to solve related types of problems. </p> <ul><li><a href="/wiki/Hirschberg%27s_algorithm" title="Hirschberg's algorithm">Hirschberg's algorithm</a> computes the optimal <a href="/wiki/Sequence_alignment" title="Sequence alignment">alignment</a> of two strings, where optimality is defined as minimizing edit distance.</li> <li><a href="/wiki/Approximate_string_matching" title="Approximate string matching">Approximate string matching</a> can be formulated in terms of edit distance. Ukkonen's 1985 algorithm takes a string <span class="texhtml mvar" style="font-style:italic;">p</span>, called the pattern, and a constant <span class="texhtml mvar" style="font-style:italic;">k</span>; it then builds a <a href="/wiki/Deterministic_finite_state_automaton" class="mw-redirect" title="Deterministic finite state automaton">deterministic finite state automaton</a> that finds, in an arbitrary string <span class="texhtml mvar" style="font-style:italic;">s</span>, a substring whose edit distance to <span class="texhtml mvar" style="font-style:italic;">p</span> is at most <span class="texhtml mvar" style="font-style:italic;">k</span><sup id="cite_ref-13" class="reference"><a href="#cite_note-13"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup> (cf. the <a href="/wiki/Aho%E2%80%93Corasick_string_matching_algorithm" class="mw-redirect" title="Aho–Corasick string matching algorithm">Aho–Corasick algorithm</a>, which similarly constructs an automaton to search for any of a number of patterns, but without allowing edit operations). A similar algorithm for approximate string matching is the <a href="/wiki/Bitap_algorithm" title="Bitap algorithm">bitap algorithm</a>, also defined in terms of edit distance.</li> <li><a href="/wiki/Levenshtein_automaton" title="Levenshtein automaton">Levenshtein automata</a> are finite-state machines that recognize a set of strings within bounded edit distance of a fixed reference string.<sup id="cite_ref-ssm_4-3" class="reference"><a href="#cite_note-ssm-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></li></ul> <div class="mw-heading mw-heading2"><h2 id="Language_edit_distance">Language edit distance</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=9" title="Edit section: Language edit distance"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A generalization of the edit distance between strings is the language edit distance between a string and a language, usually a <a href="/wiki/Formal_language" title="Formal language">formal language</a>. Instead of considering the edit distance between one string and another, the language edit distance is the minimum edit distance that can be attained between a fixed string and <i>any</i> string taken from a set of strings. More formally, for any language <i>L</i> and string <i>x</i> over an alphabet <span class="texhtml">Σ</span>, the <i>language edit distance</i> d(<i>L</i>, <i>x</i>) is given by<sup id="cite_ref-:0_14-0" class="reference"><a href="#cite_note-:0-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d(L,x)=\min _{y\in L}d(x,y)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>d</mi> <mo stretchy="false">(</mo> <mi>L</mi> <mo>,</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>=</mo> <munder> <mo movablelimits="true" form="prefix">min</mo> <mrow class="MJX-TeXAtom-ORD"> <mi>y</mi> <mo>∈<!-- ∈ --></mo> <mi>L</mi> </mrow> </munder> <mi>d</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle d(L,x)=\min _{y\in L}d(x,y)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d5563abfbb022d4904e52c0c0762cb461b1e039b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.338ex; width:20.877ex; height:4.343ex;" alt="{\displaystyle d(L,x)=\min _{y\in L}d(x,y)}"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d(x,y)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>d</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle d(x,y)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3772957879a8bbf7946bddf5743c508a1d5072c0" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.544ex; height:2.843ex;" alt="{\displaystyle d(x,y)}"></span> is the string edit distance. When the language <i>L</i> is <a href="/wiki/Context-free_language" title="Context-free language">context free</a>, there is a cubic time dynamic programming algorithm proposed by Aho and Peterson in 1972 which computes the language edit distance.<sup id="cite_ref-15" class="reference"><a href="#cite_note-15"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> For less expressive families of grammars, such as the <a href="/wiki/Regular_grammar" title="Regular grammar">regular grammars</a>, faster algorithms exist for computing the edit distance.<sup id="cite_ref-16" class="reference"><a href="#cite_note-16"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> </p><p>Language edit distance has found many diverse applications, such as RNA folding, error correction, and solutions to the Optimum Stack Generation problem.<sup id="cite_ref-:0_14-1" class="reference"><a href="#cite_note-:0-14"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-17" class="reference"><a href="#cite_note-17"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=10" title="Edit section: See also"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Graph_edit_distance" title="Graph edit distance">Graph edit distance</a></li> <li><a href="/wiki/String-to-string_correction_problem" title="String-to-string correction problem">String-to-string correction problem</a></li> <li><a href="/wiki/String_metric" title="String metric">String metric</a></li> <li><a href="/wiki/Time_Warp_Edit_Distance" title="Time Warp Edit Distance">Time Warp Edit Distance</a></li></ul> <div class="mw-heading mw-heading2"><h2 id="References">References</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Edit_distance&action=edit&section=11" title="Edit section: References"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1239543626">.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist reflist-columns references-column-width" style="column-width: 30em;"> <ol class="references"> <li id="cite_note-navarnarutoro-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-navarnarutoro_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-3"><sup><i><b>d</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-4"><sup><i><b>e</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-5"><sup><i><b>f</b></i></sup></a> <a href="#cite_ref-navarnarutoro_1-6"><sup><i><b>g</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}</style><cite id="CITEREFNavarro2001" class="citation journal cs1">Navarro, Gonzalo (1 March 2001). <a rel="nofollow" class="external text" href="http://users.csc.calpoly.edu/~dekhtyar/570-Fall2011/papers/navarro-approximate.pdf">"A guided tour to approximate string matching"</a> <span class="cs1-format">(PDF)</span>. <i>ACM Computing Surveys</i>. <b>33</b> (1): <span class="nowrap">31–</span>88. <a href="/wiki/CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.452.6317">10.1.1.452.6317</a></span>. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F375360.375365">10.1145/375360.375365</a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:207551224">207551224</a><span class="reference-accessdate">. Retrieved <span class="nowrap">19 March</span> 2015</span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=ACM+Computing+Surveys&rft.atitle=A+guided+tour+to+approximate+string+matching&rft.volume=33&rft.issue=1&rft.pages=%3Cspan+class%3D%22nowrap%22%3E31-%3C%2Fspan%3E88&rft.date=2001-03-01&rft_id=https%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fsummary%3Fdoi%3D10.1.1.452.6317%23id-name%3DCiteSeerX&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A207551224%23id-name%3DS2CID&rft_id=info%3Adoi%2F10.1145%2F375360.375365&rft.aulast=Navarro&rft.aufirst=Gonzalo&rft_id=http%3A%2F%2Fusers.csc.calpoly.edu%2F~dekhtyar%2F570-Fall2011%2Fpapers%2Fnavarro-approximate.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-slp-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-slp_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-slp_2-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-slp_2-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-slp_2-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFDaniel_JurafskyJames_H._Martin" class="citation book cs1">Daniel Jurafsky; James H. Martin. <i>Speech and Language Processing</i>. Pearson Education International. pp. <span class="nowrap">107–</span>111.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Speech+and+Language+Processing&rft.pages=%3Cspan+class%3D%22nowrap%22%3E107-%3C%2Fspan%3E111&rft.pub=Pearson+Education+International&rft.au=Daniel+Jurafsky&rft.au=James+H.+Martin&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-ukkonen83-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-ukkonen83_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-ukkonen83_3-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-ukkonen83_3-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-ukkonen83_3-3"><sup><i><b>d</b></i></sup></a> <a href="#cite_ref-ukkonen83_3-4"><sup><i><b>e</b></i></sup></a></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFEsko_Ukkonen1983" class="citation conference cs1">Esko Ukkonen (1983). <i>On approximate string matching</i>. Foundations of Computation Theory. Springer. pp. <span class="nowrap">487–</span>495. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F3-540-12689-9_129">10.1007/3-540-12689-9_129</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=conference&rft.btitle=On+approximate+string+matching&rft.pages=%3Cspan+class%3D%22nowrap%22%3E487-%3C%2Fspan%3E495&rft.pub=Springer&rft.date=1983&rft_id=info%3Adoi%2F10.1007%2F3-540-12689-9_129&rft.au=Esko+Ukkonen&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-ssm-4"><span class="mw-cite-backlink">^ <a href="#cite_ref-ssm_4-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-ssm_4-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-ssm_4-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-ssm_4-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSchulzMihov2002" class="citation journal cs1">Schulz, Klaus U.; Mihov, Stoyan (2002). "Fast string correction with Levenshtein automata". <i>International Journal of Document Analysis and Recognition</i>. <b>5</b> (1): <span class="nowrap">67–</span>85. <a href="/wiki/CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.16.652">10.1.1.16.652</a></span>. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2Fs10032-002-0082-8">10.1007/s10032-002-0082-8</a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:207046453">207046453</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=International+Journal+of+Document+Analysis+and+Recognition&rft.atitle=Fast+string+correction+with+Levenshtein+automata&rft.volume=5&rft.issue=1&rft.pages=%3Cspan+class%3D%22nowrap%22%3E67-%3C%2Fspan%3E85&rft.date=2002&rft_id=https%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fsummary%3Fdoi%3D10.1.1.16.652%23id-name%3DCiteSeerX&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A207046453%23id-name%3DS2CID&rft_id=info%3Adoi%2F10.1007%2Fs10032-002-0082-8&rft.aulast=Schulz&rft.aufirst=Klaus+U.&rft.au=Mihov%2C+Stoyan&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLei_ChenRaymond_Ng2004" class="citation conference cs1">Lei Chen; Raymond Ng (2004). <a rel="nofollow" class="external text" href="http://www.cs.ust.hk/~leichen/pub/04/vldb04.pdf"><i>On the marriage of L<sub>p</sub>-norms and edit distance</i></a> <span class="cs1-format">(PDF)</span>. Proc. 30th Int'l Conf. on Very Large Databases (VLDB). Vol. 30. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fb978-012088469-8.50070-x">10.1016/b978-012088469-8.50070-x</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=conference&rft.btitle=On+the+marriage+of+L%3Csub%3Ep%3C%2Fsub%3E-norms+and+edit+distance&rft.date=2004&rft_id=info%3Adoi%2F10.1016%2Fb978-012088469-8.50070-x&rft.au=Lei+Chen&rft.au=Raymond+Ng&rft_id=http%3A%2F%2Fwww.cs.ust.hk%2F~leichen%2Fpub%2F04%2Fvldb04.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-6">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFKukich1992" class="citation journal cs1">Kukich, Karen (1992). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160927030713/http://dc-pubs.dbs.uni-leipzig.de/files/Kukich1992Techniqueforautomatically.pdf">"Techniques for Automatically Correcting Words in Text"</a> <span class="cs1-format">(PDF)</span>. <i>ACM Computing Surveys</i>. <b>24</b> (4): <span class="nowrap">377–</span>439. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F146370.146380">10.1145/146370.146380</a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:5431215">5431215</a>. Archived from <a rel="nofollow" class="external text" href="http://dc-pubs.dbs.uni-leipzig.de/files/Kukich1992Techniqueforautomatically.pdf">the original</a> <span class="cs1-format">(PDF)</span> on 2016-09-27<span class="reference-accessdate">. Retrieved <span class="nowrap">2017-11-09</span></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=ACM+Computing+Surveys&rft.atitle=Techniques+for+Automatically+Correcting+Words+in+Text&rft.volume=24&rft.issue=4&rft.pages=%3Cspan+class%3D%22nowrap%22%3E377-%3C%2Fspan%3E439&rft.date=1992&rft_id=info%3Adoi%2F10.1145%2F146370.146380&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A5431215%23id-name%3DS2CID&rft.aulast=Kukich&rft.aufirst=Karen&rft_id=http%3A%2F%2Fdc-pubs.dbs.uni-leipzig.de%2Ffiles%2FKukich1992Techniqueforautomatically.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFR._WagnerM._Fischer1974" class="citation journal cs1">R. Wagner; M. Fischer (1974). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F321796.321811">"The string-to-string correction problem"</a>. <i>J. ACM</i>. <b>21</b>: <span class="nowrap">168–</span>178. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F321796.321811">10.1145/321796.321811</a></span>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:13381535">13381535</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=J.+ACM&rft.atitle=The+string-to-string+correction+problem&rft.volume=21&rft.pages=%3Cspan+class%3D%22nowrap%22%3E168-%3C%2Fspan%3E178&rft.date=1974&rft_id=info%3Adoi%2F10.1145%2F321796.321811&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A13381535%23id-name%3DS2CID&rft.au=R.+Wagner&rft.au=M.+Fischer&rft_id=https%3A%2F%2Fdoi.org%2F10.1145%252F321796.321811&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSkiena2010" class="citation book cs1"><a href="/wiki/Steven_Skiena" title="Steven Skiena">Skiena, Steven</a> (2010). <i>The Algorithm Design Manual</i> (2nd ed.). <a href="/wiki/Springer_Science%2BBusiness_Media" title="Springer Science+Business Media">Springer Science+Business Media</a>. <a href="/wiki/Bibcode_(identifier)" class="mw-redirect" title="Bibcode (identifier)">Bibcode</a>:<a rel="nofollow" class="external text" href="https://ui.adsabs.harvard.edu/abs/2008adm..book.....S">2008adm..book.....S</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-1-849-96720-4" title="Special:BookSources/978-1-849-96720-4"><bdi>978-1-849-96720-4</bdi></a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=The+Algorithm+Design+Manual&rft.edition=2nd&rft.pub=Springer+Science%2BBusiness+Media&rft.date=2010&rft_id=info%3Abibcode%2F2008adm..book.....S&rft.isbn=978-1-849-96720-4&rft.aulast=Skiena&rft.aufirst=Steven&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-CLR-08-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-CLR-08_9-0">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFChowdhuryLeRamachandran2010" class="citation journal cs1">Chowdhury, Rezaul; Le, Hai-Son; Ramachandran, Vijaya (July 2010). <a rel="nofollow" class="external text" href="https://ieeexplore.ieee.org/document/4609376">"Cache-oblivious dynamic programming for bioinformatics"</a>. <i>IEEE/ACM Transactions on Computational Biology and Bioinformatics</i>. <b>7</b> (3): <span class="nowrap">495–</span>510. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FTCBB.2008.94">10.1109/TCBB.2008.94</a>. <a href="/wiki/PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a> <a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/20671320">20671320</a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:2532039">2532039</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=IEEE%2FACM+Transactions+on+Computational+Biology+and+Bioinformatics&rft.atitle=Cache-oblivious+dynamic+programming+for+bioinformatics&rft.volume=7&rft.issue=3&rft.pages=%3Cspan+class%3D%22nowrap%22%3E495-%3C%2Fspan%3E510&rft.date=2010-07&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A2532039%23id-name%3DS2CID&rft_id=info%3Apmid%2F20671320&rft_id=info%3Adoi%2F10.1109%2FTCBB.2008.94&rft.aulast=Chowdhury&rft.aufirst=Rezaul&rft.au=Le%2C+Hai-Son&rft.au=Ramachandran%2C+Vijaya&rft_id=https%3A%2F%2Fieeexplore.ieee.org%2Fdocument%2F4609376&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFUkkonen1985" class="citation journal cs1">Ukkonen, Esko (1985). <a rel="nofollow" class="external text" href="http://www.cs.helsinki.fi/u/ukkonen/InfCont85.PDF">"Algorithms for approximate string matching"</a> <span class="cs1-format">(PDF)</span>. <i>Information and Control</i>. <b>64</b> (<span class="nowrap">1–</span>3): <span class="nowrap">100–</span>118. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2FS0019-9958%2885%2980046-2">10.1016/S0019-9958(85)80046-2</a></span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Information+and+Control&rft.atitle=Algorithms+for+approximate+string+matching&rft.volume=64&rft.issue=%3Cspan+class%3D%22nowrap%22%3E1%E2%80%93%3C%2Fspan%3E3&rft.pages=%3Cspan+class%3D%22nowrap%22%3E100-%3C%2Fspan%3E118&rft.date=1985&rft_id=info%3Adoi%2F10.1016%2FS0019-9958%2885%2980046-2&rft.aulast=Ukkonen&rft.aufirst=Esko&rft_id=http%3A%2F%2Fwww.cs.helsinki.fi%2Fu%2Fukkonen%2FInfCont85.PDF&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-11"><span class="mw-cite-backlink"><b><a href="#cite_ref-11">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLandauMyersSchmidt1998" class="citation journal cs1">Landau; Myers; Schmidt (1998). "Incremental String Comparison". <i>SIAM Journal on Computing</i>. <b>27</b> (2): <span class="nowrap">557–</span>582. <a href="/wiki/CiteSeerX_(identifier)" class="mw-redirect" title="CiteSeerX (identifier)">CiteSeerX</a> <span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.1766">10.1.1.38.1766</a></span>. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1137%2FS0097539794264810">10.1137/S0097539794264810</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=SIAM+Journal+on+Computing&rft.atitle=Incremental+String+Comparison&rft.volume=27&rft.issue=2&rft.pages=%3Cspan+class%3D%22nowrap%22%3E557-%3C%2Fspan%3E582&rft.date=1998&rft_id=https%3A%2F%2Fciteseerx.ist.psu.edu%2Fviewdoc%2Fsummary%3Fdoi%3D10.1.1.38.1766%23id-name%3DCiteSeerX&rft_id=info%3Adoi%2F10.1137%2FS0097539794264810&rft.au=Landau&rft.au=Myers&rft.au=Schmidt&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-12"><span class="mw-cite-backlink"><b><a href="#cite_ref-12">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFMasekPaterson1980" class="citation journal cs1">Masek, William J.; Paterson, Michael S. (February 1980). <a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0022-0000%2880%2990002-1">"A faster algorithm computing string edit distances"</a>. <i>Journal of Computer and System Sciences</i>. <b>20</b> (1): <span class="nowrap">18–</span>31. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0022-0000%2880%2990002-1">10.1016/0022-0000(80)90002-1</a></span>. <a href="/wiki/Hdl_(identifier)" class="mw-redirect" title="Hdl (identifier)">hdl</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://hdl.handle.net/1721.1%2F148933">1721.1/148933</a></span>. <a href="/wiki/ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0022-0000">0022-0000</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Journal+of+Computer+and+System+Sciences&rft.atitle=A+faster+algorithm+computing+string+edit+distances&rft.volume=20&rft.issue=1&rft.pages=%3Cspan+class%3D%22nowrap%22%3E18-%3C%2Fspan%3E31&rft.date=1980-02&rft_id=info%3Ahdl%2F1721.1%2F148933&rft.issn=0022-0000&rft_id=info%3Adoi%2F10.1016%2F0022-0000%2880%2990002-1&rft.aulast=Masek&rft.aufirst=William+J.&rft.au=Paterson%2C+Michael+S.&rft_id=https%3A%2F%2Fdoi.org%2F10.1016%252F0022-0000%252880%252990002-1&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-13">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFEsko_Ukkonen1985" class="citation journal cs1">Esko Ukkonen (1985). "Finding approximate patterns in strings". <i>J. Algorithms</i>. <b>6</b>: <span class="nowrap">132–</span>137. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2F0196-6774%2885%2990023-9">10.1016/0196-6774(85)90023-9</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=J.+Algorithms&rft.atitle=Finding+approximate+patterns+in+strings&rft.volume=6&rft.pages=%3Cspan+class%3D%22nowrap%22%3E132-%3C%2Fspan%3E137&rft.date=1985&rft_id=info%3Adoi%2F10.1016%2F0196-6774%2885%2990023-9&rft.au=Esko+Ukkonen&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-:0-14"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_14-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_14-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFBringmannGrandoniSahaWilliams2016" class="citation book cs1">Bringmann, Karl; Grandoni, Fabrizio; <a href="/wiki/Barna_Saha" title="Barna Saha">Saha, Barna</a>; <a href="/wiki/Virginia_Vassilevska_Williams" title="Virginia Vassilevska Williams">Williams, Virginia Vassilevska</a> (2016). <a rel="nofollow" class="external text" href="https://theory.stanford.edu/~virgi/RNAfold.pdf">"Truly Sub-cubic Algorithms for Language Edit Distance and RNA-Folding via Fast Bounded-Difference Min-Plus Product"</a> <span class="cs1-format">(PDF)</span>. <i>2016 IEEE 57th Annual Symposium on Foundations of Computer Science (FOCS)</i>. pp. <span class="nowrap">375–</span>384. <a href="/wiki/ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1707.05095">1707.05095</a></span>. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2Ffocs.2016.48">10.1109/focs.2016.48</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-1-5090-3933-3" title="Special:BookSources/978-1-5090-3933-3"><bdi>978-1-5090-3933-3</bdi></a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:17064578">17064578</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=Truly+Sub-cubic+Algorithms+for+Language+Edit+Distance+and+RNA-Folding+via+Fast+Bounded-Difference+Min-Plus+Product&rft.btitle=2016+IEEE+57th+Annual+Symposium+on+Foundations+of+Computer+Science+%28FOCS%29&rft.pages=%3Cspan+class%3D%22nowrap%22%3E375-%3C%2Fspan%3E384&rft.date=2016&rft_id=info%3Aarxiv%2F1707.05095&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A17064578%23id-name%3DS2CID&rft_id=info%3Adoi%2F10.1109%2Ffocs.2016.48&rft.isbn=978-1-5090-3933-3&rft.aulast=Bringmann&rft.aufirst=Karl&rft.au=Grandoni%2C+Fabrizio&rft.au=Saha%2C+Barna&rft.au=Williams%2C+Virginia+Vassilevska&rft_id=https%3A%2F%2Ftheory.stanford.edu%2F~virgi%2FRNAfold.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-15">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFAhoPeterson1972" class="citation journal cs1">Aho, A.; Peterson, T. (1972-12-01). "A Minimum Distance Error-Correcting Parser for Context-Free Languages". <i>SIAM Journal on Computing</i>. <b>1</b> (4): <span class="nowrap">305–</span>312. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1137%2F0201022">10.1137/0201022</a>. <a href="/wiki/ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a> <a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0097-5397">0097-5397</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=SIAM+Journal+on+Computing&rft.atitle=A+Minimum+Distance+Error-Correcting+Parser+for+Context-Free+Languages&rft.volume=1&rft.issue=4&rft.pages=%3Cspan+class%3D%22nowrap%22%3E305-%3C%2Fspan%3E312&rft.date=1972-12-01&rft_id=info%3Adoi%2F10.1137%2F0201022&rft.issn=0097-5397&rft.aulast=Aho&rft.aufirst=A.&rft.au=Peterson%2C+T.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-16">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFWagner1974" class="citation journal cs1">Wagner, Robert A. (1974). <a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F360980.360995">"Order-n correction for regular languages"</a>. <i>Communications of the ACM</i>. <b>17</b> (5): <span class="nowrap">265–</span>268. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1145%2F360980.360995">10.1145/360980.360995</a></span>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:11063282">11063282</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.jtitle=Communications+of+the+ACM&rft.atitle=Order-n+correction+for+regular+languages&rft.volume=17&rft.issue=5&rft.pages=%3Cspan+class%3D%22nowrap%22%3E265-%3C%2Fspan%3E268&rft.date=1974&rft_id=info%3Adoi%2F10.1145%2F360980.360995&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A11063282%23id-name%3DS2CID&rft.aulast=Wagner&rft.aufirst=Robert+A.&rft_id=https%3A%2F%2Fdoi.org%2F10.1145%252F360980.360995&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> <li id="cite_note-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-17">^</a></b></span> <span class="reference-text"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSaha2014" class="citation conference cs1"><a href="/wiki/Barna_Saha" title="Barna Saha">Saha, B.</a> (2014-10-01). <i>The Dyck Language Edit Distance Problem in Near-Linear Time</i>. 2014 IEEE 55th Annual Symposium on Foundations of Computer Science. pp. <span class="nowrap">611–</span>620. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1109%2FFOCS.2014.71">10.1109/FOCS.2014.71</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-1-4799-6517-5" title="Special:BookSources/978-1-4799-6517-5"><bdi>978-1-4799-6517-5</bdi></a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a> <a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:14806359">14806359</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=conference&rft.btitle=The+Dyck+Language+Edit+Distance+Problem+in+Near-Linear+Time&rft.pages=%3Cspan+class%3D%22nowrap%22%3E611-%3C%2Fspan%3E620&rft.date=2014-10-01&rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A14806359%23id-name%3DS2CID&rft_id=info%3Adoi%2F10.1109%2FFOCS.2014.71&rft.isbn=978-1-4799-6517-5&rft.aulast=Saha&rft.aufirst=B.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AEdit+distance" class="Z3988"></span></span> </li> </ol></div> <div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}</style><style data-mw-deduplicate="TemplateStyles:r1236075235">.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}</style></div><div role="navigation" class="navbox" aria-labelledby="Strings176" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><style data-mw-deduplicate="TemplateStyles:r1239400231">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}</style><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view"><a href="/wiki/Template:Strings" title="Template:Strings"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Strings" title="Template talk:Strings"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:Strings" title="Special:EditPage/Template:Strings"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="Strings176" style="font-size:114%;margin:0 4em"><a href="/wiki/String_(computer_science)" title="String (computer science)">Strings</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/String_metric" title="String metric">String metric</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Approximate_string_matching" title="Approximate string matching">Approximate string matching</a></li> <li><a href="/wiki/Bitap_algorithm" title="Bitap algorithm">Bitap algorithm</a></li> <li><a href="/wiki/Damerau%E2%80%93Levenshtein_distance" title="Damerau–Levenshtein distance">Damerau–Levenshtein distance</a></li> <li><a class="mw-selflink selflink">Edit distance</a></li> <li><a href="/wiki/Gestalt_pattern_matching" title="Gestalt pattern matching">Gestalt pattern matching</a></li> <li><a href="/wiki/Hamming_distance" title="Hamming distance">Hamming distance</a></li> <li><a href="/wiki/Jaro%E2%80%93Winkler_distance" title="Jaro–Winkler distance">Jaro–Winkler distance</a></li> <li><a href="/wiki/Lee_distance" title="Lee distance">Lee distance</a></li> <li><a href="/wiki/Levenshtein_automaton" title="Levenshtein automaton">Levenshtein automaton</a></li> <li><a href="/wiki/Levenshtein_distance" title="Levenshtein distance">Levenshtein distance</a></li> <li><a href="/wiki/Wagner%E2%80%93Fischer_algorithm" title="Wagner–Fischer algorithm">Wagner–Fischer algorithm </a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/String-searching_algorithm" title="String-searching algorithm">String-searching algorithm</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Apostolico%E2%80%93Giancarlo_algorithm" title="Apostolico–Giancarlo algorithm">Apostolico–Giancarlo algorithm</a></li> <li><a href="/wiki/Boyer%E2%80%93Moore_string-search_algorithm" title="Boyer–Moore string-search algorithm">Boyer–Moore string-search algorithm</a></li> <li><a href="/wiki/Boyer%E2%80%93Moore%E2%80%93Horspool_algorithm" title="Boyer–Moore–Horspool algorithm">Boyer–Moore–Horspool algorithm</a></li> <li><a href="/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm" title="Knuth–Morris–Pratt algorithm">Knuth–Morris–Pratt algorithm</a></li> <li><a href="/wiki/Rabin%E2%80%93Karp_algorithm" title="Rabin–Karp algorithm">Rabin–Karp algorithm</a></li> <li><a href="/wiki/Raita_algorithm" title="Raita algorithm">Raita algorithm</a></li> <li><a href="/wiki/Trigram_search" title="Trigram search">Trigram search</a></li> <li><a href="/wiki/Two-way_string-matching_algorithm" title="Two-way string-matching algorithm">Two-way string-matching algorithm</a></li> <li><a href="/wiki/Zhu%E2%80%93Takaoka_string_matching_algorithm" title="Zhu–Takaoka string matching algorithm">Zhu–Takaoka string matching algorithm</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Multiple string searching</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Aho%E2%80%93Corasick_algorithm" title="Aho–Corasick algorithm">Aho–Corasick</a></li> <li><a href="/wiki/Commentz-Walter_algorithm" title="Commentz-Walter algorithm">Commentz-Walter algorithm</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/Regular_expression" title="Regular expression">Regular expression</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Comparison_of_regular-expression_engines" class="mw-redirect" title="Comparison of regular-expression engines">Comparison of regular-expression engines</a></li> <li><a href="/wiki/Regular_grammar" title="Regular grammar">Regular grammar</a></li> <li><a href="/wiki/Thompson%27s_construction" title="Thompson's construction">Thompson's construction</a></li> <li><a href="/wiki/Nondeterministic_finite_automaton" title="Nondeterministic finite automaton">Nondeterministic finite automaton</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/Sequence_alignment" title="Sequence alignment">Sequence alignment</a></th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/BLAST_(biotechnology)" title="BLAST (biotechnology)">BLAST</a></li> <li><a href="/wiki/Hirschberg%27s_algorithm" title="Hirschberg's algorithm">Hirschberg's algorithm</a></li> <li><a href="/wiki/Needleman%E2%80%93Wunsch_algorithm" title="Needleman–Wunsch algorithm">Needleman–Wunsch algorithm</a></li> <li><a href="/wiki/Smith%E2%80%93Waterman_algorithm" title="Smith–Waterman algorithm">Smith–Waterman algorithm</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%"><a href="/wiki/Data_structure" title="Data structure">Data structure</a></th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Deterministic_acyclic_finite_state_automaton" title="Deterministic acyclic finite state automaton">DAFSA</a></li> <li><a href="/wiki/Substring_index" title="Substring index">Substring index</a> <ul><li><a href="/wiki/Suffix_array" title="Suffix array">Suffix array</a></li> <li><a href="/wiki/Suffix_automaton" title="Suffix automaton">Suffix automaton</a></li> <li><a href="/wiki/Suffix_tree" title="Suffix tree">Suffix tree</a></li> <li><a href="/wiki/Compressed_suffix_array" title="Compressed suffix array">Compressed suffix array</a></li> <li><a href="/wiki/LCP_array" title="LCP array">LCP array</a></li> <li><a href="/wiki/FM-index" title="FM-index">FM-index</a></li></ul></li> <li><a href="/wiki/Generalized_suffix_tree" title="Generalized suffix tree">Generalized suffix tree</a></li> <li><a href="/wiki/Rope_(data_structure)" title="Rope (data structure)">Rope</a></li> <li><a href="/wiki/Ternary_search_tree" title="Ternary search tree">Ternary search tree</a></li> <li><a href="/wiki/Trie" title="Trie">Trie</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Other</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Parsing" title="Parsing">Parsing</a></li> <li><a href="/wiki/Pattern_matching" title="Pattern matching">Pattern matching</a></li> <li><a href="/wiki/Compressed_pattern_matching" title="Compressed pattern matching">Compressed pattern matching</a></li> <li><a href="/wiki/Longest_common_subsequence" title="Longest common subsequence">Longest common subsequence</a></li> <li><a href="/wiki/Longest_common_substring" title="Longest common substring">Longest common substring</a></li> <li><a href="/wiki/Sequential_pattern_mining" title="Sequential pattern mining">Sequential pattern mining</a></li> <li><a href="/wiki/Category:String_sorting_algorithms" title="Category:String sorting algorithms">Sorting</a></li> <li><a href="/wiki/Semi-Thue_system" title="Semi-Thue system">String rewriting systems</a></li> <li><a href="/wiki/String_operations" title="String operations">String operations</a></li></ul> </div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐web.eqiad.main‐7f88f964d6‐s45x9 Cached time: 20250219124629 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1, show‐toc] CPU time usage: 0.393 seconds Real time usage: 0.555 seconds Preprocessor visited node count: 3261/1000000 Post‐expand include size: 64524/2097152 bytes Template argument size: 2156/2097152 bytes Highest expansion depth: 16/100 Expensive parser function count: 2/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 78994/5000000 bytes Lua time usage: 0.222/10.000 seconds Lua memory usage: 6023408/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 421.824 1 -total 43.62% 184.018 1 Template:Reflist 30.84% 130.106 11 Template:Cite_journal 17.32% 73.073 1 Template:Strings 16.56% 69.858 1 Template:Navbox 14.14% 59.646 1 Template:Short_description 10.79% 45.494 4 Template:Rp 9.50% 40.091 4 Template:R/superscript 8.78% 37.017 2 Template:Pagetype 5.92% 24.979 1 Template:Main --> <!-- Saved in parser cache with key enwiki:pcache:406427:|#|:idhash:canonical and timestamp 20250219124629 and revision id 1259445915. Rendering was triggered because: page-view --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?useformat=desktop&type=1x1&usesul3=0" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=Edit_distance&oldid=1259445915">https://en.wikipedia.org/w/index.php?title=Edit_distance&oldid=1259445915</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Category</a>: <ul><li><a href="/wiki/Category:String_metrics" title="Category:String metrics">String metrics</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden categories: <ul><li><a href="/wiki/Category:Articles_with_short_description" title="Category:Articles with short description">Articles with short description</a></li><li><a href="/wiki/Category:Short_description_is_different_from_Wikidata" title="Category:Short description is different from Wikidata">Short description is different from Wikidata</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 25 November 2024, at 05:36<span class="anonymous-show"> (UTC)</span>.</li> <li id="footer-info-copyright">Text is available under the <a href="/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_4.0_International_License" title="Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use" class="extiw" title="foundation:Special:MyLanguage/Policy:Terms of Use">Terms of Use</a> and <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy" class="extiw" title="foundation:Special:MyLanguage/Policy:Privacy policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a rel="nofollow" class="external text" href="https://wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:About">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:General_disclaimer">Disclaimers</a></li> <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/en.wikipedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//en.m.wikipedia.org/w/index.php?title=Edit_distance&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" lang="en" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><picture><source media="(min-width: 500px)" srcset="/w/resources/assets/poweredby_mediawiki.svg" width="88" height="31"><img src="/w/resources/assets/mediawiki_compact.svg" alt="Powered by MediaWiki" width="25" height="25" loading="lazy"></picture></a></li> </ul> </footer> </div> </div> </div> <div class="vector-header-container vector-sticky-header-container"> <div id="vector-sticky-header" class="vector-sticky-header"> <div class="vector-sticky-header-start"> <div class="vector-sticky-header-icon-start vector-button-flush-left vector-button-flush-right" aria-hidden="true"> <button class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-sticky-header-search-toggle" tabindex="-1" data-event-name="ui.vector-sticky-search-form.icon"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </button> </div> <div role="search" class="vector-search-box-vue vector-search-box-show-thumbnail vector-search-box"> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail"> <form action="/w/index.php" id="vector-sticky-search-form" class="cdx-search-input cdx-search-input--has-end-button"> <div class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search Wikipedia"> <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <div class="vector-sticky-header-context-bar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-sticky-header-toc" class="vector-dropdown mw-portlet mw-portlet-sticky-header-toc vector-sticky-header-toc vector-button-flush-left" > <input type="checkbox" id="vector-sticky-header-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-sticky-header-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-sticky-header-toc-label" for="vector-sticky-header-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-sticky-header-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div class="vector-sticky-header-context-bar-primary" aria-hidden="true" ><span class="mw-page-title-main">Edit distance</span></div> </div> </div> <div class="vector-sticky-header-end" aria-hidden="true"> <div class="vector-sticky-header-icons"> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-talk-sticky-header" tabindex="-1" data-event-name="talk-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbles mw-ui-icon-wikimedia-speechBubbles"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-subject-sticky-header" tabindex="-1" data-event-name="subject-sticky-header"><span class="vector-icon mw-ui-icon-article mw-ui-icon-wikimedia-article"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-history-sticky-header" tabindex="-1" data-event-name="history-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-history mw-ui-icon-wikimedia-wikimedia-history"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only mw-watchlink" id="ca-watchstar-sticky-header" tabindex="-1" data-event-name="watch-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-star mw-ui-icon-wikimedia-wikimedia-star"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-edit-sticky-header" tabindex="-1" data-event-name="wikitext-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-wikiText mw-ui-icon-wikimedia-wikimedia-wikiText"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-ve-edit-sticky-header" tabindex="-1" data-event-name="ve-edit-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-edit mw-ui-icon-wikimedia-wikimedia-edit"></span> <span></span> </a> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only" id="ca-viewsource-sticky-header" tabindex="-1" data-event-name="ve-edit-protected-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-editLock mw-ui-icon-wikimedia-wikimedia-editLock"></span> <span></span> </a> </div> <div class="vector-sticky-header-buttons"> <button class="cdx-button cdx-button--weight-quiet mw-interlanguage-selector" id="p-lang-btn-sticky-header" tabindex="-1" data-event-name="ui.dropdown-p-lang-btn-sticky-header"><span class="vector-icon mw-ui-icon-wikimedia-language mw-ui-icon-wikimedia-wikimedia-language"></span> <span>3 languages</span> </button> <a href="#" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive" id="ca-addsection-sticky-header" tabindex="-1" data-event-name="addsection-sticky-header"><span class="vector-icon mw-ui-icon-speechBubbleAdd-progressive mw-ui-icon-wikimedia-speechBubbleAdd-progressive"></span> <span>Add topic</span> </a> </div> <div class="vector-sticky-header-icon-end"> <div class="vector-user-links"> </div> </div> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-65b64b4b74-5vs88","wgBackendResponseTime":135,"wgPageParseReport":{"limitreport":{"cputime":"0.393","walltime":"0.555","ppvisitednodes":{"value":3261,"limit":1000000},"postexpandincludesize":{"value":64524,"limit":2097152},"templateargumentsize":{"value":2156,"limit":2097152},"expansiondepth":{"value":16,"limit":100},"expensivefunctioncount":{"value":2,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":78994,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 421.824 1 -total"," 43.62% 184.018 1 Template:Reflist"," 30.84% 130.106 11 Template:Cite_journal"," 17.32% 73.073 1 Template:Strings"," 16.56% 69.858 1 Template:Navbox"," 14.14% 59.646 1 Template:Short_description"," 10.79% 45.494 4 Template:Rp"," 9.50% 40.091 4 Template:R/superscript"," 8.78% 37.017 2 Template:Pagetype"," 5.92% 24.979 1 Template:Main"]},"scribunto":{"limitreport-timeusage":{"value":"0.222","limit":"10.000"},"limitreport-memusage":{"value":6023408,"limit":52428800}},"cachereport":{"origin":"mw-web.eqiad.main-7f88f964d6-s45x9","timestamp":"20250219124629","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Edit distance","url":"https:\/\/en.wikipedia.org\/wiki\/Edit_distance","sameAs":"http:\/\/www.wikidata.org\/entity\/Q5338467","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q5338467","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2003-12-18T04:50:38Z","dateModified":"2024-11-25T05:36:29Z","headline":"class of string similarity metrics that count the number of operations to transform one string into another"}</script> </body> </html>