Longest common subsequence
Download
1 / 7

Longest Common Subsequence - PowerPoint PPT Presentation


  • 176 Views
  • Uploaded on

Longest Common Subsequence. Chris Carpenter Charles Cobb Lance Hymel. Problem. Given two strings, find the longest subsequences (LCS) shared by both strings. Dynamic Programming Solution. Construct a n 1 ×n 2 table Fill in table Top-left to bottom-right

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Longest Common Subsequence' - conlan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Longest common subsequence

Longest Common Subsequence

Chris Carpenter

Charles Cobb

Lance Hymel


Problem
Problem

  • Given two strings, find the longest subsequences (LCS) shared by both strings.


Dynamic programming solution
Dynamic Programming Solution

  • Construct a n1×n2 table

  • Fill in table

    • Top-left to bottom-right

    • Increment whenever match is found

  • Bottom-right number is length of LCS

  • Scan table bottom-right to top-left

    • Locations where number decreases diagonally are included in LCS



Hirschberg solution cont
Hirschberg Solution (cont)

  • Recursively scan

    • Still runs in linear time

    • Uses O(min(string1, string2)) memory


Real world implementations
Real-World Implementations

  • File comparison

    • Source-code control

      • Insertion, Deletion, Merging

  • Bioinformatics

    • Sequence analysis

    • Comparative genomics


Longest common subsequence

Bioinformatics

  • Sequence analysis is the process of subjecting a DNA, RNA or peptide sequence to any of a wide range of analytical methods

  • The analytical methods include :

    • Sequence Alignment

    • Methodical biological database searches