Large scale sequences and other types of patterns may be matched or aligned quickly using a linear space technique. In one embodiment, the invention includes, calculating a similarity matrix of a first sequence against a second sequence, determining a lowest cost path through the matrix, where cost is a function of sequence alignment, dividing the similarity matrix into a plurality of blocks, determining local start points on the lowest cost path, the local start points each corresponding to a block through which the lowest cost path passes, dividing sequence alignment computation for the lowest cost path into a plurality of independent problems based on the local start points, solving each independent problem independently, and concatenating the solutions to generate an alignment path of the first sequence against the second sequence.