English

Adaptive Computation of the Swap-Insert Correction Distance

Data Structures and Algorithms 2015-06-30 v2

Abstract

The Swap-Insert Correction distance from a string SS of length nn to another string LL of length mnm\geq n on the alphabet [1..d][1..d] is the minimum number of insertions, and swaps of pairs of adjacent symbols, converting SS into LL. Contrarily to other correction distances, computing it is NP-Hard in the size dd of the alphabet. We describe an algorithm computing this distance in time within O(d2nmgd1)O(d^2 nm g^{d-1}), where there are nαn_\alpha occurrences of α\alpha in SS, mαm_\alpha occurrences of α\alpha in LL, and where g=maxα[1..d]min{nα,mαnα}g=\max_{\alpha\in[1..d]} \min\{n_\alpha,m_\alpha-n_\alpha\} measures the difficulty of the instance. The difficulty gg is bounded by above by various terms, such as the length of the shortest string SS, and by the maximum number of occurrences of a single character in SS. Those results illustrate how, in many cases, the correction distance between two strings can be easier to compute than in the worst case scenario.

Keywords

Cite

@article{arxiv.1504.07298,
  title  = {Adaptive Computation of the Swap-Insert Correction Distance},
  author = {Jérémy Barbay and Pablo Pérez-Lantero},
  journal= {arXiv preprint arXiv:1504.07298},
  year   = {2015}
}

Comments

16 pages, no figures, long version of the extended abstract accepted to SPIRE 2015

R2 v1 2026-06-22T09:23:50.287Z