CINXE.COM

Distance matrix - Wikipedia

<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-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-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Distance matrix - Wikipedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-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-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":"970583d3-ad09-4328-8811-cbe3ad152e18","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Distance_matrix","wgTitle":"Distance matrix","wgCurRevisionId":1258478455,"wgRevisionId":1258478455,"wgArticleId":831350,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles with short description","Short description is different from Wikidata","Articles needing additional references from February 2017","All articles needing additional references","Articles to be expanded from December 2023","Articles needing cleanup from December 2023","All pages needing cleanup","Cleanup tagged articles with a reason field from December 2023","Wikipedia pages needing cleanup from December 2023","Metric geometry","Bioinformatics","Matrices","Graph distance"] ,"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Distance_matrix","wgRelevantArticleId":831350,"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":30000,"wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId": "Q901698","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","mediawiki.page.media","ext.scribunto.logs","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","mmv.bootstrap","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","wikibase.sidebar.tracking"];</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&amp;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&amp;only=styles&amp;skin=vector-2022"> <script async="" src="/w/load.php?lang=en&amp;modules=startup&amp;only=scripts&amp;raw=1&amp;skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&amp;modules=site.styles&amp;only=styles&amp;skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <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="Distance matrix - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikipedia.org/wiki/Distance_matrix"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Distance_matrix&amp;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/Distance_matrix"> <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&amp;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-Distance_matrix rootpage-Distance_matrix 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" > <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> </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&#039;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/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;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&amp;returnto=Distance+matrix" 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&amp;returnto=Distance+matrix" title="You&#039;re encouraged to log in; however, it&#039;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/wiki/Special:FundraiserRedirector?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=C13_en.wikipedia.org&amp;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&amp;returnto=Distance+matrix" 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&amp;returnto=Distance+matrix" title="You&#039;re encouraged to log in; however, it&#039;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-Non-metric_distance_matrix" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Non-metric_distance_matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Non-metric distance matrix</span> </div> </a> <ul id="toc-Non-metric_distance_matrix-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Metric_distance_matrix" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Metric_distance_matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Metric distance matrix</span> </div> </a> <ul id="toc-Metric_distance_matrix-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Additive_distance_matrix" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Additive_distance_matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Additive distance matrix</span> </div> </a> <ul id="toc-Additive_distance_matrix-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Ultrametric_distance_matrix" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Ultrametric_distance_matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Ultrametric distance matrix</span> </div> </a> <ul id="toc-Ultrametric_distance_matrix-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Bioinformatics" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Bioinformatics"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Bioinformatics</span> </div> </a> <button aria-controls="toc-Bioinformatics-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 Bioinformatics subsection</span> </button> <ul id="toc-Bioinformatics-sublist" class="vector-toc-list"> <li id="toc-Sequence_alignment" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Sequence_alignment"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1</span> <span>Sequence alignment</span> </div> </a> <ul id="toc-Sequence_alignment-sublist" class="vector-toc-list"> <li id="toc-Global_alignment" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Global_alignment"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1.1</span> <span>Global alignment</span> </div> </a> <ul id="toc-Global_alignment-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Local_alignment" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Local_alignment"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1.2</span> <span>Local alignment</span> </div> </a> <ul id="toc-Local_alignment-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Multiple_sequence_alignment" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Multiple_sequence_alignment"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1.3</span> <span>Multiple sequence alignment</span> </div> </a> <ul id="toc-Multiple_sequence_alignment-sublist" class="vector-toc-list"> <li id="toc-MAFFT" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#MAFFT"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1.3.1</span> <span>MAFFT</span> </div> </a> <ul id="toc-MAFFT-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Phylogenetic_analysis" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Phylogenetic_analysis"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2</span> <span>Phylogenetic analysis</span> </div> </a> <ul id="toc-Phylogenetic_analysis-sublist" class="vector-toc-list"> <li id="toc-Distance_matrix_methods" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Distance_matrix_methods"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1</span> <span>Distance matrix methods</span> </div> </a> <ul id="toc-Distance_matrix_methods-sublist" class="vector-toc-list"> <li id="toc-Additive_tree_reconstruction" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#Additive_tree_reconstruction"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1.1</span> <span>Additive tree reconstruction</span> </div> </a> <ul id="toc-Additive_tree_reconstruction-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-UPGMA" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#UPGMA"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1.2</span> <span>UPGMA</span> </div> </a> <ul id="toc-UPGMA-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Neighbor_joining" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#Neighbor_joining"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1.3</span> <span>Neighbor joining</span> </div> </a> <ul id="toc-Neighbor_joining-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Fitch–Margoliash" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#Fitch–Margoliash"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1.4</span> <span>Fitch–Margoliash</span> </div> </a> <ul id="toc-Fitch–Margoliash-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Data_Mining_and_Machine_Learning" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Data_Mining_and_Machine_Learning"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Data Mining and Machine Learning</span> </div> </a> <button aria-controls="toc-Data_Mining_and_Machine_Learning-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 Data Mining and Machine Learning subsection</span> </button> <ul id="toc-Data_Mining_and_Machine_Learning-sublist" class="vector-toc-list"> <li id="toc-Data_Mining" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Data_Mining"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1</span> <span>Data Mining</span> </div> </a> <ul id="toc-Data_Mining-sublist" class="vector-toc-list"> <li id="toc-Hierarchical_clustering" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Hierarchical_clustering"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1.1</span> <span>Hierarchical clustering</span> </div> </a> <ul id="toc-Hierarchical_clustering-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Machine_Learning" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Machine_Learning"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2</span> <span>Machine Learning</span> </div> </a> <ul id="toc-Machine_Learning-sublist" class="vector-toc-list"> <li id="toc-K-Nearest_Neighbors" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#K-Nearest_Neighbors"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2.1</span> <span>K-Nearest Neighbors</span> </div> </a> <ul id="toc-K-Nearest_Neighbors-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Computer_Vision" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Computer_Vision"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.3</span> <span>Computer Vision</span> </div> </a> <ul id="toc-Computer_Vision-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Information_retrieval" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Information_retrieval"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Information retrieval</span> </div> </a> <button aria-controls="toc-Information_retrieval-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 Information retrieval subsection</span> </button> <ul id="toc-Information_retrieval-sublist" class="vector-toc-list"> <li id="toc-Distance_matrices_using_Gaussian_mixture_distance" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Distance_matrices_using_Gaussian_mixture_distance"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.1</span> <span>Distance matrices using Gaussian mixture distance</span> </div> </a> <ul id="toc-Distance_matrices_using_Gaussian_mixture_distance-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Evaluation_of_the_similarity_or_dissimilarity_of_Cosine_similarity_and_Distance_matrices" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Evaluation_of_the_similarity_or_dissimilarity_of_Cosine_similarity_and_Distance_matrices"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.2</span> <span>Evaluation of the similarity or dissimilarity of Cosine similarity and Distance matrices</span> </div> </a> <ul id="toc-Evaluation_of_the_similarity_or_dissimilarity_of_Cosine_similarity_and_Distance_matrices-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Clustering_Documents" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Clustering_Documents"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.3</span> <span>Clustering Documents</span> </div> </a> <ul id="toc-Clustering_Documents-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Isomap" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Isomap"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.4</span> <span>Isomap</span> </div> </a> <ul id="toc-Isomap-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Neighborhood_Retrieval_Visualizer_(NeRV)" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Neighborhood_Retrieval_Visualizer_(NeRV)"> <div class="vector-toc-text"> <span class="vector-toc-numb">7.5</span> <span>Neighborhood Retrieval Visualizer (NeRV)</span> </div> </a> <ul id="toc-Neighborhood_Retrieval_Visualizer_(NeRV)-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Chemistry" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Chemistry"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>Chemistry</span> </div> </a> <button aria-controls="toc-Chemistry-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 Chemistry subsection</span> </button> <ul id="toc-Chemistry-sublist" class="vector-toc-list"> <li id="toc-Interconversion_mechanisms_between_two_permutational_isomers" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Interconversion_mechanisms_between_two_permutational_isomers"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.1</span> <span>Interconversion mechanisms between two permutational isomers</span> </div> </a> <ul id="toc-Interconversion_mechanisms_between_two_permutational_isomers-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Distance_Polynomials_and_Distance_Spectra" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Distance_Polynomials_and_Distance_Spectra"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.2</span> <span>Distance Polynomials and Distance Spectra</span> </div> </a> <ul id="toc-Distance_Polynomials_and_Distance_Spectra-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Structure-property_model" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Structure-property_model"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.3</span> <span>Structure-property model</span> </div> </a> <ul id="toc-Structure-property_model-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Graph-theoretical_Distance_matrix" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Graph-theoretical_Distance_matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.4</span> <span>Graph-theoretical Distance matrix</span> </div> </a> <ul id="toc-Graph-theoretical_Distance_matrix-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Geometric-Distance_Matrix" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Geometric-Distance_Matrix"> <div class="vector-toc-text"> <span class="vector-toc-numb">8.5</span> <span>Geometric-Distance Matrix</span> </div> </a> <ul id="toc-Geometric-Distance_Matrix-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Other_Applications" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Other_Applications"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>Other Applications</span> </div> </a> <button aria-controls="toc-Other_Applications-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 Other Applications subsection</span> </button> <ul id="toc-Other_Applications-sublist" class="vector-toc-list"> <li id="toc-Time_Series_Analysis" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Time_Series_Analysis"> <div class="vector-toc-text"> <span class="vector-toc-numb">9.1</span> <span>Time Series Analysis</span> </div> </a> <ul id="toc-Time_Series_Analysis-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Examples" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Examples"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>Examples</span> </div> </a> <ul id="toc-Examples-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</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"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</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" > <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">Distance matrix</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 11 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-11" 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">11 languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-cs mw-list-item"><a href="https://cs.wikipedia.org/wiki/Matice_vzd%C3%A1lenost%C3%AD" title="Matice vzdáleností – Czech" lang="cs" hreflang="cs" data-title="Matice vzdáleností" data-language-autonym="Čeština" data-language-local-name="Czech" class="interlanguage-link-target"><span>Čeština</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Distanzmatrix" title="Distanzmatrix – German" lang="de" hreflang="de" data-title="Distanzmatrix" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Matriz_de_distancias" title="Matriz de distancias – Spanish" lang="es" hreflang="es" data-title="Matriz de distancias" data-language-autonym="Español" data-language-local-name="Spanish" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%D9%85%D8%A7%D8%AA%D8%B1%DB%8C%D8%B3_%D9%81%D8%A7%D8%B5%D9%84%D9%87" title="ماتریس فاصله – Persian" lang="fa" hreflang="fa" data-title="ماتریس فاصله" data-language-autonym="فارسی" data-language-local-name="Persian" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EA%B1%B0%EB%A6%AC_%ED%96%89%EB%A0%AC" title="거리 행렬 – Korean" lang="ko" hreflang="ko" data-title="거리 행렬" data-language-autonym="한국어" data-language-local-name="Korean" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E8%B7%9D%E9%9B%A2%E8%A1%8C%E5%88%97" title="距離行列 – Japanese" lang="ja" hreflang="ja" data-title="距離行列" data-language-autonym="日本語" data-language-local-name="Japanese" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Matriz_de_dist%C3%A2ncias" title="Matriz de distâncias – Portuguese" lang="pt" hreflang="pt" data-title="Matriz de distâncias" data-language-autonym="Português" data-language-local-name="Portuguese" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%9C%D0%B0%D1%82%D1%80%D0%B8%D1%86%D0%B0_%D1%80%D0%B0%D1%81%D1%81%D1%82%D0%BE%D1%8F%D0%BD%D0%B8%D0%B9" title="Матрица расстояний – Russian" lang="ru" hreflang="ru" data-title="Матрица расстояний" data-language-autonym="Русский" data-language-local-name="Russian" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-sl mw-list-item"><a href="https://sl.wikipedia.org/wiki/Matrika_razdalj" title="Matrika razdalj – Slovenian" lang="sl" hreflang="sl" data-title="Matrika razdalj" data-language-autonym="Slovenščina" data-language-local-name="Slovenian" class="interlanguage-link-target"><span>Slovenščina</span></a></li><li class="interlanguage-link interwiki-vi mw-list-item"><a href="https://vi.wikipedia.org/wiki/Ma_tr%E1%BA%ADn_kho%E1%BA%A3ng_c%C3%A1ch" title="Ma trận khoảng cách – Vietnamese" lang="vi" hreflang="vi" data-title="Ma trận khoảng cách" data-language-autonym="Tiếng Việt" data-language-local-name="Vietnamese" class="interlanguage-link-target"><span>Tiếng Việt</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E8%B7%9D%E7%A6%BB%E7%9F%A9%E9%98%B5" 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/Q901698#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/Distance_matrix" 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:Distance_matrix" 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/Distance_matrix"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Distance_matrix&amp;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=Distance_matrix&amp;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/Distance_matrix"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Distance_matrix&amp;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=Distance_matrix&amp;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/Distance_matrix" 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/Distance_matrix" 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="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Distance_matrix&amp;oldid=1258478455" 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=Distance_matrix&amp;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&amp;page=Distance_matrix&amp;id=1258478455&amp;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&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDistance_matrix"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FDistance_matrix"><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&amp;page=Distance_matrix&amp;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=Distance_matrix&amp;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/Q901698" 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">Square matrix containing the distances between elements in a set</div> <style data-mw-deduplicate="TemplateStyles:r1251242444">.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}</style><table class="box-More_citations_needed plainlinks metadata ambox ambox-content ambox-Refimprove" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><a href="/wiki/File:Question_book-new.svg" class="mw-file-description"><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/50px-Question_book-new.svg.png" decoding="async" width="50" height="39" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/75px-Question_book-new.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/9/99/Question_book-new.svg/100px-Question_book-new.svg.png 2x" data-file-width="512" data-file-height="399" /></a></span></div></td><td class="mbox-text"><div class="mbox-text-span">This article <b>needs additional citations for <a href="/wiki/Wikipedia:Verifiability" title="Wikipedia:Verifiability">verification</a></b>.<span class="hide-when-compact"> Please help <a href="/wiki/Special:EditPage/Distance_matrix" title="Special:EditPage/Distance matrix">improve this article</a> by <a href="/wiki/Help:Referencing_for_beginners" title="Help:Referencing for beginners">adding citations to reliable sources</a>. Unsourced material may be challenged and removed.<br /><small><span class="plainlinks"><i>Find sources:</i>&#160;<a rel="nofollow" class="external text" href="https://www.google.com/search?as_eq=wikipedia&amp;q=%22Distance+matrix%22">"Distance matrix"</a>&#160;–&#160;<a rel="nofollow" class="external text" href="https://www.google.com/search?tbm=nws&amp;q=%22Distance+matrix%22+-wikipedia&amp;tbs=ar:1">news</a>&#160;<b>·</b> <a rel="nofollow" class="external text" href="https://www.google.com/search?&amp;q=%22Distance+matrix%22&amp;tbs=bkt:s&amp;tbm=bks">newspapers</a>&#160;<b>·</b> <a rel="nofollow" class="external text" href="https://www.google.com/search?tbs=bks:1&amp;q=%22Distance+matrix%22+-wikipedia">books</a>&#160;<b>·</b> <a rel="nofollow" class="external text" href="https://scholar.google.com/scholar?q=%22Distance+matrix%22">scholar</a>&#160;<b>·</b> <a rel="nofollow" class="external text" href="https://www.jstor.org/action/doBasicSearch?Query=%22Distance+matrix%22&amp;acc=on&amp;wc=on">JSTOR</a></span></small></span> <span class="date-container"><i>(<span class="date">February 2017</span>)</i></span><span class="hide-when-compact"><i> (<small><a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove this message</a></small>)</i></span></div></td></tr></tbody></table> <p>In <a href="/wiki/Mathematics" title="Mathematics">mathematics</a>, <a href="/wiki/Computer_science" title="Computer science">computer science</a> and especially <a href="/wiki/Graph_theory" title="Graph theory">graph theory</a>, a <b>distance matrix</b> is a <a href="/wiki/Square_matrix" title="Square matrix">square matrix</a> (two-dimensional array) containing the <a href="/wiki/Distance" title="Distance">distances</a>, taken pairwise, between the elements of a set.<sup id="cite_ref-1" class="reference"><a href="#cite_note-1"><span class="cite-bracket">&#91;</span>1<span class="cite-bracket">&#93;</span></a></sup> Depending upon the application involved, the <i>distance</i> being used to define this matrix may or may not be a <a href="/wiki/Metric_(mathematics)" class="mw-redirect" title="Metric (mathematics)">metric</a>. If there are <span class="texhtml mvar" style="font-style:italic;">N</span> elements, this matrix will have size <span class="texhtml"><i>N</i>&#215;<i>N</i></span>. In graph-theoretic applications, the elements are more often referred to as points, nodes or vertices. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Non-metric_distance_matrix">Non-metric distance matrix</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=1" title="Edit section: Non-metric distance matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>In general, a distance matrix is a weighted <a href="/wiki/Adjacency_matrix" title="Adjacency matrix">adjacency matrix</a> of some graph. In a <a href="/wiki/Network_(mathematics)" class="mw-redirect" title="Network (mathematics)">network</a>, a <a href="/wiki/Directed_graph" title="Directed graph">directed graph</a> with weights assigned to the arcs, the distance between two nodes of the network can be defined as the minimum of the sums of the weights on the shortest paths joining the two nodes (where the number of steps in the path is bounded).<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">&#91;</span>2<span class="cite-bracket">&#93;</span></a></sup> This distance function, while well defined, is not a metric. There need be no restrictions on the weights other than the need to be able to combine and compare them, so negative weights are used in some applications. Since paths are directed, symmetry can not be guaranteed, and if negative-weight cycles exist the distance matrix may not be <a href="/wiki/Hollow_matrix" title="Hollow matrix">hollow</a> (and in the absence of a bound on the step count, the matrix may be undefined). </p><p>An algebraic formulation of the above can be obtained by using the <a href="/wiki/Min-plus_algebra" class="mw-redirect" title="Min-plus algebra">min-plus algebra</a>. Matrix multiplication in this system is defined as follows: Given two <span class="texhtml"><i>n</i> × <i>n</i></span> matrices <span class="texhtml"><i>A</i> = (<i>a<sub>ij</sub></i>)</span> and <span class="texhtml"><i>B</i> = (<i>b<sub>ij</sub></i>)</span>, their distance product <span class="texhtml"><i>C</i> = (<i>c<sub>ij</sub></i>) = <i>A</i> ⭑ <i>B</i></span> is defined as an <span class="texhtml"><i>n</i> × <i>n</i></span> matrix such that </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 c_{ij}=\min _{k=1}^{n}\{a_{ik}+b_{kj}\}.}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>c</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mi>j</mi> </mrow> </msub> <mo>=</mo> <munderover> <mo movablelimits="true" form="prefix">min</mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>=</mo> <mn>1</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </munderover> <mo fence="false" stretchy="false">{</mo> <msub> <mi>a</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> <mi>k</mi> </mrow> </msub> <mo>+</mo> <msub> <mi>b</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mi>j</mi> </mrow> </msub> <mo fence="false" stretchy="false">}</mo> <mo>.</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle c_{ij}=\min _{k=1}^{n}\{a_{ik}+b_{kj}\}.}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b439fdd01dee86b137fedbb39ac16a73a294be2d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.005ex; width:20.92ex; height:5.176ex;" alt="{\displaystyle c_{ij}=\min _{k=1}^{n}\{a_{ik}+b_{kj}\}.}"></span></dd></dl> <p>Note that the off-diagonal elements that are not connected directly will need to be set to infinity or a suitable large value for the min-plus operations to work correctly. A zero in these locations will be incorrectly interpreted as an edge with no distance, cost, etc. </p><p>If <span class="texhtml mvar" style="font-style:italic;">W</span> is an <span class="texhtml"><i>n</i> × <i>n</i></span> matrix containing the edge weights of a <a href="/wiki/Graph_(discrete_mathematics)" title="Graph (discrete mathematics)">graph</a>, then <span class="texhtml mvar" style="font-style:italic;">W<sup>k</sup></span> (using this distance product) gives the distances between vertices using paths of length at most <span class="texhtml mvar" style="font-style:italic;">k</span> edges, and so is the distance matrix of the graph when the step count bound is set to <i>k</i>. If there are no loops of negative weight, <span class="texhtml mvar" style="font-style:italic;">W<sup>n</sup></span> will give the true distance matrix, with no bound, because removing repeated vertices from a path cannot lower its weight. On the other hand, if <i>i</i> and <i>j</i> are on a negative-weight loop, <span class="texhtml mvar" style="font-style:italic;">W<sup>k</sup><sub>ij</sub></span> will decrease without bound as <i>k</i> increases. </p><p>An arbitrary graph <span class="texhtml mvar" style="font-style:italic;">G</span> on <span class="texhtml mvar" style="font-style:italic;">n</span> vertices can be modeled as a weighted <a href="/wiki/Complete_graph" title="Complete graph">complete graph</a> on <span class="texhtml mvar" style="font-style:italic;">n</span> vertices by assigning a weight of one to each edge of the complete graph that corresponds to an edge of <span class="texhtml mvar" style="font-style:italic;">G</span> and infinity to all other edges. <span class="texhtml mvar" style="font-style:italic;">W</span> for this complete graph is the <a href="/wiki/Adjacency_matrix" title="Adjacency matrix">adjacency matrix</a> of <span class="texhtml mvar" style="font-style:italic;">G</span>. The distance matrix of <span class="texhtml mvar" style="font-style:italic;">G</span> can be computed from <span class="texhtml mvar" style="font-style:italic;">W</span> as above; by contrast, if normal matrix multiplication is used, and unlinked vertices are represented with 0, <span class="texhtml mvar" style="font-style:italic;">W<sup>n</sup></span> would instead encode the number of paths between any two vertices of length exactly <span class="texhtml mvar" style="font-style:italic;">n</span>. </p> <div class="mw-heading mw-heading2"><h2 id="Metric_distance_matrix">Metric distance matrix</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=2" title="Edit section: Metric distance matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The value of a distance matrix formalism in many applications is in how the distance matrix can manifestly encode the <a href="/wiki/Metric_(mathematics)" class="mw-redirect" title="Metric (mathematics)">metric axioms</a> and in how it lends itself to the use of linear algebra techniques. That is, if <span class="texhtml"><i>M</i> = (<i>x<sub>ij</sub></i>)</span> with <span class="texhtml">1 ≤ <i>i</i>, <i>j</i> ≤ <i>N</i></span> is a distance matrix for a metric distance, then </p> <ol><li>the entries on the main diagonal are all zero (that is, the matrix is a <a href="/wiki/Hollow_matrix" title="Hollow matrix">hollow matrix</a>), i.e. <span class="texhtml"><i>x<sub>ii</sub></i> = 0</span> for all <span class="texhtml">1 ≤ <i>i</i> ≤ <i>N</i></span>,</li> <li>all the off-diagonal entries are positive (<span class="texhtml"><i>x<sub>ij</sub></i> &gt; 0</span> if <span class="texhtml"><i>i</i> ≠ <i>j</i></span>), (that is, a <a href="/wiki/Nonnegative_matrix" title="Nonnegative matrix">non-negative matrix</a>),</li> <li>the matrix is a <a href="/wiki/Symmetric_matrix" title="Symmetric matrix">symmetric matrix</a> (<span class="texhtml"><i>x<sub>ij</sub></i> = <i>x<sub>ji</sub></i></span>), and</li> <li>for any <span class="texhtml mvar" style="font-style:italic;">i</span> and <span class="texhtml mvar" style="font-style:italic;">j</span>, <span class="texhtml"><i>x<sub>ij</sub></i> ≤ <i>x<sub>ik</sub></i> + <i>x<sub>kj</sub></i></span> for all <span class="texhtml mvar" style="font-style:italic;">k</span> (the triangle inequality). This can be stated in terms of <a href="/wiki/Min-plus_matrix_multiplication" title="Min-plus matrix multiplication">tropical matrix multiplication</a></li></ol> <p>When a distance matrix satisfies the first three axioms (making it a semi-metric) it is sometimes referred to as a pre-distance matrix. A pre-distance matrix that can be embedded in a Euclidean space is called a <a href="/wiki/Euclidean_distance_matrix" title="Euclidean distance matrix">Euclidean distance matrix</a>. For mixed-type data that contain numerical as well as categorical descriptors, <a href="/wiki/Gower%27s_distance" title="Gower&#39;s distance">Gower's distance</a> is a common alternative. </p><p>Another common example of a metric distance matrix arises in <a href="/wiki/Coding_theory" title="Coding theory">coding theory</a> when in a <a href="/wiki/Block_code" title="Block code">block code</a> the elements are strings of fixed length over an alphabet and the distance between them is given by the <a href="/wiki/Hamming_distance" title="Hamming distance">Hamming distance</a> metric. The smallest non-zero entry in the distance matrix measures the error correcting and error detecting capability of the code. </p> <div class="mw-heading mw-heading2"><h2 id="Additive_distance_matrix">Additive distance matrix</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=3" title="Edit section: Additive distance matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>An additive distance matrix is a special type of matrix used in <a href="/wiki/Bioinformatics" title="Bioinformatics">bioinformatics</a> to build a <a href="/wiki/Phylogenetic_tree" title="Phylogenetic tree">phylogenetic tree</a>. Let <span class="texhtml mvar" style="font-style:italic;">x</span> be the lowest common ancestor between two species <span class="texhtml mvar" style="font-style:italic;">i</span> and <span class="texhtml mvar" style="font-style:italic;">j</span>, we expect <span class="texhtml mvar" style="font-style:italic;"><i>M<sub>ij</sub></i> = <i>M<sub>ix</sub></i> + <i>M<sub>xj</sub></i></span>. This is where the additive metric comes from. A distance matrix <span class="texhtml mvar" style="font-style:italic;">M</span> for a set of species <span class="texhtml mvar" style="font-style:italic;">S</span> is said to be additive if and only if there exists a phylogeny <span class="texhtml mvar" style="font-style:italic;">T</span> for <span class="texhtml mvar" style="font-style:italic;">S</span> such that: </p> <ul><li>Every edge <span class="texhtml">(<i>u</i>,<i>v</i>)</span> in <span class="texhtml mvar" style="font-style:italic;">T</span> is associated with a positive weight <span class="texhtml mvar" style="font-style:italic;">d<sub>uv</sub></span></li> <li>For every <span class="texhtml"><i>i</i>,<i>j</i> ∈ <i>S</i></span>, <span class="texhtml mvar" style="font-style:italic;">M<sub>ij</sub></span> equals the sum of the weights along the path from <span class="texhtml mvar" style="font-style:italic;">i</span> to <span class="texhtml mvar" style="font-style:italic;">j</span> in <span class="texhtml mvar" style="font-style:italic;">T</span></li></ul> <p>For this case, <span class="texhtml mvar" style="font-style:italic;">M</span> is called an additive matrix and <span class="texhtml mvar" style="font-style:italic;">T</span> is called an additive tree. Below we can see an example of an additive distance matrix and its corresponding tree: </p> <figure class="mw-halign-center" typeof="mw:File/Frameless"><a href="/wiki/File:Additive_distance_matrix.png" class="mw-file-description" title="Additive distance matrix (left) and its phylogeny tree (right)"><img alt="Additive distance matrix (left) and its phylogeny tree (right)" src="//upload.wikimedia.org/wikipedia/commons/thumb/8/80/Additive_distance_matrix.png/444px-Additive_distance_matrix.png" decoding="async" width="444" height="206" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/8/80/Additive_distance_matrix.png/666px-Additive_distance_matrix.png 1.5x, //upload.wikimedia.org/wikipedia/commons/8/80/Additive_distance_matrix.png 2x" data-file-width="861" data-file-height="400" /></a><figcaption>Additive distance matrix (left) and its phylogeny tree (right)</figcaption></figure> <div class="mw-heading mw-heading2"><h2 id="Ultrametric_distance_matrix">Ultrametric distance matrix</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=4" title="Edit section: Ultrametric distance matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The ultrametric distance matrix is defined as an additive matrix which models the constant <a href="/wiki/Molecular_clock" title="Molecular clock">molecular clock</a>. It is used to build a phylogenetic tree. A matrix <span class="texhtml mvar" style="font-style:italic;">M</span> is said to be ultrametric if there exists a tree <span class="texhtml mvar" style="font-style:italic;">T</span> such that: </p> <ul><li><span class="texhtml mvar" style="font-style:italic;">M<sub>ij</sub></span> equals the sum of the edge weights along the path from <span class="texhtml mvar" style="font-style:italic;">i</span> to <span class="texhtml mvar" style="font-style:italic;">j</span> in <span class="texhtml mvar" style="font-style:italic;">T</span></li> <li>A root of the tree can be identified with the distance to all the leaves being the same</li></ul> <p>Here is an example of an ultrametric distance matrix with its corresponding tree: </p> <figure class="mw-halign-center" typeof="mw:File/Frameless"><a href="/wiki/File:Ultrametric_tree.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/1/10/Ultrametric_tree.png/395px-Ultrametric_tree.png" decoding="async" width="395" height="207" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/10/Ultrametric_tree.png/593px-Ultrametric_tree.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/10/Ultrametric_tree.png/790px-Ultrametric_tree.png 2x" data-file-width="862" data-file-height="451" /></a><figcaption></figcaption></figure> <div class="mw-heading mw-heading2"><h2 id="Bioinformatics">Bioinformatics</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=5" title="Edit section: Bioinformatics"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1251242444"><table class="box-Missing_information plainlinks metadata ambox ambox-content" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><a href="/wiki/File:Wiki_letter_w.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/44px-Wiki_letter_w.svg.png" decoding="async" width="44" height="44" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/66px-Wiki_letter_w.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/6/6c/Wiki_letter_w.svg/88px-Wiki_letter_w.svg.png 2x" data-file-width="44" data-file-height="44" /></a></span></div></td><td class="mbox-text"><div class="mbox-text-span">This section <b>is missing information</b> about alignment-free distance measures (Mash, K(r), FastANI, Skmer etc.); need less weight on how to do alignment (especially with "dumb" DP) and more weight on how to get distance from alignment.<span class="hide-when-compact"> Please expand the section to include this information. Further details may exist on the <a href="/wiki/Talk:Distance_matrix" title="Talk:Distance matrix">talk page</a>.</span> <span class="date-container"><i>(<span class="date">December 2023</span>)</i></span></div></td></tr></tbody></table> <p>The distance matrix is widely used in the bioinformatics field, and it is present in several methods, algorithms and programs. Distance matrices are used to represent <a href="/wiki/Protein" title="Protein">protein</a> structures in a coordinate-independent manner, as well as the pairwise distances between two sequences in <a href="/wiki/Sequence_space" title="Sequence space">sequence space</a>. They are used in <a href="/wiki/Structural_alignment" title="Structural alignment">structural</a> and <a href="/wiki/Sequence_alignment" title="Sequence alignment">sequential</a> alignment, and for the determination of protein structures from <a href="/wiki/Nuclear_magnetic_resonance" title="Nuclear magnetic resonance">NMR</a> or <a href="/wiki/X-ray_crystallography" title="X-ray crystallography">X-ray crystallography</a>. </p><p>Sometimes it is more convenient to express data as a <a href="/wiki/Similarity_matrix" class="mw-redirect" title="Similarity matrix">similarity matrix</a>. </p><p>It is also used to define the <a href="/wiki/Distance_correlation" title="Distance correlation">distance correlation</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Sequence_alignment"><a href="/wiki/Sequence_alignment" title="Sequence alignment">Sequence alignment</a></h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=6" title="Edit section: Sequence alignment"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>An alignment of two sequences is formed by inserting spaces in arbitrary locations along the sequences so that they end up with the same length and there are no two spaces at the same position of the two augmented sequences.<sup id="cite_ref-:0_3-0" class="reference"><a href="#cite_note-:0-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup> One of the primary methods for sequence alignment is <a href="/wiki/Dynamic_programming" title="Dynamic programming">dynamic programming</a>. The method is used to fill the distance matrix and then obtain the alignment. In typical usage, for sequence alignment a matrix is used to assign scores to amino-acid matches or mismatches, and a gap penalty for matching an amino-acid in one sequence with a gap in the other. </p> <div class="mw-heading mw-heading4"><h4 id="Global_alignment">Global alignment</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=7" title="Edit section: Global alignment"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The <a href="/wiki/Needleman%E2%80%93Wunsch_algorithm" title="Needleman–Wunsch algorithm">Needleman–Wunsch algorithm</a> used to calculate global alignment uses dynamic programming to obtain the distance matrix. </p> <div class="mw-heading mw-heading4"><h4 id="Local_alignment">Local alignment</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=8" title="Edit section: Local alignment"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The <a href="/wiki/Smith%E2%80%93Waterman_algorithm" title="Smith–Waterman algorithm">Smith–Waterman algorithm</a> is also dynamic programming based which consists also in obtaining the distance matrix and then obtain the local alignment. </p> <div class="mw-heading mw-heading4"><h4 id="Multiple_sequence_alignment">Multiple sequence alignment</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=9" title="Edit section: Multiple sequence alignment"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><a href="/wiki/Multiple_sequence_alignment" title="Multiple sequence alignment">Multiple sequence alignment</a> is an extension of pairwise alignment to align several sequences at a time. Different MSA methods are based on the same idea of the distance matrix as global and local alignments. </p> <ul><li>Center star method. This method defines a center sequence <span class="texhtml"><i>S</i><sub>c</sub></span> which minimizes the distance between the sequence <span class="texhtml"><i>S</i><sub>c</sub></span> and any other sequence <span class="texhtml"><i>S</i><sub>i</sub></span>. Then it generates a multiple alignment <span class="texhtml">M</span> for the set of sequences <span class="texhtml"><i>S</i></span> so that for every <span class="texhtml"><i>S</i><sub>i</sub></span> the alignment distance <span class="texhtml"><i>d</i><sub><i>M</i></sub>(<i>S</i><sub>c</sub>,<i>S</i><sub>i</sub>)</span> is the optimal pairwise alignment. This method has the characteristic that the computed alignment for <span class="texhtml"><i>S</i></span> whose sum-of-pair distance is at most twice the optimal multiple alignment.</li> <li>Progressive alignment method. This heuristic method to create MSA first aligns the two most related sequences, and then it progressively aligns the next two most related sequences until all sequences are aligned.</li></ul> <p>There are other methods that have their own program due to their popularity: </p> <ul><li><a href="/wiki/Clustal" title="Clustal">ClustalW</a></li> <li><a href="/wiki/MUSCLE_(alignment_software)" title="MUSCLE (alignment software)">MUSCLE</a></li> <li><a href="/wiki/MAFFT" title="MAFFT">MAFFT</a></li> <li>MANGO</li> <li>And many more</li></ul> <div class="mw-heading mw-heading5"><h5 id="MAFFT">MAFFT</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=10" title="Edit section: MAFFT"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Multiple alignment using fast Fourier transform (MAFFT) is a program with an algorithm based on progressive alignment, and it offers various multiple alignment strategies. First, MAFFT constructs a distance matrix based on the number of shared 6-tuples. Second, it builds the guide tree based on the previous matrix. Third, it clusters the sequences with the help of the <a href="/wiki/Fast_Fourier_transform" title="Fast Fourier transform">fast Fourier transform</a> and starts the alignment. Based on the new alignment, it reconstructs the guide tree and align again. </p> <div class="mw-heading mw-heading3"><h3 id="Phylogenetic_analysis">Phylogenetic analysis</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=11" title="Edit section: Phylogenetic analysis"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1251242444"><table class="box-Cleanup plainlinks metadata ambox ambox-style ambox-Cleanup" role="presentation"><tbody><tr><td class="mbox-image"><div class="mbox-image-div"><span typeof="mw:File"><span><img alt="" src="//upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/40px-Edit-clear.svg.png" decoding="async" width="40" height="40" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/60px-Edit-clear.svg.png 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/f/f2/Edit-clear.svg/80px-Edit-clear.svg.png 2x" data-file-width="48" data-file-height="48" /></span></span></div></td><td class="mbox-text"><div class="mbox-text-span">This section may <b>require <a href="/wiki/Wikipedia:Cleanup" title="Wikipedia:Cleanup">cleanup</a></b> to meet Wikipedia's <a href="/wiki/Wikipedia:Manual_of_Style" title="Wikipedia:Manual of Style">quality standards</a>. The specific problem is: <b>Should be trimmed down and mostly packed up to the main article. That's how <a href="/wiki/Wikipedia:SPINOFF" class="mw-redirect" title="Wikipedia:SPINOFF">WP:SPINOFF</a> works, right?</b><span class="hide-when-compact"> Please help <a href="/wiki/Special:EditPage/Distance_matrix" title="Special:EditPage/Distance matrix">improve this section</a> if you can.</span> <span class="date-container"><i>(<span class="date">December 2023</span>)</i></span><span class="hide-when-compact"><i> (<small><a href="/wiki/Help:Maintenance_template_removal" title="Help:Maintenance template removal">Learn how and when to remove this message</a></small>)</i></span></div></td></tr></tbody></table> <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/Distance_matrices_in_phylogeny" title="Distance matrices in phylogeny">Distance matrices in phylogeny</a></div> <p>To perform <a href="/wiki/Phylogenetic" class="mw-redirect" title="Phylogenetic">phylogenetic</a> analysis, the first step is to reconstruct the phylogenetic tree: given a collection of species, the problem is to reconstruct or infer the ancestral relationships among the species, i.e., the phylogenetic tree among the species. Distance matrix methods perform this activity. </p> <div class="mw-heading mw-heading4"><h4 id="Distance_matrix_methods">Distance matrix methods</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=12" title="Edit section: Distance matrix methods"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Distance matrix methods of phylogenetic analysis explicitly rely on a measure of "genetic distance" between the sequences being classified, and therefore require multiple sequences as an input. Distance methods attempt to construct an all-to-all matrix from the sequence query set describing the distance between each sequence pair. From this is constructed a phylogenetic tree that places closely related sequences under the same <a href="/wiki/Interior_node" class="mw-redirect" title="Interior node">interior node</a> and whose branch lengths closely reproduce the observed distances between sequences. Distance-matrix methods may produce either rooted or unrooted trees, depending on the algorithm used to calculate them.<sup id="cite_ref-:1_4-0" class="reference"><a href="#cite_note-:1-4"><span class="cite-bracket">&#91;</span>4<span class="cite-bracket">&#93;</span></a></sup> Given <span class="texhtml"><i>n</i></span> species, the input is an <span class="texhtml"><i>n</i> × <i>n</i></span> distance matrix <span class="texhtml">M</span> where <span class="texhtml"><i>M</i><sub>ij</sub></span> is the mutation distance between species <span class="texhtml"><i>i</i></span> and <span class="texhtml"><i>j</i></span> . The aim is to output a tree of degree <span class="texhtml">3</span> which is consistent with the distance matrix. </p><p>They are frequently used as the basis for progressive and iterative types of <a href="/wiki/Multiple_sequence_alignment" title="Multiple sequence alignment">multiple sequence alignment</a>. The main disadvantage of distance-matrix methods is their inability to efficiently use information about local high-variation regions that appear across multiple subtrees.<sup id="cite_ref-:1_4-1" class="reference"><a href="#cite_note-:1-4"><span class="cite-bracket">&#91;</span>4<span class="cite-bracket">&#93;</span></a></sup> Despite potential problems, distance methods are extremely fast, and they often produce a reasonable estimate of phylogeny. They also have certain benefits over the methods that use characters directly. Notably, distance methods allow use of data that may not be easily converted to character data, such as <a href="/wiki/DNA%E2%80%93DNA_hybridization" title="DNA–DNA hybridization">DNA–DNA hybridization</a> assays. </p><p>The following are distance based methods for phylogeny reconstruction: </p> <ul><li>Additive tree reconstruction</li> <li><a href="/wiki/UPGMA" title="UPGMA">UPGMA</a></li> <li><a href="/wiki/Neighbor_joining" title="Neighbor joining">Neighbor joining</a></li> <li><a href="/wiki/Distance_matrices_in_phylogeny" title="Distance matrices in phylogeny">Fitch–Margoliash</a></li></ul> <div class="mw-heading mw-heading5"><h5 id="Additive_tree_reconstruction">Additive tree reconstruction</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=13" title="Edit section: Additive tree reconstruction"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Additive tree reconstruction is based on additive and ultrametric distance matrices. These matrices have a special characteristic: </p><p>Consider an additive matrix <span class="texhtml">M</span>. For any three species <span class="texhtml">i, j, k,</span> the corresponding tree is unique.<sup id="cite_ref-:0_3-1" class="reference"><a href="#cite_note-:0-3"><span class="cite-bracket">&#91;</span>3<span class="cite-bracket">&#93;</span></a></sup> Every ultrametric distance matrix is an additive matrix. We can observe this property for the tree below, which consists on the species <span class="texhtml">i, j, k</span>. </p> <figure class="mw-default-size mw-halign-center" typeof="mw:File/Frameless"><a href="/wiki/File:Unique_tree_additive_matrix.png" class="mw-file-description" title="Phylogenetic tree from 3 species"><img alt="Phylogenetic tree from 3 species" src="//upload.wikimedia.org/wikipedia/commons/thumb/6/6c/Unique_tree_additive_matrix.png/220px-Unique_tree_additive_matrix.png" decoding="async" width="220" height="164" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/6/6c/Unique_tree_additive_matrix.png 1.5x" data-file-width="269" data-file-height="201" /></a><figcaption>Phylogenetic tree from 3 species</figcaption></figure> <p>The additive tree reconstruction technique starts with this tree. And then adds one more species each time, based on the distance matrix combined with the property mentioned above. For example, consider an additive matrix <span class="texhtml">M</span> and 5 species <span class="texhtml"><i>a</i>, <i>b</i>, <i>c</i>, <i>d</i></span> and <span class="texhtml"><i>e</i></span>. First we form an additive tree for two species <span class="texhtml"><i>a</i></span> and <span class="texhtml"><i>b</i></span>. Then we chose a third one, let's say <span class="texhtml"><i>c</i></span> and attach it to a point <span class="texhtml"><i>x</i></span> on the edge between <span class="texhtml"><i>a</i></span> and <span class="texhtml"><i>b</i></span>. The edge weights are computed with the property above. Next we add the fourth species <span class="texhtml"><i>d</i></span> to any of the edges. If we apply the property then we identify that <span class="texhtml"><i>d</i></span> should be attached to only one specific edge. Finally, we add <span class="texhtml"><i>e</i></span> following the same procedure as before. </p> <div class="mw-heading mw-heading5"><h5 id="UPGMA">UPGMA</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=14" title="Edit section: UPGMA"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The basic principle of UPGMA (Unweighted Pair Group Method with Arithmetic Mean) is that similar species should be closer in the phylogenetic tree. Hence, it builds the tree by clustering similar sequences iteratively. The method works by building the phylogenetic tree bottom up from its leaves. Initially, we have <span class="texhtml"><i>n</i></span> leaves (or <span class="texhtml"><i>n</i></span> singleton trees), each representing a species in <span class="texhtml"><i>S</i></span>. Those <span class="texhtml"><i>n</i></span> leaves are referred as <span class="texhtml"><i>n</i></span> clusters. Then, we perform <span class="texhtml"><i>n</i>-1</span> iterations. In each iteration, we identify two clusters <span class="texhtml"><i>C</i><sub>1</sub></span> and <span class="texhtml"><i>C</i><sub>2</sub></span> with the smallest average distance and merge them to form a bigger cluster <span class="texhtml"><i>C</i></span>. If we suppose <span class="texhtml">M</span> is ultrametric, for any cluster <span class="texhtml"><i>C</i></span> created by the UPGMA algorithm, <span class="texhtml"><i>C</i></span> is a valid ultrametric tree. </p> <div class="mw-heading mw-heading5"><h5 id="Neighbor_joining">Neighbor joining</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=15" title="Edit section: Neighbor joining"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Neighbor is a bottom-up clustering method. It takes a distance matrix specifying the distance between each pair of sequences. The algorithm starts with a completely unresolved tree, whose topology corresponds to that of a <a href="/wiki/Star_network" title="Star network">star network</a>, and iterates over the following steps until the tree is completely resolved and all branch lengths are known: </p> <ol><li>Based on the current distance matrix calculate the matrix&#160;(defined below).</li> <li>Find the pair of distinct taxa i and j (i.e. with) for which&#160;has its lowest value. These taxa are joined to a newly created node, which is connected to the central node.</li> <li>Calculate the distance from each of the <a href="/wiki/Taxon" title="Taxon">taxa</a> in the pair to this new node.</li> <li>Calculate the distance from each of the taxa outside of this pair to the new node.</li> <li>Start the algorithm again, replacing the pair of joined neighbors with the new node and using the distances calculated in the previous step.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">&#91;</span>5<span class="cite-bracket">&#93;</span></a></sup></li></ol> <div class="mw-heading mw-heading5"><h5 id="Fitch–Margoliash"><span id="Fitch.E2.80.93Margoliash"></span>Fitch–Margoliash</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=16" title="Edit section: Fitch–Margoliash"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The Fitch–Margoliash method uses a weighted <a href="/wiki/Least_squares" title="Least squares">least squares</a> method for clustering based on genetic distance. Closely related sequences are given more weight in the tree construction process to correct for the increased inaccuracy in measuring distances between distantly related sequences. The least-squares criterion applied to these distances is more accurate but less efficient than the neighbor-joining methods. An additional improvement that corrects for correlations between distances that arise from many closely related sequences in the data set can also be applied at increased computational cost.<sup id="cite_ref-6" class="reference"><a href="#cite_note-6"><span class="cite-bracket">&#91;</span>6<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Data_Mining_and_Machine_Learning">Data Mining and Machine Learning</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=17" title="Edit section: Data Mining and Machine Learning"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Data_Mining">Data Mining</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=18" title="Edit section: Data Mining"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A common function in data mining is applying <a href="/wiki/Cluster_analysis" title="Cluster analysis">cluster analysis</a> on a given set of data to group data based on how similar or more similar they are when compared to other groups. Distance matrices became heavily dependent and utilized in <a href="/wiki/Cluster_analysis" title="Cluster analysis">cluster analysis</a> since similarity can be measured with a distance metric. Thus, distance matrix became the representation of the similarity measure between all the different pairs of data in the set. </p> <div class="mw-heading mw-heading4"><h4 id="Hierarchical_clustering">Hierarchical clustering</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=19" title="Edit section: Hierarchical clustering"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A distance matrix is necessary for traditional <a href="/wiki/Hierarchical_clustering" title="Hierarchical clustering">hierarchical clustering</a> algorithms which are often heuristic methods employed in biological sciences such as phylogeny reconstruction. When implementing any of the hierarchical clustering algorithms in data mining, the distance matrix will contain all pair-wise distances between every point and then will begin to create clusters between two different points or clusters based entirely on distances from the distance matrix. </p><p>If N be the number of points, the complexity of hierarchical clustering is: </p> <ul><li>Time complexity is <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 O(N^{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>N</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(N^{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/94a8175a94e236a1e3c5da6d1ea2588fdc0a4312" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.76ex; height:3.176ex;" alt="{\displaystyle O(N^{3})}"></span> due to the repetitive calculations done after every cluster to update the distance matrix</li> <li>Space complexity is <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 O(N^{2})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>N</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(N^{2})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e5d43a3df904fa4d7220f5b86285298aa36d969b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.76ex; height:3.176ex;" alt="{\displaystyle O(N^{2})}"></span></li></ul> <div class="mw-heading mw-heading3"><h3 id="Machine_Learning">Machine Learning</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=20" title="Edit section: Machine Learning"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Distance metrics are a key part of several machine learning algorithms, which are used in both <a href="/wiki/Supervised_learning" title="Supervised learning">supervised</a> and <a href="/wiki/Unsupervised_learning" title="Unsupervised learning">unsupervised learning</a>. They are generally used to calculate the similarity between data points: this is where the distance matrix is an essential element. The use of an effective distance matrix improves the performance of the machine learning model, whether it is for classification tasks or for clustering.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">&#91;</span>7<span class="cite-bracket">&#93;</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="K-Nearest_Neighbors">K-Nearest Neighbors</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=21" title="Edit section: K-Nearest Neighbors"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A distance matrix is utilized in the <a href="/wiki/K-NN_algorithm" class="mw-redirect" title="K-NN algorithm">k-NN algorithm</a> which is one of the slowest but simplest and most used instance-based machine learning algorithms that can be used both in classification and regression tasks. It is one of the slowest machine learning algorithms since each test sample's predicted result requires a fully computed distance matrix between the test sample and each training sample in the training set. Once the distance matrix is computed, the algorithm selects the K number of training samples that are the closest to the test sample to predict the test sample's result based on the selected set's majority (classification) or average (regression) value. </p> <ul><li>Prediction time complexity is <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 O(k*n*d)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>k</mi> <mo>&#x2217;<!-- ∗ --></mo> <mi>n</mi> <mo>&#x2217;<!-- ∗ --></mo> <mi>d</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(k*n*d)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d42e91cdd6c99d62227e7f84187ff31cbf1c72e2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.794ex; height:2.843ex;" alt="{\displaystyle O(k*n*d)}"></span>, to compute the distance between each test sample with every training sample to construct the distance matrix where:</li></ul> <ol><li>k = number of nearest neighbors selected</li> <li>n = size of the training set</li> <li>d = number of dimensions being used for the data</li></ol> <p>This classification focused model predicts the label of the target based on the distance matrix between the target and each of the training samples to determine the K-number of samples that are the closest/nearest to the target. </p> <div style="background-color:transparent;border-collapse:collapse;border:0px solid black;width:650px;display:table;margin-left: auto; margin-right: auto;"><div style="display:table-row"><div style="display:table-cell;border-top:0;padding:1px 0 0 1px"><div style="display:table;background-color:transparent;border-collapse:collapse"><div style="display:table-row"><div style="display:table-cell;border-top:0;padding:0 1px 1px 0"><span typeof="mw:File"><a href="/wiki/File:DistanceMatrix_KNN.png" class="mw-file-description" title="The distance matrix used to select K train samples for K-nn"><img alt="The distance matrix used to select K train samples for K-nn" src="//upload.wikimedia.org/wikipedia/commons/thumb/4/44/DistanceMatrix_KNN.png/324px-DistanceMatrix_KNN.png" decoding="async" width="324" height="262" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/4/44/DistanceMatrix_KNN.png/486px-DistanceMatrix_KNN.png 1.5x, //upload.wikimedia.org/wikipedia/commons/4/44/DistanceMatrix_KNN.png 2x" data-file-width="647" data-file-height="524" /></a></span></div><div style="display:table-cell;border-top:0;padding:0 1px 1px 0"><span typeof="mw:File"><a href="/wiki/File:K_nearestNeighborVisual.png" class="mw-file-description" title="Machine Learning model predicting target value with K-NN"><img alt="Machine Learning model predicting target value with K-NN" src="//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/K_nearestNeighborVisual.png/324px-K_nearestNeighborVisual.png" decoding="async" width="324" height="213" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/e/e8/K_nearestNeighborVisual.png/486px-K_nearestNeighborVisual.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/e/e8/K_nearestNeighborVisual.png/648px-K_nearestNeighborVisual.png 2x" data-file-width="842" data-file-height="553" /></a></span></div></div></div></div></div></div> <div class="mw-heading mw-heading3"><h3 id="Computer_Vision">Computer Vision</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=22" title="Edit section: Computer Vision"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>A distance matrix can be used in <a href="/wiki/Neural_network" title="Neural network">neural networks</a> for 2D to 3D regression in image predicting machine learning models. </p> <div class="mw-heading mw-heading2"><h2 id="Information_retrieval">Information retrieval</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=23" title="Edit section: Information retrieval"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Distance_matrices_using_Gaussian_mixture_distance">Distance matrices using Gaussian mixture distance</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=24" title="Edit section: Distance matrices using Gaussian mixture distance"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a rel="nofollow" class="external autonumber" href="https://www.researchgate.net/publication/220723359_Evaluation_of_Distance_Measures_Between_Gaussian_Mixture_Models_of_MFCCs">[1]</a>* Gaussian mixture distance for performing accurate <a href="/wiki/Nearest_neighbor_search" title="Nearest neighbor search">nearest neighbor search</a> for information retrieval. Under an established Gaussian finite mixture model for the distribution of the data in the database, the Gaussian mixture distance is formulated based on minimizing the <a href="/wiki/Kullback-Leibler_divergence" class="mw-redirect" title="Kullback-Leibler divergence">Kullback-Leibler divergence</a> between the distribution of the retrieval data and the data in database. In the comparison of performance of the Gaussian mixture distance with the well-known <a href="/wiki/Euclidean_distance" title="Euclidean distance">Euclidean</a> and <a href="/wiki/Mahalanobis_distance" title="Mahalanobis distance">Mahalanobis</a> distances based on a precision performance measurement, experimental results demonstrate that the Gaussian mixture distance function is superior in the others for different types of testing data.</li></ul> <p>Potential basic algorithms worth noting on the topic of information retrieval is <a href="/wiki/Fish_School_Search" title="Fish School Search">Fish School Search</a> algorithm an information retrieval that partakes in the act of using distance matrices in order for gathering collective behavior of fish schools. By using a feeding operator to update their weights </p><p>Eq. A: </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 x_{i}(t+1)=x_{i}(t)-step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo>+</mo> <mn>1</mn> <mo stretchy="false">)</mo> <mo>=</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>&#x2212;<!-- − --></mo> <mi>s</mi> <mi>t</mi> <mi>e</mi> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>v</mi> <mi>o</mi> <mi>l</mi> </mrow> </msub> <mi>r</mi> <mi>a</mi> <mi>n</mi> <mi>d</mi> <mo stretchy="false">(</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>&#x2212;<!-- − --></mo> <mi>B</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> </mrow> <mrow> <mi>d</mi> <mi>i</mi> <mi>s</mi> <mi>t</mi> <mi>a</mi> <mi>n</mi> <mi>c</mi> <mi>e</mi> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>,</mo> <mi>B</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mrow> </mfrac> </mrow> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{i}(t+1)=x_{i}(t)-step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/02be208585513b6bafce210f6f0a2c471fbf5548" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.671ex; width:58.236ex; height:6.509ex;" alt="{\displaystyle x_{i}(t+1)=x_{i}(t)-step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}"></span></dd></dl> <p>Eq. B: </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 x_{i}(t+1)=x_{i}(t)+step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo>+</mo> <mn>1</mn> <mo stretchy="false">)</mo> <mo>=</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>+</mo> <mi>s</mi> <mi>t</mi> <mi>e</mi> <msub> <mi>p</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>v</mi> <mi>o</mi> <mi>l</mi> </mrow> </msub> <mi>r</mi> <mi>a</mi> <mi>n</mi> <mi>d</mi> <mo stretchy="false">(</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mfrac> <mrow> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>&#x2212;<!-- − --></mo> <mi>B</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> </mrow> <mrow> <mi>d</mi> <mi>i</mi> <mi>s</mi> <mi>t</mi> <mi>a</mi> <mi>n</mi> <mi>c</mi> <mi>e</mi> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>i</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo>,</mo> <mi>B</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mrow> </mfrac> </mrow> <mo>,</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{i}(t+1)=x_{i}(t)+step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4423c1c734053bfd15643f0fe36ee0acb4a5ce18" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.671ex; width:58.236ex; height:6.509ex;" alt="{\displaystyle x_{i}(t+1)=x_{i}(t)+step_{vol}rand(0,1){\frac {x_{i}(t)-B(t)}{distance(x_{i}(t),B(t))}},}"></span></dd></dl> <p>Stepvol defines the size of the maximum volume displacement preformed with the distance matrix, specifically using a <a href="/wiki/Euclidean_distance" title="Euclidean distance">Euclidean distance</a> matrix. </p> <div class="mw-heading mw-heading3"><h3 id="Evaluation_of_the_similarity_or_dissimilarity_of_Cosine_similarity_and_Distance_matrices">Evaluation of the similarity or dissimilarity of Cosine similarity and Distance matrices</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=25" title="Edit section: Evaluation of the similarity or dissimilarity of Cosine similarity and Distance matrices"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure class="mw-default-size mw-halign-none" typeof="mw:File/Thumb"><a href="/wiki/File:SimilarityTOidistance.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/5/50/SimilarityTOidistance.png/220px-SimilarityTOidistance.png" decoding="async" width="220" height="60" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/5/50/SimilarityTOidistance.png/330px-SimilarityTOidistance.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/5/50/SimilarityTOidistance.png/440px-SimilarityTOidistance.png 2x" data-file-width="472" data-file-height="129" /></a><figcaption>Conversion formula between cosine similarity and Euclidean distance</figcaption></figure> <ul><li><a rel="nofollow" class="external autonumber" href="https://www.sciencedirect.com/science/article/pii/S0020025507002630">[2]</a>* While the <a href="/wiki/Cosine_similarity" title="Cosine similarity">Cosine similarity</a> measure is perhaps the most frequently applied proximity measure in information retrieval by measuring the angles between documents in the search space on the base of the cosine. Euclidean distance is invariant to mean-correction. The sampling distribution of a mean is generated by repeated sampling from the same population and recording of the sample means obtained. This forms a distribution of different means, and this distribution has its own mean and variance. For the data which can be negative as well as positive, the <a href="/wiki/Null_distribution" title="Null distribution">null distribution</a> for cosine similarity is the distribution of the <a href="/wiki/Dot_product" title="Dot product">dot product</a> of two independent random unit vectors. This distribution has a mean of zero and a variance of 1/n. While <a href="/wiki/Euclidean_distance" title="Euclidean distance">Euclidean distance</a> will be invariant to this correction.</li></ul> <div class="mw-heading mw-heading3"><h3 id="Clustering_Documents">Clustering Documents</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=26" title="Edit section: Clustering Documents"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The implementation of <a href="/wiki/Hierarchical_clustering" title="Hierarchical clustering">hierarchical clustering</a> with distance-based metrics to organize and group similar documents together will require the need and utilization of a distance matrix. The distance matrix will represent the degree of association that a document has with another document that will be used to create clusters of closely associated documents that will be utilized in retrieval methods of relevant documents for a user's query. </p> <div class="mw-heading mw-heading3"><h3 id="Isomap">Isomap</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=27" title="Edit section: Isomap"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><a href="/wiki/Isomap" title="Isomap">Isomap</a> incorporates distance matrices to utilize <a href="/wiki/Geodesic_distance" class="mw-redirect" title="Geodesic distance">geodesic distances</a> to able to compute lower-dimensional embeddings. This helps to address a collection of documents that reside within a massive number of dimensions and empowers to perform document clustering. </p> <div class="mw-heading mw-heading3"><h3 id="Neighborhood_Retrieval_Visualizer_(NeRV)"><span id="Neighborhood_Retrieval_Visualizer_.28NeRV.29"></span>Neighborhood Retrieval Visualizer (NeRV)</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=28" title="Edit section: Neighborhood Retrieval Visualizer (NeRV)"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>An algorithm used for both unsupervised and supervised visualization that uses distance matrices to find similar data based on the similarities shown on a display/screen. </p><p>The distance matrix needed for Unsupervised NeRV can be computed through fixed input pairwise distances. </p><p>The distance matrix needed for Supervised NeRV requires formulating a supervised distance metric to be able to compute the distance of the input in a supervised manner. </p> <div class="mw-heading mw-heading2"><h2 id="Chemistry">Chemistry</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=29" title="Edit section: Chemistry"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The distance matrix is a mathematical object widely used in both graphical-theoretical (topological) and geometric (topographic) versions of chemistry.<sup id="cite_ref-:2_8-0" class="reference"><a href="#cite_note-:2-8"><span class="cite-bracket">&#91;</span>8<span class="cite-bracket">&#93;</span></a></sup> The distance matrix is used in chemistry in both explicit and implicit forms. </p> <div class="mw-heading mw-heading3"><h3 id="Interconversion_mechanisms_between_two_permutational_isomers">Interconversion mechanisms between two permutational isomers</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=30" title="Edit section: Interconversion mechanisms between two permutational isomers"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Distance matrices were used as the main approach to depict and reveal the shortest path sequence needed to determine the rearrangement between the two permutational isomers. </p> <div class="mw-heading mw-heading3"><h3 id="Distance_Polynomials_and_Distance_Spectra">Distance Polynomials and Distance Spectra</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=31" title="Edit section: Distance Polynomials and Distance Spectra"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Explicit use of Distance matrices is required in order to construct the distance polynomials and distance spectra of molecular structures. </p> <div class="mw-heading mw-heading3"><h3 id="Structure-property_model">Structure-property model</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=32" title="Edit section: Structure-property model"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Implicit use of Distance matrices was applied through the use of the distance based metric <a href="/wiki/Wiener_index" title="Wiener index">Weiner number</a>/<a href="/wiki/Wiener_index" title="Wiener index">Weiner Index</a> which was formulated to represent the distances in all chemical structures. The Weiner number is equal to half-sum of the elements of the distance matrix. </p> <figure class="mw-default-size mw-halign-none" typeof="mw:File/Thumb"><a href="/wiki/File:WeinerNumtoDistanceMatrix.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/b/b7/WeinerNumtoDistanceMatrix.png/220px-WeinerNumtoDistanceMatrix.png" decoding="async" width="220" height="86" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/b/b7/WeinerNumtoDistanceMatrix.png 1.5x" data-file-width="329" data-file-height="129" /></a><figcaption>Conversion formula between Weiner Number and Distance Matrix</figcaption></figure> <div class="mw-heading mw-heading3"><h3 id="Graph-theoretical_Distance_matrix">Graph-theoretical Distance matrix</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=33" title="Edit section: Graph-theoretical Distance matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Distance matrix in chemistry that are used for the 2-D realization of molecular graphs, which are used to illustrate the main foundational features of a molecule in a myriad of applications. </p> <figure typeof="mw:File/Thumb"><a href="/wiki/File:Chem_DistanceMtrix.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Chem_DistanceMtrix.png/335px-Chem_DistanceMtrix.png" decoding="async" width="335" height="184" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Chem_DistanceMtrix.png/503px-Chem_DistanceMtrix.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/ae/Chem_DistanceMtrix.png/670px-Chem_DistanceMtrix.png 2x" data-file-width="1108" data-file-height="608" /></a><figcaption>Labeled tree representation of C<sub>6</sub>H<sub>14</sub>'s carbon skeleton based on its distance matrix</figcaption></figure> <ol><li>Creating a label tree that represents the <a href="/wiki/Skeletal_formula" title="Skeletal formula">carbon skeleton</a> of a molecule based on its distance matrix. The distance matrix is imperative in this application because similar molecules can have a myriad of label tree variants of their <a href="/wiki/Skeletal_formula" title="Skeletal formula">carbon skeleton</a>. The labeled tree structure of <a href="/wiki/Hexane" title="Hexane">hexane</a> (C<sub>6</sub>H<sub>14</sub>) carbon skeleton that is created based on the distance matrix in the example, has different carbon skeleton variants that affect both the distance matrix and the labeled tree</li> <li>Creating a labeled graph with edge weights, used in <a href="/wiki/Chemical_graph_theory" title="Chemical graph theory">chemical graph theory</a>, that represent molecules with hetero-atoms.</li> <li>Le Verrier-Fadeev-Frame (LVFF) method is a computer oriented used to speed up the process of detecting the graph center in polycyclic graphs. However, LVFF requires the input to be a diagonalized distance matrix which is easily resolved by implementing the Householder tridiagonal-QL algorithm that takes in a distance matrix and returns the diagonalized distance needed for the LVFF method.</li></ol> <div class="mw-heading mw-heading3"><h3 id="Geometric-Distance_Matrix">Geometric-Distance Matrix</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=34" title="Edit section: Geometric-Distance Matrix"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure typeof="mw:File/Thumb"><a href="/wiki/File:Geometric_distance_matrix.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/6/60/Geometric_distance_matrix.png/338px-Geometric_distance_matrix.png" decoding="async" width="338" height="147" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/6/60/Geometric_distance_matrix.png 1.5x" data-file-width="430" data-file-height="187" /></a><figcaption>Geometric distance matrix for 2,4-dimethylhexane</figcaption></figure> <p>While the graph-theoretical distance matrix 2-D captures the constitutional features of the molecule, its three-dimensional (3D) character is encoded in the geometric-distance matrix. The geometric-distance matrix is a different type of distance matrix that is based on the graph-theoretical distance matrix of a molecule to represent and graph the 3-D molecule structure.<sup id="cite_ref-:2_8-1" class="reference"><a href="#cite_note-:2-8"><span class="cite-bracket">&#91;</span>8<span class="cite-bracket">&#93;</span></a></sup> The geometric-distance matrix of a molecular structure <span class="texhtml"><i>G</i></span> is a real symmetric <span class="texhtml"><i>n</i> x <i>n</i></span> matrix defined in the same way as a 2-D matrix. However, the matrix elements <span class="texhtml"><i>D</i><sub>ij</sub></span> will hold a collection of shortest Cartesian distances between <span class="texhtml"><i>i</i></span> and <span class="texhtml"><i>j</i></span> in <span class="texhtml"><i>G</i></span>. Also known as topographic matrix, the geometric-distance matrix can be constructed from the known geometry of the molecule. As an example, the geometric-distance matrix of the carbon skeleton of <i>2,4-dimethylhexane</i> is shown below: </p> <div class="mw-heading mw-heading2"><h2 id="Other_Applications">Other Applications</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=35" title="Edit section: Other Applications"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Time_Series_Analysis">Time Series Analysis</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=36" title="Edit section: Time Series Analysis"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p><a href="/wiki/Dynamic_time_warping" title="Dynamic time warping">Dynamic Time Warping</a> distance matrices are utilized with the clustering and classification algorithms of a collection/group of time series objects. </p> <div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Distance_matrix&amp;action=edit&amp;section=37" title="Edit section: Examples"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>For example, suppose these data are to be analyzed, where <a href="/wiki/Pixel" title="Pixel">pixel</a> <a href="/wiki/Euclidean_distance" title="Euclidean distance">Euclidean distance</a> is the <a href="/wiki/Metric_(mathematics)" class="mw-redirect" title="Metric (mathematics)">distance metric</a>. </p> <figure class="mw-halign-none" typeof="mw:File/Frame"><a href="/wiki/File:Clusters.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Clusters.svg/250px-Clusters.svg.png" decoding="async" width="250" height="251" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Clusters.svg/375px-Clusters.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Clusters.svg/500px-Clusters.svg.png 2x" data-file-width="250" data-file-height="251" /></a><figcaption>Raw data</figcaption></figure> <p>The distance matrix would be: </p> <table class="wikitable"> <tbody><tr> <th></th> <th>a</th> <th>b</th> <th>c</th> <th>d</th> <th>e</th> <th>f </th></tr> <tr> <th>a </th> <td>0</td> <td>184</td> <td>222</td> <td>177</td> <td>216</td> <td>231 </td></tr> <tr> <th>b </th> <td>184</td> <td>0</td> <td>45</td> <td>123</td> <td>128</td> <td>200 </td></tr> <tr> <th>c </th> <td>222</td> <td>45</td> <td>0</td> <td>129</td> <td>121</td> <td>203 </td></tr> <tr> <th>d </th> <td>177</td> <td>123</td> <td>129</td> <td>0</td> <td>46</td> <td>83 </td></tr> <tr> <th>e </th> <td>216</td> <td>128</td> <td>121</td> <td>46</td> <td>0</td> <td>83 </td></tr> <tr> <th>f </th> <td>231</td> <td>200</td> <td>203</td> <td>83</td> <td>83</td> <td>0 </td></tr></tbody></table> <p>These data can then be viewed in graphic form as a <a href="/wiki/Heat_map" title="Heat map">heat map</a>. In this image, black denotes a distance of 0 and white is maximal distance. </p> <figure class="mw-halign-none" typeof="mw:File/Frame"><a href="/wiki/File:Distance_matrix.PNG" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/7/7a/Distance_matrix.PNG" decoding="async" width="246" height="246" class="mw-file-element" data-file-width="246" data-file-height="246" /></a><figcaption>Graphical View</figcaption></figure> <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=Distance_matrix&amp;action=edit&amp;section=38" title="Edit section: See also"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/Computer_vision" title="Computer vision">Computer vision</a></li> <li><a href="/wiki/Data_clustering" class="mw-redirect" title="Data clustering">Data clustering</a></li> <li><a href="/wiki/Distance_set" title="Distance set">Distance set</a></li> <li><a href="/wiki/Hollow_matrix" title="Hollow matrix">Hollow matrix</a></li> <li><a href="/wiki/Min-plus_matrix_multiplication" title="Min-plus matrix multiplication">Min-plus matrix multiplication</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=Distance_matrix&amp;action=edit&amp;section=39" 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"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-1">^</a></b></span> <span class="reference-text">Weyenberg, G., &amp; Yoshida, R. (2015). Reconstructing the phylogeny: Computational methods. In Algebraic and Discrete Mathematical methods for modern Biology (pp. 293–319). Academic Press.</span> </li> <li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><a href="/wiki/Frank_Harary" title="Frank Harary">Frank Harary</a>, Robert Z. Norman and Dorwin Cartwright (1965) <i>Structural Models: An Introduction to the Theory of Directed Graphs</i>, pages 134–8, <a href="/wiki/John_Wiley_%26_Sons" class="mw-redirect" title="John Wiley &amp; Sons">John Wiley &amp; Sons</a> <a href="/wiki/MR_(identifier)" class="mw-redirect" title="MR (identifier)">MR</a><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><a rel="nofollow" class="external text" href="https://mathscinet.ams.org/mathscinet-getitem?mr=0184874">0184874</a></span> </li> <li id="cite_note-:0-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_3-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="CITEREFSung2010" class="citation book cs1">Sung, Wing-Kin (2010). <i>Algorithms in bioinformatics: A practical introduction</i>. Chapman &amp; Hall. p.&#160;29. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&#160;<a href="/wiki/Special:BookSources/978-1-4200-7033-0" title="Special:BookSources/978-1-4200-7033-0"><bdi>978-1-4200-7033-0</bdi></a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Algorithms+in+bioinformatics%3A+A+practical+introduction&amp;rft.pages=29&amp;rft.pub=Chapman+%26+Hall&amp;rft.date=2010&amp;rft.isbn=978-1-4200-7033-0&amp;rft.aulast=Sung&amp;rft.aufirst=Wing-Kin&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" class="Z3988"></span></span> </li> <li id="cite_note-:1-4"><span class="mw-cite-backlink">^ <a href="#cite_ref-:1_4-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:1_4-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="CITEREFFelsenstein2003" class="citation book cs1">Felsenstein, Joseph (2003). <i>Inferring phylogenies</i>. Sinauer Associates. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&#160;<a href="/wiki/Special:BookSources/9780878931774" title="Special:BookSources/9780878931774"><bdi>9780878931774</bdi></a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=book&amp;rft.btitle=Inferring+phylogenies&amp;rft.pub=Sinauer+Associates&amp;rft.date=2003&amp;rft.isbn=9780878931774&amp;rft.aulast=Felsenstein&amp;rft.aufirst=Joseph&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" 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="CITEREFSaitou1987" class="citation journal cs1">Saitou, Naruya (1987). <a rel="nofollow" class="external text" href="https://academic.oup.com/mbe/article/4/4/406/1029664?login=false">"The neighbor-joining method: A new method for reconstructing phylogenetic trees"</a>. <i>Molecular Biology and Evolution</i>. <b>4</b> (4): 406–425. <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.1093%2Foxfordjournals.molbev.a040454">10.1093/oxfordjournals.molbev.a040454</a></span>. <a href="/wiki/PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&#160;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/3447015">3447015</a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.jtitle=Molecular+Biology+and+Evolution&amp;rft.atitle=The+neighbor-joining+method%3A+A+new+method+for+reconstructing+phylogenetic+trees&amp;rft.volume=4&amp;rft.issue=4&amp;rft.pages=406-425&amp;rft.date=1987&amp;rft_id=info%3Adoi%2F10.1093%2Foxfordjournals.molbev.a040454&amp;rft_id=info%3Apmid%2F3447015&amp;rft.aulast=Saitou&amp;rft.aufirst=Naruya&amp;rft_id=https%3A%2F%2Facademic.oup.com%2Fmbe%2Farticle%2F4%2F4%2F406%2F1029664%3Flogin%3Dfalse&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" 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="CITEREFFitch1967" class="citation journal cs1">Fitch, Walter M. (1967). <a rel="nofollow" class="external text" href="https://www.science.org/doi/10.1126/science.155.3760.279">"Construction of Phylogenetic Trees: A method based on mutation distances as estimated from cytochrome c sequences is of general applicability"</a>. <i>Science</i>. <b>155</b> (3760): 279–284. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1126%2Fscience.155.3760.279">10.1126/science.155.3760.279</a>. <a href="/wiki/PMID_(identifier)" class="mw-redirect" title="PMID (identifier)">PMID</a>&#160;<a rel="nofollow" class="external text" href="https://pubmed.ncbi.nlm.nih.gov/5334057">5334057</a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.jtitle=Science&amp;rft.atitle=Construction+of+Phylogenetic+Trees%3A+A+method+based+on+mutation+distances+as+estimated+from+cytochrome+c+sequences+is+of+general+applicability.&amp;rft.volume=155&amp;rft.issue=3760&amp;rft.pages=279-284&amp;rft.date=1967&amp;rft_id=info%3Adoi%2F10.1126%2Fscience.155.3760.279&amp;rft_id=info%3Apmid%2F5334057&amp;rft.aulast=Fitch&amp;rft.aufirst=Walter+M.&amp;rft_id=https%3A%2F%2Fwww.science.org%2Fdoi%2F10.1126%2Fscience.155.3760.279&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" 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 class="citation web cs1"><a rel="nofollow" class="external text" href="https://www.analyticsvidhya.com/blog/2020/02/4-types-of-distance-metrics-in-machine-learning/">"4 types of distance metrics in machine learning"</a>. February 25, 2020.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.genre=unknown&amp;rft.btitle=4+types+of+distance+metrics+in+machine+learning&amp;rft.date=2020-02-25&amp;rft_id=https%3A%2F%2Fwww.analyticsvidhya.com%2Fblog%2F2020%2F02%2F4-types-of-distance-metrics-in-machine-learning%2F&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" class="Z3988"></span></span> </li> <li id="cite_note-:2-8"><span class="mw-cite-backlink">^ <a href="#cite_ref-:2_8-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:2_8-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="CITEREFMihalic1992" class="citation journal cs1">Mihalic, Zlatko (1992). "The distance matrix in chemistry". <i>Journal of Mathematical Chemistry</i>. <b>11</b>: 223–258. <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%2FBF01164206">10.1007/BF01164206</a>. <a href="/wiki/S2CID_(identifier)" class="mw-redirect" title="S2CID (identifier)">S2CID</a>&#160;<a rel="nofollow" class="external text" href="https://api.semanticscholar.org/CorpusID:121181446">121181446</a>.</cite><span title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&amp;rft.genre=article&amp;rft.jtitle=Journal+of+Mathematical+Chemistry&amp;rft.atitle=The+distance+matrix+in+chemistry&amp;rft.volume=11&amp;rft.pages=223-258&amp;rft.date=1992&amp;rft_id=info%3Adoi%2F10.1007%2FBF01164206&amp;rft_id=https%3A%2F%2Fapi.semanticscholar.org%2FCorpusID%3A121181446%23id-name%3DS2CID&amp;rft.aulast=Mihalic&amp;rft.aufirst=Zlatko&amp;rfr_id=info%3Asid%2Fen.wikipedia.org%3ADistance+matrix" class="Z3988"></span></span> </li> </ol></div></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="Matrix_classes" style="padding:3px"><table class="nowraplinks hlist 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:Matrix_classes" title="Template:Matrix classes"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Matrix_classes" title="Template talk:Matrix classes"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:Matrix_classes" title="Special:EditPage/Template:Matrix classes"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="Matrix_classes" style="font-size:114%;margin:0 4em"><a href="/wiki/Matrix_(mathematics)" title="Matrix (mathematics)">Matrix</a> classes</div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Explicitly constrained entries</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Alternant_matrix" title="Alternant matrix">Alternant</a></li> <li><a href="/wiki/Anti-diagonal_matrix" title="Anti-diagonal matrix">Anti-diagonal</a></li> <li><a href="/wiki/Skew-Hermitian_matrix" title="Skew-Hermitian matrix">Anti-Hermitian</a></li> <li><a href="/wiki/Skew-symmetric_matrix" title="Skew-symmetric matrix">Anti-symmetric</a></li> <li><a href="/wiki/Arrowhead_matrix" title="Arrowhead matrix">Arrowhead</a></li> <li><a href="/wiki/Band_matrix" title="Band matrix">Band</a></li> <li><a href="/wiki/Bidiagonal_matrix" title="Bidiagonal matrix">Bidiagonal</a></li> <li><a href="/wiki/Bisymmetric_matrix" title="Bisymmetric matrix">Bisymmetric</a></li> <li><a href="/wiki/Block-diagonal_matrix" class="mw-redirect" title="Block-diagonal matrix">Block-diagonal</a></li> <li><a href="/wiki/Block_matrix" title="Block matrix">Block</a></li> <li><a href="/wiki/Block_tridiagonal_matrix" class="mw-redirect" title="Block tridiagonal matrix">Block tridiagonal</a></li> <li><a href="/wiki/Boolean_matrix" title="Boolean matrix">Boolean</a></li> <li><a href="/wiki/Cauchy_matrix" title="Cauchy matrix">Cauchy</a></li> <li><a href="/wiki/Centrosymmetric_matrix" title="Centrosymmetric matrix">Centrosymmetric</a></li> <li><a href="/wiki/Conference_matrix" title="Conference matrix">Conference</a></li> <li><a href="/wiki/Complex_Hadamard_matrix" title="Complex Hadamard matrix">Complex Hadamard</a></li> <li><a href="/wiki/Copositive_matrix" title="Copositive matrix">Copositive</a></li> <li><a href="/wiki/Diagonally_dominant_matrix" title="Diagonally dominant matrix">Diagonally dominant</a></li> <li><a href="/wiki/Diagonal_matrix" title="Diagonal matrix">Diagonal</a></li> <li><a href="/wiki/DFT_matrix" title="DFT matrix">Discrete Fourier Transform</a></li> <li><a href="/wiki/Elementary_matrix" title="Elementary matrix">Elementary</a></li> <li><a href="/wiki/Equivalent_matrix" class="mw-redirect" title="Equivalent matrix">Equivalent</a></li> <li><a href="/wiki/Frobenius_matrix" title="Frobenius matrix">Frobenius</a></li> <li><a href="/wiki/Generalized_permutation_matrix" title="Generalized permutation matrix">Generalized permutation</a></li> <li><a href="/wiki/Hadamard_matrix" title="Hadamard matrix">Hadamard</a></li> <li><a href="/wiki/Hankel_matrix" title="Hankel matrix">Hankel</a></li> <li><a href="/wiki/Hermitian_matrix" title="Hermitian matrix">Hermitian</a></li> <li><a href="/wiki/Hessenberg_matrix" title="Hessenberg matrix">Hessenberg</a></li> <li><a href="/wiki/Hollow_matrix" title="Hollow matrix">Hollow</a></li> <li><a href="/wiki/Integer_matrix" title="Integer matrix">Integer</a></li> <li><a href="/wiki/Logical_matrix" title="Logical matrix">Logical</a></li> <li><a href="/wiki/Matrix_unit" title="Matrix unit">Matrix unit</a></li> <li><a href="/wiki/Metzler_matrix" title="Metzler matrix">Metzler</a></li> <li><a href="/wiki/Moore_matrix" title="Moore matrix">Moore</a></li> <li><a href="/wiki/Nonnegative_matrix" title="Nonnegative matrix">Nonnegative</a></li> <li><a href="/wiki/Pentadiagonal_matrix" class="mw-redirect" title="Pentadiagonal matrix">Pentadiagonal</a></li> <li><a href="/wiki/Permutation_matrix" title="Permutation matrix">Permutation</a></li> <li><a href="/wiki/Persymmetric_matrix" title="Persymmetric matrix">Persymmetric</a></li> <li><a href="/wiki/Polynomial_matrix" title="Polynomial matrix">Polynomial</a></li> <li><a href="/wiki/Quaternionic_matrix" title="Quaternionic matrix">Quaternionic</a></li> <li><a href="/wiki/Signature_matrix" title="Signature matrix">Signature</a></li> <li><a href="/wiki/Skew-Hermitian_matrix" title="Skew-Hermitian matrix">Skew-Hermitian</a></li> <li><a href="/wiki/Skew-symmetric_matrix" title="Skew-symmetric matrix">Skew-symmetric</a></li> <li><a href="/wiki/Skyline_matrix" title="Skyline matrix">Skyline</a></li> <li><a href="/wiki/Sparse_matrix" title="Sparse matrix">Sparse</a></li> <li><a href="/wiki/Sylvester_matrix" title="Sylvester matrix">Sylvester</a></li> <li><a href="/wiki/Symmetric_matrix" title="Symmetric matrix">Symmetric</a></li> <li><a href="/wiki/Toeplitz_matrix" title="Toeplitz matrix">Toeplitz</a></li> <li><a href="/wiki/Triangular_matrix" title="Triangular matrix">Triangular</a></li> <li><a href="/wiki/Tridiagonal_matrix" title="Tridiagonal matrix">Tridiagonal</a></li> <li><a href="/wiki/Vandermonde_matrix" title="Vandermonde matrix">Vandermonde</a></li> <li><a href="/wiki/Walsh_matrix" title="Walsh matrix">Walsh</a></li> <li><a href="/wiki/Z-matrix_(mathematics)" title="Z-matrix (mathematics)">Z</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Constant</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Exchange_matrix" title="Exchange matrix">Exchange</a></li> <li><a href="/wiki/Hilbert_matrix" title="Hilbert matrix">Hilbert</a></li> <li><a href="/wiki/Identity_matrix" title="Identity matrix">Identity</a></li> <li><a href="/wiki/Lehmer_matrix" title="Lehmer matrix">Lehmer</a></li> <li><a href="/wiki/Matrix_of_ones" title="Matrix of ones">Of ones</a></li> <li><a href="/wiki/Pascal_matrix" title="Pascal matrix">Pascal</a></li> <li><a href="/wiki/Pauli_matrices" title="Pauli matrices">Pauli</a></li> <li><a href="/wiki/Redheffer_matrix" title="Redheffer matrix">Redheffer</a></li> <li><a href="/wiki/Shift_matrix" title="Shift matrix">Shift</a></li> <li><a href="/wiki/Zero_matrix" title="Zero matrix">Zero</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Conditions on <a href="/wiki/Eigenvalues_and_eigenvectors" title="Eigenvalues and eigenvectors">eigenvalues or eigenvectors</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Companion_matrix" title="Companion matrix">Companion</a></li> <li><a href="/wiki/Convergent_matrix" title="Convergent matrix">Convergent</a></li> <li><a href="/wiki/Defective_matrix" title="Defective matrix">Defective</a></li> <li><a href="/wiki/Definite_matrix" title="Definite matrix">Definite</a></li> <li><a href="/wiki/Diagonalizable_matrix" title="Diagonalizable matrix">Diagonalizable</a></li> <li><a href="/wiki/Hurwitz-stable_matrix" title="Hurwitz-stable matrix">Hurwitz-stable</a></li> <li><a href="/wiki/Positive-definite_matrix" class="mw-redirect" title="Positive-definite matrix">Positive-definite</a></li> <li><a href="/wiki/Stieltjes_matrix" title="Stieltjes matrix">Stieltjes</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Satisfying conditions on <a href="/wiki/Matrix_product" class="mw-redirect" title="Matrix product">products</a> or <a href="/wiki/Inverse_of_a_matrix" class="mw-redirect" title="Inverse of a matrix">inverses</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Matrix_congruence" title="Matrix congruence">Congruent</a></li> <li><a href="/wiki/Idempotent_matrix" title="Idempotent matrix">Idempotent</a> or <a href="/wiki/Projection_(linear_algebra)" title="Projection (linear algebra)">Projection</a></li> <li><a href="/wiki/Invertible_matrix" title="Invertible matrix">Invertible</a></li> <li><a href="/wiki/Involutory_matrix" title="Involutory matrix">Involutory</a></li> <li><a href="/wiki/Nilpotent_matrix" title="Nilpotent matrix">Nilpotent</a></li> <li><a href="/wiki/Normal_matrix" title="Normal matrix">Normal</a></li> <li><a href="/wiki/Orthogonal_matrix" title="Orthogonal matrix">Orthogonal</a></li> <li><a href="/wiki/Unimodular_matrix" title="Unimodular matrix">Unimodular</a></li> <li><a href="/wiki/Unipotent" title="Unipotent">Unipotent</a></li> <li><a href="/wiki/Unitary_matrix" title="Unitary matrix">Unitary</a></li> <li><a href="/wiki/Totally_unimodular_matrix" class="mw-redirect" title="Totally unimodular matrix">Totally unimodular</a></li> <li><a href="/wiki/Weighing_matrix" title="Weighing matrix">Weighing</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">With specific applications</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Adjugate_matrix" title="Adjugate matrix">Adjugate</a></li> <li><a href="/wiki/Alternating_sign_matrix" title="Alternating sign matrix">Alternating sign</a></li> <li><a href="/wiki/Augmented_matrix" title="Augmented matrix">Augmented</a></li> <li><a href="/wiki/B%C3%A9zout_matrix" title="Bézout matrix">Bézout</a></li> <li><a href="/wiki/Carleman_matrix" title="Carleman matrix">Carleman</a></li> <li><a href="/wiki/Cartan_matrix" title="Cartan matrix">Cartan</a></li> <li><a href="/wiki/Circulant_matrix" title="Circulant matrix">Circulant</a></li> <li><a href="/wiki/Cofactor_matrix" class="mw-redirect" title="Cofactor matrix">Cofactor</a></li> <li><a href="/wiki/Commutation_matrix" title="Commutation matrix">Commutation</a></li> <li><a href="/wiki/Confusion_matrix" title="Confusion matrix">Confusion</a></li> <li><a href="/wiki/Coxeter_matrix" class="mw-redirect" title="Coxeter matrix">Coxeter</a></li> <li><a class="mw-selflink selflink">Distance</a></li> <li><a href="/wiki/Duplication_and_elimination_matrices" title="Duplication and elimination matrices">Duplication and elimination</a></li> <li><a href="/wiki/Euclidean_distance_matrix" title="Euclidean distance matrix">Euclidean distance</a></li> <li><a href="/wiki/Fundamental_matrix_(linear_differential_equation)" title="Fundamental matrix (linear differential equation)">Fundamental (linear differential equation)</a></li> <li><a href="/wiki/Generator_matrix" title="Generator matrix">Generator</a></li> <li><a href="/wiki/Gram_matrix" title="Gram matrix">Gram</a></li> <li><a href="/wiki/Hessian_matrix" title="Hessian matrix">Hessian</a></li> <li><a href="/wiki/Householder_transformation" title="Householder transformation">Householder</a></li> <li><a href="/wiki/Jacobian_matrix_and_determinant" title="Jacobian matrix and determinant">Jacobian</a></li> <li><a href="/wiki/Moment_matrix" title="Moment matrix">Moment</a></li> <li><a href="/wiki/Payoff_matrix" class="mw-redirect" title="Payoff matrix">Payoff</a></li> <li><a href="/wiki/Pick_matrix" class="mw-redirect" title="Pick matrix">Pick</a></li> <li><a href="/wiki/Random_matrix" title="Random matrix">Random</a></li> <li><a href="/wiki/Rotation_matrix" title="Rotation matrix">Rotation</a></li> <li><a href="/wiki/Routh%E2%80%93Hurwitz_matrix" title="Routh–Hurwitz matrix">Routh-Hurwitz</a></li> <li><a href="/wiki/Seifert_matrix" class="mw-redirect" title="Seifert matrix">Seifert</a></li> <li><a href="/wiki/Shear_matrix" class="mw-redirect" title="Shear matrix">Shear</a></li> <li><a href="/wiki/Similarity_matrix" class="mw-redirect" title="Similarity matrix">Similarity</a></li> <li><a href="/wiki/Symplectic_matrix" title="Symplectic matrix">Symplectic</a></li> <li><a href="/wiki/Totally_positive_matrix" title="Totally positive matrix">Totally positive</a></li> <li><a href="/wiki/Transformation_matrix" title="Transformation matrix">Transformation</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Used in <a href="/wiki/Statistics" title="Statistics">statistics</a></th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Centering_matrix" title="Centering matrix">Centering</a></li> <li><a href="/wiki/Correlation_matrix" class="mw-redirect" title="Correlation matrix">Correlation</a></li> <li><a href="/wiki/Covariance_matrix" title="Covariance matrix">Covariance</a></li> <li><a href="/wiki/Design_matrix" title="Design matrix">Design</a></li> <li><a href="/wiki/Doubly_stochastic_matrix" title="Doubly stochastic matrix">Doubly stochastic</a></li> <li><a href="/wiki/Fisher_information_matrix" class="mw-redirect" title="Fisher information matrix">Fisher information</a></li> <li><a href="/wiki/Projection_matrix" title="Projection matrix">Hat</a></li> <li><a href="/wiki/Precision_(statistics)" title="Precision (statistics)">Precision</a></li> <li><a href="/wiki/Stochastic_matrix" title="Stochastic matrix">Stochastic</a></li> <li><a href="/wiki/Stochastic_matrix" title="Stochastic matrix">Transition</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Used in <a href="/wiki/Graph_theory" title="Graph theory">graph theory</a></th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Adjacency_matrix" title="Adjacency matrix">Adjacency</a></li> <li><a href="/wiki/Biadjacency_matrix" class="mw-redirect" title="Biadjacency matrix">Biadjacency</a></li> <li><a href="/wiki/Degree_matrix" title="Degree matrix">Degree</a></li> <li><a href="/wiki/Edmonds_matrix" title="Edmonds matrix">Edmonds</a></li> <li><a href="/wiki/Incidence_matrix" title="Incidence matrix">Incidence</a></li> <li><a href="/wiki/Laplacian_matrix" title="Laplacian matrix">Laplacian</a></li> <li><a href="/wiki/Seidel_adjacency_matrix" title="Seidel adjacency matrix">Seidel adjacency</a></li> <li><a href="/wiki/Tutte_matrix" title="Tutte matrix">Tutte</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Used in science and engineering</th><td class="navbox-list-with-group navbox-list navbox-even" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Cabibbo%E2%80%93Kobayashi%E2%80%93Maskawa_matrix" title="Cabibbo–Kobayashi–Maskawa matrix">Cabibbo–Kobayashi–Maskawa</a></li> <li><a href="/wiki/Density_matrix" title="Density matrix">Density</a></li> <li><a href="/wiki/Fundamental_matrix_(computer_vision)" title="Fundamental matrix (computer vision)">Fundamental (computer vision)</a></li> <li><a href="/wiki/Fuzzy_associative_matrix" title="Fuzzy associative matrix">Fuzzy associative</a></li> <li><a href="/wiki/Gamma_matrices" title="Gamma matrices">Gamma</a></li> <li><a href="/wiki/Gell-Mann_matrices" title="Gell-Mann matrices">Gell-Mann</a></li> <li><a href="/wiki/Hamiltonian_matrix" title="Hamiltonian matrix">Hamiltonian</a></li> <li><a href="/wiki/Irregular_matrix" title="Irregular matrix">Irregular</a></li> <li><a href="/wiki/Overlap_matrix" class="mw-redirect" title="Overlap matrix">Overlap</a></li> <li><a href="/wiki/S-matrix" title="S-matrix">S</a></li> <li><a href="/wiki/State-transition_matrix" title="State-transition matrix">State transition</a></li> <li><a href="/wiki/Substitution_matrix" title="Substitution matrix">Substitution</a></li> <li><a href="/wiki/Z-matrix_(chemistry)" title="Z-matrix (chemistry)">Z (chemistry)</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Related terms</th><td class="navbox-list-with-group navbox-list navbox-odd" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Jordan_normal_form" title="Jordan normal form">Jordan normal form</a></li> <li><a href="/wiki/Linear_independence" title="Linear independence">Linear independence</a></li> <li><a href="/wiki/Matrix_exponential" title="Matrix exponential">Matrix exponential</a></li> <li><a href="/wiki/Matrix_representation_of_conic_sections" title="Matrix representation of conic sections">Matrix representation of conic sections</a></li> <li><a href="/wiki/Perfect_matrix" title="Perfect matrix">Perfect matrix</a></li> <li><a href="/wiki/Pseudoinverse" class="mw-redirect" title="Pseudoinverse">Pseudoinverse</a></li> <li><a href="/wiki/Row_echelon_form" title="Row echelon form">Row echelon form</a></li> <li><a href="/wiki/Wronskian" title="Wronskian">Wronskian</a></li></ul> </div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div> <ul><li><b><span class="nowrap"><span class="noviewer" typeof="mw:File"><a href="/wiki/File:Nuvola_apps_edu_mathematics_blue-p.svg" class="mw-file-description"><img alt="icon" src="//upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Nuvola_apps_edu_mathematics_blue-p.svg/16px-Nuvola_apps_edu_mathematics_blue-p.svg.png" decoding="async" width="16" height="16" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Nuvola_apps_edu_mathematics_blue-p.svg/24px-Nuvola_apps_edu_mathematics_blue-p.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/3/3e/Nuvola_apps_edu_mathematics_blue-p.svg/32px-Nuvola_apps_edu_mathematics_blue-p.svg.png 2x" data-file-width="128" data-file-height="128" /></a></span> </span><a href="/wiki/Portal:Mathematics" title="Portal:Mathematics">Mathematics&#32;portal</a></b></li> <li><a href="/wiki/List_of_matrices" class="mw-redirect" title="List of matrices">List of matrices</a></li> <li><a href="/wiki/Category:Matrices" title="Category:Matrices">Category:Matrices</a></li></ul> </div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐web.codfw.main‐f69cdc8f6‐vh5cv Cached time: 20241122143411 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1, show‐toc] CPU time usage: 0.473 seconds Real time usage: 0.672 seconds Preprocessor visited node count: 4725/1000000 Post‐expand include size: 79671/2097152 bytes Template argument size: 8730/2097152 bytes Highest expansion depth: 17/100 Expensive parser function count: 9/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 39700/5000000 bytes Lua time usage: 0.241/10.000 seconds Lua memory usage: 5328089/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 486.173 1 -total 24.69% 120.051 1 Template:Reflist 18.29% 88.926 1 Template:Matrix_classes 17.91% 87.087 1 Template:Navbox 16.15% 78.500 1 Template:Short_description 14.89% 72.394 3 Template:Ambox 12.63% 61.391 1 Template:More_citations_needed 11.94% 58.058 65 Template:Math 11.16% 54.275 2 Template:Pagetype 11.08% 53.867 2 Template:Cite_book --> <!-- Saved in parser cache with key enwiki:pcache:idhash:831350-0!canonical and timestamp 20241122143411 and revision id 1258478455. 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?type=1x1" 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=Distance_matrix&amp;oldid=1258478455">https://en.wikipedia.org/w/index.php?title=Distance_matrix&amp;oldid=1258478455</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">Categories</a>: <ul><li><a href="/wiki/Category:Metric_geometry" title="Category:Metric geometry">Metric geometry</a></li><li><a href="/wiki/Category:Bioinformatics" title="Category:Bioinformatics">Bioinformatics</a></li><li><a href="/wiki/Category:Matrices" title="Category:Matrices">Matrices</a></li><li><a href="/wiki/Category:Graph_distance" title="Category:Graph distance">Graph distance</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><li><a href="/wiki/Category:Articles_needing_additional_references_from_February_2017" title="Category:Articles needing additional references from February 2017">Articles needing additional references from February 2017</a></li><li><a href="/wiki/Category:All_articles_needing_additional_references" title="Category:All articles needing additional references">All articles needing additional references</a></li><li><a href="/wiki/Category:Articles_to_be_expanded_from_December_2023" title="Category:Articles to be expanded from December 2023">Articles to be expanded from December 2023</a></li><li><a href="/wiki/Category:Articles_needing_cleanup_from_December_2023" title="Category:Articles needing cleanup from December 2023">Articles needing cleanup from December 2023</a></li><li><a href="/wiki/Category:All_pages_needing_cleanup" title="Category:All pages needing cleanup">All pages needing cleanup</a></li><li><a href="/wiki/Category:Cleanup_tagged_articles_with_a_reason_field_from_December_2023" title="Category:Cleanup tagged articles with a reason field from December 2023">Cleanup tagged articles with a reason field from December 2023</a></li><li><a href="/wiki/Category:Wikipedia_pages_needing_cleanup_from_December_2023" title="Category:Wikipedia pages needing cleanup from December 2023">Wikipedia pages needing cleanup from December 2023</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 19 November 2024, at 23:39<span class="anonymous-show">&#160;(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=Distance_matrix&amp;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" 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"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </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-f69cdc8f6-4d6jn","wgBackendResponseTime":134,"wgPageParseReport":{"limitreport":{"cputime":"0.473","walltime":"0.672","ppvisitednodes":{"value":4725,"limit":1000000},"postexpandincludesize":{"value":79671,"limit":2097152},"templateargumentsize":{"value":8730,"limit":2097152},"expansiondepth":{"value":17,"limit":100},"expensivefunctioncount":{"value":9,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":39700,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 486.173 1 -total"," 24.69% 120.051 1 Template:Reflist"," 18.29% 88.926 1 Template:Matrix_classes"," 17.91% 87.087 1 Template:Navbox"," 16.15% 78.500 1 Template:Short_description"," 14.89% 72.394 3 Template:Ambox"," 12.63% 61.391 1 Template:More_citations_needed"," 11.94% 58.058 65 Template:Math"," 11.16% 54.275 2 Template:Pagetype"," 11.08% 53.867 2 Template:Cite_book"]},"scribunto":{"limitreport-timeusage":{"value":"0.241","limit":"10.000"},"limitreport-memusage":{"value":5328089,"limit":52428800},"limitreport-logs":"table#1 {\n [\"size\"] = \"tiny\",\n}\n"},"cachereport":{"origin":"mw-web.codfw.main-f69cdc8f6-vh5cv","timestamp":"20241122143411","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Distance matrix","url":"https:\/\/en.wikipedia.org\/wiki\/Distance_matrix","sameAs":"http:\/\/www.wikidata.org\/entity\/Q901698","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q901698","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":"2004-07-16T11:48:06Z","dateModified":"2024-11-19T23:39:55Z","headline":"square matrix (two-dimensional array) containing the distances, taken pairwise, between the elements of a set. Depending upon the application involved, the distance being used to define this matrix may or may not be a metric"}</script> </body> </html>

Pages: 1 2 3 4 5 6 7 8 9 10