# 20 - Sequence Alignment Data Structures and Algorithms...

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

Sequence Alignment Data Structures and Algorithms Andrei Bulatov

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

View Full Document
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? 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 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

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

View Full Document
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 w V = OPT(n + 1,v) = …. However, if a negative cycle from which t is reachable exists, then -∞ = ) , ( lim v i OPT i

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

View Full Document
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 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 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

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

View Full Document
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 occurs at most once.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern