Kendall Tau Sequence Distance: Extending Kendall Tau from Ranks to Sequences

An edit distance is a measure of the minimum cost sequence of edit operations to transform one structure into another. Edit distance is most commonly encountered within the context of strings, where Wagner and Fischer's string edit distance is perhaps the most well-known. However, edit distance is not limited to strings. For example, there are several edit distance measures for permutations, including Wagner and Fischer's string edit distance since a permutation is a special case of a string. However, another edit distance for permutations is Kendall tau distance, which is the number of pairwise element inversions. On permutations, Kendall tau distance is equivalent to an edit distance with adjacent swap as the edit operation. A permutation is often used to represent a total ranking over a set of elements. There exist multiple extensions of Kendall tau distance from total rankings (permutations) to partial rankings (i.e., where multiple elements may have the same rank), but none of these are suitable for computing distance between sequences. We set out to explore extending Kendall tau distance in a different direction, namely from the special case of permutations to the more general case of strings or sequences of elements from some finite alphabet. We name our distance metric Kendall tau sequence distance, and define it as the minimum number of adjacent swaps necessary to transform one sequence into the other. We provide two $O(n \lg n)$ algorithms for computing it, and experimentally compare their relative performance. We also provide reference implementations of both algorithms in an open source Java library.

[1]  Vincent A. Cicirello,et al.  The Permutation in a Haystack Problem and the Calculus of Search Landscapes , 2016, IEEE Transactions on Evolutionary Computation.

[2]  Kenneth Sörensen,et al.  Permutation distance measures for memetic algorithms with population management , 2005 .

[3]  S. Ronald,et al.  More distance functions for order-based encodings , 1998, 1998 IEEE International Conference on Evolutionary Computation Proceedings. IEEE World Congress on Computational Intelligence (Cat. No.98TH8360).

[4]  Vincent A. Cicirello JavaPermutationTools: A Java Library of Permutation Distance Metrics , 2018, J. Open Source Softw..

[5]  S. Ronald Distance functions for order-based encodings , 1997, Proceedings of 1997 IEEE International Conference on Evolutionary Computation (ICEC '97).

[6]  Vincent A. Cicirello,et al.  Profiling the Distance Characteristics of Mutation Operators for Permutation-Based Genetic Algorithms , 2013, FLAIRS Conference.

[7]  Ronald Fagin,et al.  Comparing top k lists , 2003, SODA '03.

[8]  Michael J. Fischer,et al.  The String-to-String Correction Problem , 1974, JACM.

[9]  Ronald Fagin,et al.  Comparing Partial Rankings , 2006, SIAM J. Discret. Math..

[10]  Vicente Campos,et al.  Scatter Search vs. Genetic Algorithms , 2002 .

[11]  Vincent A. Cicirello,et al.  Classification of Permutation Distance Metrics for Fitness Landscape Analysis , 2019, BICT.

[12]  W. Knight A Computer Method for Calculating Kendall's Tau with Ungrouped Data , 1966 .

[13]  Rafael Martí,et al.  Context-Independent Scatter and Tabu Search for Permutation Problems , 2005, INFORMS J. Comput..

[14]  Marina Meila,et al.  An Exponential Model for Infinite Rankings , 2010, J. Mach. Learn. Res..

[15]  Kenneth Sörensen,et al.  Distance measures based on the edit distance for permutation-type representations , 2007, J. Heuristics.

[16]  S. Ronald Finding multiple solutions with an evolutionary algorithm , 1995, Proceedings of 1995 IEEE International Conference on Evolutionary Computation.

[17]  M. Kendall A NEW MEASURE OF RANK CORRELATION , 1938 .