Wordsnakes algorithim

This is a quick and dirty implementation of the greedy Longest Common Superstring algorithm. This is a completely deterministic approach, but it produced good results (didn't win against simulated annealing, but wasn't that far off)

Its a scary implementation because it uses two vectors, one which contains the words to be used which eventually mutates into the longest common superstring (LCS), and another vector which tracks the changes to the first vector. Did it that way because just using the LCS vector would give me the final wordsnake, but i wouldn't be able to show the sequence of words used to produce it. (the actual words get merged/mangled into the wordsnake during the process of the algorithim.)

source code here


John Lin (jjl364@nyu.edu)