the classical pattern matching problem is to find all the occurrences of a given pattern  of length m in a text  of length n , both being sequences of characters drawn from a finite character set . this problem is interesting as a fundamental computer science problem and is a basic requirement of many practical applications . the circular pattern , denoted by ( ) , corresponding to a given pattern  = 1  m , is formed by connecting 1 with m and forming a sort of a cycle ; this gives us the notion where the same circular pattern can be seen as m different linear patterns , which would all be considered equivalent . in the circular pattern matching ( cpm ) problem , we are interested in pattern matching between the text  and the circular pattern ( ) of a given pattern . we can view ( ) as a set of m patterns starting at positions j  [ 1 : m ] and wrapping around the end . in other words , in cpm ,
we search for all  conjugates  ( two words x , y are conjugate if there exist words u , v such that x = uv and y = vu ) of a given pattern in a given text . the problem of circular pattern matching has been considered in , where an (n)-time algorithm is presented . a naive solution with quadratic complexity
consists in applying a classical algorithm for searching a finite set of strings after having built the trie of rotations of . the approach presented in   consists in preprocessing  by constructing a suffix automaton of the string  , by noting that every rotation of  is a factor of . then , by feeding  into the automaton , the lengths of the longest factors of  occurring in  can be found by the links followed in the automaton in time (n ) . in
, the authors have presented an optimal average - case algorithm for cpm , by also showing that the average - case lower bound for the ( linear ) pattern matching of (n  logm / m ) also holds for cpm , where  = || .
recently , in , the authors have presented two fast average - case algorithms based on word - level parallelism .
the first algorithm requires average - case time (n  logm / w ) , where w is the number of bits in the computer word .
the second one is based on a mixture of word - level parallelism and q - grams .
the authors have shown that with the addition of q - grams , and by setting q = (logm ) , an optimal average - case time of (n  logm / m ) can be achieved . very recently in , the authors have presented an efficient algorithm for cpm that runs in (n ) time on average . to the best of our knowledge ,
notably , indexing circular patterns   and variations of approximate circular pattern matching under the edit distance model   have also been considered in the literature .
approximate circular pattern matching has also been studied recently in [ 4 , 7 ] . in this paper
however , we focus on the exact version of cpm . apart from being interesting from the pure combinatorial point of view , cpm has applications in areas like geometry , astronomy , computational biology , and so forth .
now , given the data stream of a number of polygons , we may need to find out whether a desired polygon exists in the data stream .
the difficulty in this situation lies in the fact that the same polygon may be encoded differently depending on its  starting  coordinate and hence , there exist k possible encodings where k is the number of vertices of the polygon .
therefore , instead of traditional pattern matching , we need to resort to problem cpm .
this problem seems to be useful in computer graphics as well and hence may be used as a built - in function in graphics cards handling polygon rendering .
this type of circular pattern occurs in the dna of viruses [ 9 , 10 ] , bacteria , eukaryotic cells , and archaea . as a result ,
as has been noted in , algorithms on circular strings seem to be important in the analysis of organisms with such structures .
circular strings have also been studied in the context of sequence alignment . in , basic algorithms for pairwise and multiple circular sequence alignment have been presented .
these results have later been improved in , where an additional preprocessing stage is added to speed up the execution time of the algorithm . in , the authors also have presented efficient algorithms for finding the optimal alignment and consensus sequence of circular sequences under the hamming distance metric .
furthermore , as has been mentioned in , this problem seems to be related to the much studied swap matching problem ( in cpm , the patterns can be thought of as having a swap of two parts of it )   and also to the problem of pattern matching with address error ( the circular pattern can be thought of as having a special type of address error ) [ 19 , 20 ] . for further details on the motivation and applications of this problem in computational biology and other areas the readers
, we present simplificpm ( pronounced simplify cpm ) , which is a fast and efficient algorithm for the circular pattern matching problem based on some filtering techniques .
in particular , we employ a number of simple and effective filters to preprocess the given pattern and the text . after this preprocessing
, we get a text of reduced length on which we can apply any existing state - of - the - art algorithms to get the occurrences of the circular pattern .
so , as the name sounds , simplificpm , in some sense , simplifies the search space of the circular pattern matching problem .
we have conducted extensive experiments to compare our algorithm with the state - of - the - art algorithms and the results are found to be excellent .
our algorithm turns out to be much faster in practice because of the huge reduction in the search space through filtering .
also , the filtering techniques we use are simple and lightweight but as can be realized from the results extremely effective .
section 2 gives a preliminary description of some terminologies and concepts related to stringology that will be used throughout this paper . in section 3
the empty string  is a string of length 0 ; that is , || = 0 .
let  =   { }. for a string w = xyz , x , y , and z are called a prefix , factor ( or , equivalently , substring ) , and suffix of w , respectively .
the ith character of a string w is denoted by w[i ] for 1  i  |w| , and the factor of a string w that begins at position i and ends at position j is denoted by w[i : j ] for 1  i  j  |w| . for convenience , we assume w[i : j ] =  if j < i. a k - factor is a factor of length k. a circular string of length m can be viewed as a traditional linear string which has the leftmost and rightmost symbols wrapped around and stuck together in some way . under this notion , the same circular string can be seen as m different linear strings , which would all be considered equivalent .
given a string  of length m , we denote by  = [i : m][1 : i  1 ] , 0 <
i < m , the ith rotation of  and  = . 
 example 1 .
