## String matching with variable length gaps

Publication: Research - peer-review › Journal article – Annual report year: 2012

### Standard

**String matching with variable length gaps.** / Bille, Philip; Gørtz, Inge Li; Vildhøj, Hjalte Wedel; Wind, David Kofoed.

Publication: Research - peer-review › Journal article – Annual report year: 2012

### Harvard

*Theoretical Computer Science*, vol 443, pp. 25-34. DOI: 10.1016/j.tcs.2012.03.029

### APA

*String matching with variable length gaps*.

*Theoretical Computer Science*,

*443*, 25-34. DOI: 10.1016/j.tcs.2012.03.029

### CBE

### MLA

*Theoretical Computer Science*. 2012, 443. 25-34. Available: 10.1016/j.tcs.2012.03.029

### Vancouver

### Author

### Bibtex

}

### RIS

TY - JOUR

T1 - String matching with variable length gaps

AU - Bille,Philip

AU - Gørtz,Inge Li

AU - Vildhøj,Hjalte Wedel

AU - Wind,David Kofoed

PY - 2012

Y1 - 2012

N2 - We consider string matching with variable length gaps. Given a string T and a pattern P consisting of strings separated by variable length gaps (arbitrary strings of length in a specified range), the problem is to find all ending positions of substrings in T that match P. This problem is a basic primitive in computational biology applications. Let m and n be the lengths of P and T, respectively, and let k be the number of strings in P. We present a new algorithm achieving time O(nlogk+m+α) and space O(m+A), where A is the sum of the lower bounds of the lengths of the gaps in P and α is the total number of occurrences of the strings in P within T. Compared to the previous results this bound essentially achieves the best known time and space complexities simultaneously. Consequently, our algorithm obtains the best known bounds for almost all combinations of m, n, k, A, and α. Our algorithm is surprisingly simple and straightforward to implement. We also present algorithms for finding and encoding the positions of all strings in P for every match of the pattern.

AB - We consider string matching with variable length gaps. Given a string T and a pattern P consisting of strings separated by variable length gaps (arbitrary strings of length in a specified range), the problem is to find all ending positions of substrings in T that match P. This problem is a basic primitive in computational biology applications. Let m and n be the lengths of P and T, respectively, and let k be the number of strings in P. We present a new algorithm achieving time O(nlogk+m+α) and space O(m+A), where A is the sum of the lower bounds of the lengths of the gaps in P and α is the total number of occurrences of the strings in P within T. Compared to the previous results this bound essentially achieves the best known time and space complexities simultaneously. Consequently, our algorithm obtains the best known bounds for almost all combinations of m, n, k, A, and α. Our algorithm is surprisingly simple and straightforward to implement. We also present algorithms for finding and encoding the positions of all strings in P for every match of the pattern.

KW - String matching

KW - Variable length gaps

KW - Algorithms

U2 - 10.1016/j.tcs.2012.03.029

DO - 10.1016/j.tcs.2012.03.029

M3 - Journal article

VL - 443

SP - 25

EP - 34

JO - Theoretical Computer Science

T2 - Theoretical Computer Science

JF - Theoretical Computer Science

SN - 0304-3975

ER -