start | subgroups | patterns | mapping

 

patterns in sequences

Version 2 / March 20, 2012 / Benjamin Aaron Degenhart

(doesn't work on Firefox for some reason)

 

This algorithm looks for patterns in sequences.

phrase example

 

Possible uses:

  • Let's say sequences of tasks throughout working-days have been logged in 20 different categories over the last 5 years across 100 employers. A pattern-analyzing algorithm could reveal interesting correlations.
  • Similar to 'subgroups'; methods/procedures, CVs, meeting-minutes, choreographies, dentists teeth-codes, music playlists, recipes, travel-routes...

 

How it works:

Take each possible pair ((n/2) * (n-1)) of the sequences and slide B (equal or bigger length than A) along A step by step. Look at each step for vertical character-matches. The number of steps until a sliding is completed is: [lengthA + (lengthB - lengthA) + (lengthA - 1)]

As example one of the 8 different couples from the prefilled input:

step 1 (first):
            A B F R D S            
                 
<-
C R N F S D T

... step 7:

            A B F R D S            
     
<-
C R N F S D T            

pattern found: [. . F. D .]

... step 12 (last):

            A B F R D S            
C R N F S D T                      

When finding a pattern, check if it's already been found - if not append it to a stack of all patterns and run through all sequences to count how many times this pattern appears in total.

Ouput a list of patterns sorted by the factor of [occurrence * length * distinct elements (not '.' placeholders)].

 

input:

 

reset

 

results:

log: