title: Generalized Sequential Pattern algorithm MapReduce
body: <p>I am looking for an example implementation of the Generalized Sequential Pattern algorithm (GSP) <a href="http://en.wikipedia.org/wiki/GSP_Algorithm" rel="nofollow">http://en.wikipedia.org/wiki/GSP_Algorithm</a></p>
  
  <p>Whilst the Wikipedia article provides psuedo code, its a bit confusing and I would like to see some proper code (ideally python or java). Does anyone know a good reference?</p>
  
  <p>I want to understand the algorithm first and then potentially make it work in a MapReduce world - which as the wikipedia article shows the use of counters I think could be complex.</p>
  
  <p>I am doing this because I have a graph of events where the edges are constrained by time, a sequence would be where a node is connected to another node where A -> B happens between a start and a finish time and B -> C happens X time after B finishes in the first connection. A -> B -> C would be the sequence, a sequence can't revisit a node more than once.</p>