the pattern  has the following rotations ( i.e. , conjugates ) :  = tcgatga ,   = cgatgat ,   = gatgatc ,   = atgatcg ,   = tgatcga ,  and   = gatcgat . 
 
the pattern  has the following rotations ( i.e. , conjugates ) :  = tcgatga ,   = cgatgat ,   = gatgatc ,   = atgatcg ,   = tgatcga ,  and   = gatcgat .
here we consider the problem of finding occurrences of a pattern string  of length m with circular structure in a text string  of length n with linear structure .
so if a biologist wishes to find occurrences of a particular virus in a carrier 's dna sequence , which may not be circular , ( s)he must locate all positions in  where at least one rotation of  occurs .
we consider the dna alphabet , that is ,  = { a , c , g , t}. in our approach , each character of the alphabet is associated with a numeric value as follows .
each character is assigned a unique number from the range [ 1  || ] .
although this is not essential , we conveniently assign the numbers from the range [ 1  || ] to the characters of  following their inherent lexicographical order .
we use num(x ) , x   , to denote the numeric value of the character x. so , we have num(a ) = 1 , num(c ) = 2 , num(g ) = 3 , and num(t ) = 4 . for a string
s , we use the notation sn to denote the numeric representation of the string s ; sn[i ] denotes the numeric value of the character s[i ] .
so , if s[i ] = g then sn[i ] = num(g ) = 3 .
the concept of circular strings and their rotations also applies naturally on their numeric representations as is illustrated in example 2 below . 

this numeric representation has the following rotations : n = 4231431 , n = 2314314 , n = 3143142 , n = 1431423 , n = 4314231 , and n = 3142314 . 
 
and this numeric representation has the following rotations : n = 4231431 , n = 2314314 , n = 3143142 , n = 1431423 , n = 4314231 , and n = 3142314 . the problem we handle in this paper can be formally defined as follows . 

problem 3 ( circular pattern matching ( cpm ) ) . given a pattern  of length m and a text  of length n  m ,
find all factors  of  such that  =  , for some 0  i < m. and if we have  =  for some 0  i < m , then we say that the circular pattern ( ) matches  at position i. 
  given a pattern  of length m and a text  of length n  m , find all factors  of  such that  =  , for some 0  i < m. and if we have  =  for some 0  i < m , then we say that the circular pattern ( ) matches  at position i. in the context of our filter - based algorithm the concept of false positives and negatives is important .
