# (Prefix) reversal distance for (signed) strings with few blocks or small alphabets

Abstract : We study the String Reversal Distance problem, an extension of the well-known Sorting by Reversals problem. String Reversal Distance takes two strings S and T built on an alphabet Σ as input, and asks for a minimum number of reversals to obtain T from S. We consider four variants: String Reversal Distance, String Prefix Reversal Distance(a constrained version of the previous problem, in which any reversal must include the first letter of the string), and the signed variants of these problems, namely Signed String Reversal Distance and Signed String Prefix Reversal Distance. We study algorithmic properties of these four problems, in connection with two parameters of the input strings: the number of blocks they contain (a block being a maximal substring such that all letters in the substring are equal), and the alphabet size |Σ||Σ|. Concerning the number of blocks, we show that the four problems are fixed-parameter tractable (FPT) when the considered parameter is the maximum number of blocks among the two input strings. Concerning the alphabet size, we first show that String Reversal Distance and String Prefix Reversal Distance are NP-hard even if the input strings are built on a binary alphabet Σ={0,1}Σ={0,1}, each 0-block has length at most two and each 1-block has length one. We also show that Signed String Reversal Distance and Signed String Prefix Reversal Distance are NP-hard even if the input strings have only one letter. Finally, when |Σ|=O(1)|Σ|=O(1), we provide a singly-exponential algorithm that computes the exact distance between any pair of strings, for a large family of distances that we call well-formed, which includes the four distances we study here.
Type de document :
Article dans une revue
Journal of Discrete Algorithms, Elsevier, 2016, 37, pp.44-55. 〈10.1016/j.jda.2016.05.002〉
Domaine :

https://hal.archives-ouvertes.fr/hal-01318663
Contributeur : Guillaume Fertin <>
Soumis le : jeudi 19 mai 2016 - 17:35:18
Dernière modification le : jeudi 5 juillet 2018 - 14:45:50

### Citation

Laurent Bulteau, Guillaume Fertin, Christian Komusiewicz. (Prefix) reversal distance for (signed) strings with few blocks or small alphabets. Journal of Discrete Algorithms, Elsevier, 2016, 37, pp.44-55. 〈10.1016/j.jda.2016.05.002〉. 〈hal-01318663〉

### Métriques

Consultations de la notice