Inputs: Two sequences, often represented as strings, let's call them A and B.
Goal: Find the shortest edit script that transforms sequence A into sequence B. An edit script is a sequence of operations like insertions, deletions, and substitutions.
- Initialize the Matrix:
- Create a matrix with rows representing the characters of sequence
Aand columns representing the characters of sequenceB. - The matrix will have dimensions
(M+1) x (N+1), whereMis the length of sequenceA, andNis the length of sequenceB.
- Create a matrix with rows representing the characters of sequence