suppose we have an algorithm  to solve a problem . now suppose that true represents the set of true solutions for problem . further suppose that  computes the set  as the set of solutions for . now assume that true  . then , the set of false positives can be computed as follows : true , where    refers to the set difference operation .
in other words , the set computed by  contains some solutions that are not true solutions for problem . and these are the false positives , because  falsely marked these as solutions ( i.e. , positive ) . on the other hand ,
the set of false negatives can be computed as follows : true. in other words , false negatives are those members in true that are absent in . these are false negatives because  falsely marked these as nonsolutions ( i.e. , negative ) .
suppose we are given a pattern  and a text . we will frequently and conveniently use the expression 
 circularly matches  at position i  ) to indicate that one of the conjugates of  matches  at position i. we start with a brief overview of our approach below . in simplificpm
, we first employ a number of filters to compute a set  of indexes of  such that ( ) matches  at position i  . as will be clear shortly , our filters are unable to compute the true set of indexes and hence  may have false positives .
however , our filters are designed in such a way that there are no false negatives .
hence , for all j   , we can be sure that there is no match .
on the other hand , for all i   , we may or may not have a match ; that is , we may have false positives .
so , after we have computed  , we compute  , a reduced version of  concatenating all the factors [i  i + m  1 ] , i   , putting a special character $   in between the factors .
there can be i , j   such that 1 < j  i < p. in other words , there can exist overlapping factors matching with (p ) .
however , this can be handled easily through simple bookkeeping as will be evident from our algorithm in later sections .
clearly , once we have computed the reduced text  we can employ any state - of - the - art algorithm to solve cpm on  to get the actual occurrences .
so the most essential and useful feature of simplificpm is the application of filters to get a reduced text on which any existing algorithm can be applied to solve cpm . in simplificpm
we also discuss the related notions and notations needed to describe these filters . in what follows
we describe our filters in the context of two strings of equal length n , namely ,  and  , where the former is a circular string and the latter is linear
. we will devise and apply different functions on these strings and present observations related to these functions which in the sequel will lead us to our desired filter .
the key to our observations and the resulting filters is the fact that each function we devise results in a unique output when applied to the rotations of a circular string .
for example , consider a hypothetical function . we will always have the relation that ( ) = ( ) for all 1  i < n. recall that  actually denotes . for the sake of conciseness , for such functions , we will abuse the notation a bit and use (( ) ) to represent ( ) for all 0  i <
|| . we define the function sum on a string  of length m as follows : sum( ) = i=1pn[i ] .
consider a circular string  and a linear string  both having length n. if ( ) matches  , then we must have sum(( ) ) = sum( ) . 
 
consider a circular string  and a linear string  both having length n. if ( ) matches  , then we must have sum(( ) ) = sum( ) . 

as can be easily verified , here  circularly matches . in fact the match is due to the conjugate . now we have n = 4314231 and sum( ) = 18 .
then , according to observation 1 , we must have sum(( ) ) = 18 .
this can indeed be verified easily.now consider another string  = atagctg , which is slightly different from . it can be easily verified that ( ) does not match . now , n
= 1413243 and hence here also we have sum( ) = 18 = sum(( ) ) .
as can be easily verified , here  circularly matches . in fact the match is due to the conjugate . now we have n = 4314231 and sum( ) = 18 .
then , according to observation 1 , we must have sum(( ) ) = 18 .
now consider another string  = atagctg , which is slightly different from . it can be easily verified that ( ) does not match . now , n
= 1413243 and hence here also we have sum( ) = 18 = sum(( ) ) .
our second and third filters , that is , filters 2 and 3 , depend on a notion of distance between consecutive characters of a string .
the distance between two consecutive characters of a string  of length m is defined by distance([i ] , [i + 1 ] ) = [i ]  [i + 1 ] , where 1  i  m  1 .
we also define an absolute version of it : abs_total_distance(p ) = i=1abs(distance([i ] , [i + 1 ] ) ) , where abs(x ) returns the magnitude of x ignoring the sign . before we apply these two functions on our strings to get our filters , we need to do a simple preprocessing on the respective string , that is ,  in this case as follows .
we extend the string  by concatenating the first character of  at its end .
so , we have ext( ) = . since ext( ) can simply be treated as another string , we can easily extend the notation and concept of ( ) over ext( ) and we continue to abuse the notation a bit for the sake of conciseness as mentioned at the beginning of section 3.2 ( just before section 3.2.1 ) .
now we have the following observation which is the basis of our filter 2 . 

consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have abs_total_distance(( ) ) = abs_total_distance( ) .
note carefully that the function abs_total_distance ( ) has been applied on the extended strings . 
 
consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have abs_total_distance(( ) ) = abs_total_distance( ) .
note carefully that the function abs_total_distance ( ) has been applied on the extended strings . 

consider the same two strings of example 4 , that is ,  = atcgatg = tgatcga . here
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
it can be easily verified that abs_total_distance(( ) ) is also 14.now consider another string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that abs_total_distance( ) is still 14 .
so , this is an example of a false positive with respect to filter 2.now we present the following related observation which is the basis of our filter 3 .
note that observation 2 differs with observation 3 only through using the absolute version of the function used in the latter . 
 
consider the same two strings of example 4 , that is ,  = atcgatg = tgatcga . here
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
now consider another string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that abs_total_distance( ) is still 14 .
so , this is an example of a false positive with respect to filter 2 .
now we present the following related observation which is the basis of our filter 3 .
note that observation 2 differs with observation 3 only through using the absolute version of the function used in the latter . 

consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have total_distance(( ) ) = total_distance( ) .
note carefully that the function total_distance ( ) has been applied on the extended strings . 
 
consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have total_distance(( ) ) = total_distance( ) .
note carefully that the function total_distance ( ) has been applied on the extended strings . 

consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . here
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
it can be easily verified that total_distance(( ) ) is also 0.now consider another string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that total_distance( ) is still 0 .
so , this is an example of a false positive with respect to filter 3 . 
 
consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . here
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
now consider another string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that total_distance( ) is still 0 .
so , this is an example of a false positive with respect to filter 3 .
filter 4 uses the sum ( ) function used by filter 1 , albeit in a slightly different way .
consider a circular string  and a linear string  both having length n. if ( ) matches  , then , we must have sumx(( ) ) = sumx( ) for all x  . 
  consider a circular string  and a linear string  both having length n. if ( ) matches  , then , we must have sumx(( ) ) = sumx( ) for all x  . 
 example 7 .
consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . recall that  circularly matches  ( due to the conjugate  ) .
it is easy to calculate that suma( ) = 2 , sumc( ) = 2 , sumg( ) = 6 , and sumt( ) = 8 . hence according to observation 4 , the individual sum values for all the conjugates of  must also match this .
it can be easily verified that this is indeed the case.now consider the other string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , as we can see , still we have suma( ) = 2 , sumc( ) = 2 , sumg( ) = 6 , and sumt( ) = 8 .
consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga .
it is easy to calculate that suma( ) = 2 , sumc( ) = 2 , sumg( ) = 6 , and sumt( ) = 8 . hence according to observation 4 , the individual sum values for all the conjugates of  must also match this .
now consider the other string  = atagctg of the same length , which is slightly different from . it can easily be checked that ( ) does not match . however , as we can see , still we have suma( ) = 2 , sumc( ) = 2 , sumg( ) = 6 , and sumt( ) = 8 .
notably , a similar idea has been used by kahveci et al . in   for indexing large strings with a goal to achieve fast local alignment of large genomes .
compute the so - called frequency vector that keeps track of the frequency of each character of the dna alphabet in the string .
a modulo operation between two consecutive characters of a string  of length m is defined as follows : modulo([i ] , [i + 1 ] ) = n[i]%n[i + 1 ] , where 1  i  m  1 .
we define sum_modulo( ) to be the summation of the results of the modulo operations on the consecutive characters of . more formally , sum_modulo(p ) = i=1modulo([i ] , [i + 1 ] ) .
now we present the following observation which is the basis of filter 5 . note that this observation is applied on the extended versions of the respective strings . 

consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have sum_modulo(( ) ) = sum_modulo( ) .
note carefully that the function sum_modulo ( ) has been applied on the extended strings . 
  consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have sum_modulo(( ) ) = sum_modulo( ) .
note carefully that the function sum_modulo ( ) has been applied on the extended strings . 

consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . recall that  circularly matches  ( due to the conjugate  ) .
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
this is indeed true.now consider another string  = tgagatc of the same length , which is different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that sum_modulo( ) is still 5 .
so , this is an example of a false positive with respect to filter 5 . 
 
consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . recall that  circularly matches  ( due to the conjugate  ) .
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
hence , sum_modulo( ) = 5 . now according to observation 5 , we must also have sum_modulo(( ) ) = 5 .
now consider another string  = tgagatc of the same length , which is different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that sum_modulo( ) is still 5 .
so , this is an example of a false positive with respect to filter 5 . in filter 6
we employ the xor ( ) operation . a bitwise exclusive - or ( xor ( ) )
operation between two consecutive characters of a string  of length m is defined as follows : xor([i ] , [i + 1 ] ) = n[i]n[i + 1 ] , where 1  i  m  1 .
we define sum_xor( ) to be the summation of the results of the xor operations on the consecutive characters of . more formally , sum_xor(p ) = i=1xor([i ] , [i + 1 ] ) .
now we present the following observation which is the basis of filter 6 . note that this observation is applied on the extended versions of the respective strings . 

consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have sum_xor(( ) ) = sum_xor( ) .
note carefully that the function sum_xor ( ) has been applied on the extended strings . 
  consider a circular string  and a linear string  both having length n and assume that  = ext( ) and  = ext( ) .
if ( ) matches  , then , we must have sum_xor(( ) ) = sum_xor( ) .
note carefully that the function sum_xor ( ) has been applied on the extended strings . 

consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . recall that  circularly matches  ( due to the conjugate  ) .
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
hence , sum_xor( ) = 28 . now according to observation 5 , we must also have sumxor(( ) ) = 28 .
as can be verified easily , this is indeed the case.now consider another string  = gtagatc of the same length , which is different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that sum_xor( ) is still 28 .
so , this is an example of a false positive with respect to filter 5 . 
 
