See the survey of David Wheeler to know more about matrices.
Gotog, O. (1982). An Improved Algorithm for Matching Biological Sequences.J. Mol. Biol. 162, 705-708.