Approximation Algorithm for the Cyclic Swap Problem Yoan Jos´ e Pinz´on Ardila 1 , Costas S. Iliopoulos 1 , Gad M. Landau 2 , Manal Mohamed 1 1 King’s College London, Dept. of Computer Science, London WC2R 2LS, UK e-mail: Yoan.Pinzon@kcl.ac.uk , e-mail: 〈csi,manal 〉@dcs.kcl.ac.uk 2 Dept. of Computer Science, Haifa University, Haifa 31905, Israel e-mail: landau@cs.haifa.ac.il Abstract. Given two n-bit (cyclic) binary strings, A and B, represented on a circle (necklace instances). Let each sequence have the same number k of 1’s. We are interested in computing the cyclic swap distance between A and B, i.e., the minimum number of swaps needed to convert A into B, minimized over all rotations of B. We show that this distance may be approximated in O(n + k 2 ) time. 1 Introduction Cyclic string comparison is important for different domains where linear strings represent cyclic sequences, for example, in computational biology the genetic material is sequenced from circular DNA or RNA molecules. Bacterial, chloroplasts and mitochondrial genomes are in majority circular [2]. Small circular DNA molecules that have the ability to replicate on their own, are extensively used in biotechnology [2]. All such cyclic molecules are represented as linear strings by choosing an arbitrary starting point. It follows that the comparison of two such sequences needs to consider all possible cyclic shifts of one of the sequences. DNA, as well as RNA, are oriented molecules, therefore, in some cases, e.g., for Expressed Sequence Tags, sequences must be compared in each orientation [1]. Other domains are pattern representation and recognition [6]. There, polygonal shapes are encoded into linear strings by choosing arbitrarily a start position on the contour. Determining if two shapes are similar requires to compare one string with all cyclic shifts of the other. Another domain in which cyclic strings arise is computational music analysis. Math- ematics and music theory have a long history of collaboration dating back to at least Pythagoras [11]. More recently the emphasis has been mainly on analysing string pattern matching problems that arise in music theory [7, 8, 9, 10]. A fundamental problem in music theory is to measure the similarity between rhythms, with many applications such as copyright infringement resolution and music information retrieval. 1