Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

CS 5050 -Program #5 -30 points Edit Distance as Shortest Path Problem

Summary: CS 5050 - Program #5 - 30 points
Edit Distance as Shortest Path Problem
Part 1 Edit Distance (15 points)
Problems in molecular biology involve finding the minimum number of edit steps which are
required to change one string into another.
There are four types of edit steps: insert, delete, replace, and match. The costs of each operation
can change according to the specifications for the problem.
Example: abbc babb
abbc bbc bbb babb (3 steps)
abbc babbc babb (2 steps)
We are trying to minimize the number of steps. Assume matching has a cost of 0, insert is 1, delete
is 1, and replace is 1, we can change "do" into "redo" in 2 steps as shown below in the array set up
for dynamic programming.
* r e d o
* I-0 I-1 I-2 I-3 I-4
d D-1 R-1 R-2 M-2 I-3
o D-2 R-2 R-2 R-3 M-2
Do the following:
1. Allow the user to input the cost of replacement
2. Input two strings


Source: Allan, Vicki H. - Department of Computer Science, Utah State University


Collections: Computer Technologies and Information Sciences