SlideServe
Menu
Préférences
© SlideServe · v2026

Dynamic Programming (Longest Common Subsequence)

lin avatar
13 diapositives · 486 Views · Sep 23, 2014

Dynamic Programming (Longest Common Subsequence). Subsequence. String Z is a subsequence of string X if Z’s characters appear in X following the same left-to-right order. X = < A, B, C, T, D, G, N, A, B > Z = < B, D, A >. Longest Common Subsequence (LCS).

Dynamic Programming (Longest Common Subsequence) - slide 1
01 / 13Dynamic Programming (Longest Common Subsequence)
1 / 17

Télécharger la présentation

Dynamic Programming (Longest Common Subsequence)
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Dynamic Programming(Longest Common Subsequence)

  2. Subsequence • String Z is a subsequence of string X if Z’s characters appear in X following the same left-to-right order X = < A, B, C, T, D, G, N, A, B > Z = < B, D, A >

  3. Longest Common Subsequence (LCS) • String Z is a common subsequence of strings X and Y if Z’s characters appear in both X & Y following the same left-to-right order X = < A, B, C, T, B, D, A, B > Y = < B, D, C, A, B, A > • < B, C, A > is a common subsequence of both X and Y. • < B, C, B, A > or < B, C, A, B > is the Longest Common Subsequence (LCS) of X and Y. LCS is used to measure the similarity between two strings X and Y. The longer the LCS , the more similar X and Y

  4. LCS Problem Definition • We are given two sequences • X= <x1,x2,...,xm>,and • Y = <y1,y2,...,yn> • We need to find the LCS between X and Y Very common in DNA sequences

  5. Characterization of LCS

  6. Characterization of LCS (Cont’d)

  7. Recursive Nature of LCS • Implications of Theorem 15.1

  8. Recursive Equation • Input X = <x1, x2, …., xm> Y = <y1, y2, ………, yn> • Assume C[i, j] is the LCS for the first i positions in X with the first j positions in Y • C[i,j] = LCS(<x1, x2, …., xi>, <y1, y2, ………, yj>) Our goal is to compute C[m,n]

  9. Dynamic Programming for LCS Initialization step

  10. Dynamic Programming for LCS If matching, go diagonal

  11. Dynamic Programming for LCS Else select the larger of top or left

  12. Dynamic Programming for LCS Note that array c  keeps track of the cost, Array b  keeps track of the parent (to backtrack)

  13. Summary of the Main Strategies