While watching some videos from Udacity describing sequence alignment I was having a bit of a hard time understanding the algorithm as it was explained, so I decided to write it in code.
This is a fairly simple approach and uses recursion (so stack depth may be a problem for larger sequences), but it does use dynamic programming to keep things relatively fast. The code uses the same N, NW, W notation the video uses to describe the problem graph.
If there are branches in the problem graph (i.e. 2 alignments are have the same score) the program just takes the first solution.
Sequence alignment video series (part of the "Computability Complexity and Algorithms" class on Udacity): https://www.youtube.com/watch?v=3NLYH44F6SU&index=5&list=PLAwxTw4SYaPkbWSEj_1iO7rILlWDJImW4