20 - Sequence Alignment Data Structures and Algorithms...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sequence Alignment Data Structures and Algorithms Andrei Bulatov Algorithms – Sequence Alignment 20-2 Shortest Path: Finding Negative Cycles Two questions:- how to decide if there is a negative cycle?- how to find one? emma Lemma It suffices to find negative cycles C such that t can be reached from C t <0 <0 Algorithms – Sequence Alignment 20-3 Shortest Path: Finding Negative Cycles Proof Let G be a graph The augmented graph, A(G), is obtained by ding a new node and adding a new node and connecting every node in G with the new node As is easily seen, G contains a negative cycle if and only if A(G) contains a negative cycle C such that t is reachable from C QED t Algorithms – Sequence Alignment 20-4 Shortest Path: Finding Negative Cycles (cntd) Extend OPT(i,v) to i ≥ n If the graph G does not contain negative cycles then OPT(i,v) = OPT(n – 1,v) for all nodes v and all i ≥ n Indeed, it follows from the observation that every shortest path contains at most n – 1 arcs. Lemma There is no negative cycle with a path to t if and only if OPT(n,v) = OPT(n – 1,v) Proof If there is no negative cycle, then OPT(n,v) = OPT(n – 1,v) for all nodes v by the observation above Algorithms – Sequence Alignment 20-5 Shortest Path: Finding Negative Cycles (cntd) Proof (cntd) Suppose OPT(n,v) = OPT(n – 1,v) for all nodes v. Therefore OPT(n,v) = min{ OPT(n – 1,v), min { OPT(n – 1,w) + len(vw) }} min{ OPT(n,v), min { OPT(n,w) + len(vw) }} w ∈ V = min{ OPT(n,v), min { OPT(n,w) + len(vw) }} = OPT(n + 1,v) = …. However, if a negative cycle from which t is reachable exists, then w ∈ V-∞ = ∞ → ) , ( lim v i OPT i Algorithms – Sequence Alignment 20-6 Shortest Path: Finding Negative Cycles (cntd) Let v be a node such that OPT(n,v) ≠ OPT(n – 1,v). A path P from v to t of weight OPT(n,v) must use exactly n arcs Any simple path can have at most n – 1 arcs, therefore P contains a cycle C emma Lemma If G has n nodes and OPT(n,v) ≠ OPT(n – 1,v), then a path P of weight OPT(n,v) contains a cycle C, and C is negative. Proof Every path from v to t using less than n arcs has greater weight. Let w be a node that occurs in P more than once. Let C be the cycle between the two occurrences of w Deleting C we get a shorter path of greater weight, thus C is negative Algorithms – Sequence Alignment 20-7 The Sequence Alignment Problem Question: How similar two words are? Say “ ocurrance ” and “ occurrence ” They are similar, because one can be turned into another by few anges changes oc- urr a nce oc c urr e nce Clearly, this can be done in many ways, say oc- urr- a nce oc c urr e- nce Problem: Minimize the “number” of gaps and mismatches gap mismatch Algorithms – Sequence Alignment 20-8 Alignments Let and be two strings A matching is a set of ordered pairs, such that an element of each set...
View Full Document

This note was uploaded on 11/19/2009 for the course CS CMPT 307 taught by Professor A.bulatov during the Fall '09 term at Simon Fraser.

Page1 / 27

20 - Sequence Alignment Data Structures and Algorithms...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online