Swap Distance (Q7361034)

From MaRDI portal

!

This is the item page for this Wikibase entity, intended for internal use and editing purposes. Please use the normal view instead:

AFP entry Swap_Distance
Language Label Description Also known as
default for all languages
No label defined
    English
    Swap Distance
    AFP entry Swap_Distance

      Statements

      22 January 2026
      0 references
      Manuel Eberl
      0 references
      Swap Distance (English)
      0 references
      Given two lists that are permutations of one another, the swap distance (also known as the Kendall tau distance ) is the minimum number of swap operations of adjacent elements required to make the two lists the same. Equivalently, the swap distance of two finite linear orders $\preceq$ and $\unlhd$ is the number of disagreements of the two orders, i.e. of pairs $(x,y)$ such that $x\prec y$ and $y\lhd x$. This article defines these two notions of swap distance as well as their equivalence under the obvious isomorphism between lists and linear orders given by interpreting a list as a ranking of elements in descending order. An efficient $O(n\log n)$ algorithm to compute the swap distance is also provided via the connection to the number of inversions of a list, for which an efficient algorithm is already available in the AFP.
      0 references
      0 references