Question: Recall that the string alignment problem takes as input two strings x and y , composed of symbols x i , y j is a
Recall that the string alignment problem takes as input two strings x and y, composed of symbols xi, yj is a element of , for a fixed symbol set , and returns a minimal-cost set of edit operations for transforming the string x into string y.
Let x contain nxsymbols, let y contain nysymbols, and let the set of edit operations be those defined in the lecture notes (substitution, insertion, deletion, and transposition).
Let the cost of indel be 1, the cost of swap be 10 (plus the cost of the two sub ops), and the cost of sub be 10, except when xi= yj, which is a no-op and has cost 0.
Implement the function commonSubstrings in PYTHON, and do not use any library functions.
commonSubstrings(x, L, a) which takes as input the ASCII strings x, an integer 1<= L <= n_x, and an optimal sequence a of edits to x, which would transform x into y. This function returns reach of the substrings of length at least L in x that aligns exactly, via a run of no -ops, to a substring in y.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
