Sequence alignment is a very important problem inBioinformatics since it is very useful to discover relationships among biological sequences. In this article we propose a new sequence alignment algorithm that is able to identify sequence similarities in linear space. Our solution is capable of using several parameters specifying in which conditions a given residue can be aligned. This decision is taken based on a perceptron neuron and the best set of parameters is found using simulated annealing. Comparing our algorithm to a well established algorithm, we found that for pairwise alignments, our approach was faster for all instances tested with speedups up to 7.63 and yields better quality results for the majority of the instances.