consider the same two strings of previous examples , that is ,  = atcgatg = tgatcga . recall that  circularly matches  ( due to the conjugate  ) .
now consider the extended strings and assume that  = ext( ) and  = ext( ) .
hence , sum_xor( ) = 28 . now according to observation 5 , we must also have sumxor(( ) ) = 28 . as can be verified easily ,
now consider another string  = gtagatc of the same length , which is different from . it can easily be checked that ( ) does not match . however , assuming that  = ext( ) we find that sum_xor( ) is still 28 .
so , this is an example of a false positive with respect to filter 5 . at this point
a brief discussion with respect to our preliminary work in   is in order . to reduce the text 
while filter 1 and filter 4 remain identical , in simplificpm , we have changed and improved filters 2 , 3 , 5 , and 6 to get better results . in particular , we have introduced the concept of extended string here and modified the filters accordingly .
much of the efficiency of these new filters comes from the fact that in the preliminary version , without the extended strings , we had to deal with a set of values as the output of the functions creating a small bottleneck . on the contrary
, simplificpm now needs to deal with only one value as the output of the functions of filters 2 , 3 , 5 , and 6 .
notably , this has essentially brought some more changes in the overall algorithm . in particular in the searching phase of the algorithm
we now need to adapt accordingly to apply the corresponding filters on the extended strings .
but the overall improvement outweighs this extra work by a long margin . in this section
, we discuss an (m)-time algorithm that simplificpm uses to compute the signature of the circular pattern ( ) corresponding to pattern  of length m. this signature is used at a later stage to filter the text . here , we need five variables to save the output of the functions used for filters 1 , 2 , 3 , 5 , and 6 ( based on observations 1 , 2 , 3 , 5 , and 6 ) . and
we need a list of size 4 to save the values of the function used in filter 4 ( observation 4 ) .
we start with the extended string ext( ) = [1 : m] and compute the values according to observations 1to 6 .
the algorithm will iterate m + 1 times and hence the overall runtime of the algorithm is (m ) .
now we present an (n ) runtime algorithm that simplificpm uses to reduce the search space of the text applying the six filters presented above .
it takes as input the pattern [1 : m ] of length m and the text [1 :
n ] of length n. it calls procedure ecps_ft with [1 : m ] as parameter and uses the output .
it then applies the same technique that is applied in procedure ecps_ft ( algorithm 1 ) .
we apply a sliding window approach with window length of m and calculate the values applying the functions according to observations 16 on the factor of  captured by the window .
note that , for observations 2 , 3 , 5 , and 6 , we need to consider the extended string and hence the factor of  within the window need be extended accordingly for calculating the values .
after we calculate the values for a factor of  , we check it against the returned values of procedure ecps_ft .
note that , in case of overlapping factors ( e.g. , when the consecutive windows need to output the factors to a file ) , procedure ecps_ft outputs only the nonoverlapped characters . and procedure ecps_ft uses a $ marker to mark the boundaries of nonconsecutive factors , where $  . now note that we can compute the values of consecutive factors of  using the sliding window approach quite efficiently as follows . for the first factor , that is , [1  m ] , we exactly follow the strategy of procedure ecps_ft .
when it is done , we slide the window by one character and we only need to remove the contribution of the leftmost character of the previous window and add the contribution of the rightmost character of the new window .
the functions are such that this can be done very easily using simple constant time operations .
the only other issue that needs to be taken care of is due to the use of the extended string in four of the filters . but
therefore , overall runtime of the algorithm is (m ) + (n  m ) = (n ) .
the algorithm is presented in the form of procedure rss_ft ( algorithm 2 ) . in this section
we have already described the two main components of simplificpm , namely , procedure ecps_ft and procedure rss_ft , that in fact calls the former .
now procedure rss_ft provides a reduced text  ( say ) after filtering . at this point simplificpm
can use any algorithm that can solve cpm and apply it over  and output the occurrences . now , suppose simplificpm uses algorithm  at this stage which runs in (f(|| ) ) time . then , clearly , the overall running time of simplificpm is (n ) + (f(|| ) ) .
for example , if simplificpm uses the linear time algorithm of , then clearly the overall theoretical running time of simplificpm will be (n ) . in our implementation
however we have used the recent algorithm of , which is a linear time algorithm on average and the fastest algorithm in practice to the best of our knowledge . in particular , in , the authors have presented an approximate circular string matching algorithm with k - mismatches ( acsmf - simple ) via filtering .
the library is freely available and can be found in . in this algorithm , if we set k = 0 , then acsmf - simple works for the exact matching case . in what follows
we have implemented simplificpm using acsmf - simplezerok ; that is , we have used acsmf - simple algorithm simply by putting k = 0 .
now that we have fully described simplificpm , in this section we present the simulation of simplificpm on a particular example .
we only show the simulation up to the output of procedure rss_ft , that is , the output of the reduced text , because afterwards we can employ any state - of - the - art algorithm within simplificpm .
the values computed by procedure ecps_ft according to observations 1through 6 are as follows , respectively : local_total_sum = 18 , abs_sum = 14 , actual_sum = 0 , local_individual_sum[0  :  4 ] = { 2,2 , 6,8 } , modulas_sum = 5 , and xor_sum = 28 . again consider a text string  = tgatcgaaagtaatcgatg$. for the first sliding window we need to calculate the observation values from [1  :  7 ] .
the observation values according to procedure rss_ft are as follows for [1  :  7 ] : local_total_sum = 18 , abs_sum = 14 , actual_sum = 0 , local_individual_sum[0  :  4 ] = { 2,2 , 6,8 } , modulas_sum = 5 , and xor_sum = 28 .
we have coded simplificpm in c++ using a gnu compiler with general public license ( gpl ) .
as has been mentioned already above , our implementation of simplificpm uses the acsmf - simplezerok .
acsmf - simple   has been implemented as library functions in the c programming language under gnu / linux operating system .
it takes as input the pattern  of length m , the text  of length n , and the integer threshold k < m and returns the list of starting positions of the occurrences of the rotations of  in  with k - mismatches as output . in our case we use k = 0 . we have used real genome data in our experiments as the text string , . this data has been collected from . here
we have generated random patterns of different length by a random indexing technique in these 299  mb of text string .
we have conducted our experiments on a poweredge r820 rack serve pc with 6-core intel xeon processor e5 - 4600 product family and 64  gb of ram under gnu / linux . with the help of the library used in , we have compared the running time of our preliminary work in   ( referred to as filter - cpm henceforth ) , acsmf - simplezerok of , and simplificpm .  
table 2 reports the elapsed time and speed - up comparisons for various pattern sizes ( 500  m  3000 ) . as can be seen from table 2 , filter - cpm   runs faster than acsmf - simplezerok in all cases . and
in fact filter - cpm   achieves a minimum of twofold speed - up for all the pattern sizes .
again , referring to the same table , simplificpm runs even faster than acsmf - simplezerok in all cases . and in fact simplificpm achieves a minimum of threefold speed - up for all the pattern sizes . in order to analyze and understand the effect of our filters we have run a second set of experiments as follows .
we have run experiments on three variants of simplificpm where the first variant ( simplificpm-[1  3 ] ) only employs filters 1 through 3 , the second variant ( simplificpm-[1  4 ] ) only employs filters 1 through 4 , and finally the third variant ( simplificpm-[1  5 ] ) employs filters 1 through 5 .  
table 2 reports the elapsed time and speed - up comparisons considering various pattern sizes ( 500  m  2000 ) for acsmf - simplezerok and the above - mentioned three variants of simplificpm .
as can be seen from table 3 , acsmf - simplezerok is able to beat simplificpm-[1  3 ] in a number of cases .
however , simplificpm-[1  4 ] and simplificpm-[1  5 ] significantly run faster than acsmf - simplezerok in all cases .
in this paper , we have employed some effective lightweight filtering technique to reduce the search space of the circular pattern matching ( cpm ) problem .
we have presented simplificpm , an extremely fast algorithm based on the above - mentioned filters .
we have conducted extensive experimental studies to show the effectiveness of simplificpm . in our experiments
, simplificpm has achieved a minimum of threefold speed - up compared to the state - of - the - art algorithms .
much of the speed of our algorithm comes from the fact that our filters are effective but extremely simple and lightweight .
the most intriguing feature of simplificpm is perhaps its capability to plug in any algorithm to solve cpm and take advantage of it .
we are now working towards adapting the filters so that it could work for the approximate version of cpm .
 this paper deals with the circular pattern matching ( cpm ) problem , which 
 appears as an interesting problem in many biological contexts . 
 cpm consists in finding all occurrences of the rotations of a pattern  of length m in a text  of length n. in this paper , we present simplificpm ( pronounced  simplify cpm  ) , a simple and lightweight filter - based algorithm to solve the problem . 
 we compare our algorithm with the state - of - the - art algorithms and the results are found to be excellent . 
 much of the speed of our algorithm comes from the fact that our filters are effective but extremely simple and 
 lightweight . 
1. Introduction
2. Preliminaries
3. Our Approach
4. Experimental Results
5. Conclusions