Abstract
Let a text string T of n symbols and a pattern string P of m symbols from alphabet ∑ be given. A swapped version P′ of P is a length m string derived from P by a series of local swaps, (i.e. p′ ℓ← p ℓ+1 and p ′ℓ+1 ← pℓ) where each element can participate in no more than one swap. The Pattern Matching with Swaps problem is that of finding all locations i of T for which there exists a swapped version P′ of P with an exact matching of P′ in location i of T.
Recently, some efficient algorithms were developed for this problem. Their time complexity is better than the best known algorithms for pattern matching with mismatches. However, the Approximate Pattern Matching with Swaps problem was not known to be solved faster than the pattern matching with mismatches problem.
In the Approximate Pattern Matching with Swaps problem the output is, for every text location i where there is a swapped match of P, the number of swaps necessary to create the swapped version that matches location i. The fastest known method to-date is that of counting mismatches and dividing by two. The time complexity of this method is \( O(n\sqrt {m\log m} )\) for a general alphabet ∑.
In this paper we show an algorithm that counts the number of swaps at every location where there is a swapped matching in time O(n log m log σ), where σ = min(m, ∣∑∣). Consequently, the total time for solving the approximate pattern matching with swaps problem is O(f(n,m) +n log m log σ), where f(n,m) is the time necessary for solving the pattern matching with swaps problem.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
K. Abrahamson. Generalized string matching. SIAM J. Comp., 16(6):1039–1051, 1987.
A. Amir, Y. Aumann, G. Landau, M. Lewenstein, and N. Lewenstein. Pattern matching with swaps. Submitted for publication.
A. Amir, Y. Aumann, G. Landau, M. Lewenstein, and N. Lewenstein. Pattern matching with swaps. Proc. 38th IEEE FOCS, 144–153, 1997.
A. Amir and M. Farach. Efficient 2-dimensional approximate matching of halfrectangular figures. Information and Computation, 118(1):1–11, April 1995.
A. Amir, G. M. Landau, M. Lewenstein, and N. Lewenstein. Efficient special cases of pattern matching with swaps. Information Processing Letters, 68(3):125–132, 1998.
R. Cole and R. Harihan. Randomized swap matching in o(m log m log ∣σ∣) time. Technical Report TR1999–789, New York University, Courant Institute, September 1999.
R. Cole and R. Hariharan. Approximate string matching: A faster simpler algorithm. In Proc. 9th ACM-SIAM Symposium on Discrete Algorithms (SODA), 463–472, 1998.
M. J. Fischer and M. S. Paterson. String matching and other products. Complexity of Computation, R. M. Karp (editor), SIAM-AMS Proceedings, 7:113–125, 1
Z. Galil and K. Park. An improved algorithm for approximate string matching. SIAM J. Comp., 19(6):989–999, 1990.
D. E. Knuth, J. H. Morris, and V. R. Pratt. Fast pattern matching in strings. SIAM J. Comp., 6:323–350, 1977.
G. M. Landau and U. Vishkin. Fast parallel and serial approximate string matching. Journal of Algorithms, 10(2):157–169, 1989.
G. M. Landau, E. W. Myers, and J. P. Schmidt. Incremental string comparison. SIAM J. Comp., 27(2):557–582, 1998.
V. I. Levenshtein. Binary codes capable of correcting, deletions, insertions and reversals. Soviet Phys. Dokl., 10:707–710, 1966.
R. Lowrance and R. A. Wagner. An extension of the string-to-string correction problem. J. of the ACM, 177–183, 1975.
S. Muthukrishnan and H. Ramesh. String matching under a general matching relation. Information and Computation, 122(1):140–148, 1995.
J. Naor and M. Naor. Small-bias probability spaces: Efficient constructions and applications. SIAM J. Comp., 838–856, 1993.
M. V. Olson. A time to sequence. Science, 270:394–396, 1995.
A. Pentland. Invited talk. NSF Institutional Infrastructure Workshop, 1992.
R. A. Wagner. On the complexity of the extended string-to-string correction problem. In Proc. 7th ACM STOC, 218–223, 1975.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Amir, A., Lewenstein, M., Porat, E. (2000). Approximate Swapped Matching. In: Kapoor, S., Prasad, S. (eds) FST TCS 2000: Foundations of Software Technology and Theoretical Computer Science. FSTTCS 2000. Lecture Notes in Computer Science, vol 1974. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44450-5_24
Download citation
DOI: https://doi.org/10.1007/3-540-44450-5_24
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-41413-1
Online ISBN: 978-3-540-44450-3
eBook Packages: Springer Book Archive