CS Lunch This Week Lunch with the Chair! Wednesday, Kendade 307 2 - - PowerPoint PPT Presentation

cs lunch this week
SMART_READER_LITE
LIVE PREVIEW

CS Lunch This Week Lunch with the Chair! Wednesday, Kendade 307 2 - - PowerPoint PPT Presentation

1 CS Lunch This Week Lunch with the Chair! Wednesday, Kendade 307 2 Sequence Alignment: Algorithm Alignment(m, n, x 1 x 2 ...x m , y 1 y 2 ...y n , , ) { for i = 0 to m M[i, 0] = i for j = 0 to n M[0, j] = j for i = 1 to m for j


slide-1
SLIDE 1

CS Lunch This Week

Lunch with the Chair! Wednesday, Kendade 307

1

Sequence Alignment: Algorithm

Alignment(m, n, x1x2...xm, y1y2...yn, δ, α) { for i = 0 to m M[i, 0] = iδ for j = 0 to n M[0, j] = jδ for i = 1 to m for j = 1 to n M[i, j] = min(α[xi, yj] + M[i-1, j-1], δ + M[i-1, j], δ + M[i, j-1]) return M[m, n] }

2

Sequence Alignment

What if the sequences have 100,000 characters or more, as a gene sequence might?

3-1 Slides19 - Network Flow Intro.key - April 15, 2019

slide-2
SLIDE 2

Sequence Alignment

What if the sequences have 100,000 characters or more, as a gene sequence might? Too much memory!

3-2

Sequence Alignment

Textbook shows an algorithm that combines dynamic programming with divide and conquer Dynamic programming is used to remember the answers to subproblems Divide and conquer is used to compute the answer using less memory What if the sequences have 100,000 characters or more, as a gene sequence might? Too much memory!

3-3

Soviet Rail Network, 1955

Reference: On the history of the transportation and maximum flow problems.
 Alexander Schrijver in Math Programming, 91: 3, 2002.

4 Slides19 - Network Flow Intro.key - April 15, 2019

slide-3
SLIDE 3

Flow network. Abstraction for material flowing through the edges. G = (V , E) = directed graph Two distinguished nodes: s = source, t = sink.

Flow Networks

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 capacity source sink

5

An s-t flow is a function that satisfies: Capacity condition: For each e ∈ E: 0 ≤ f(e) ≤ c(e) Conservation condition: For each v ∈ V – {s, t}: 
 ∑ f(e) = ∑ f(e)

Flows

e into y e out of y

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink flow = 4 4 4 4

6

The value of a flow f is: v(f) = ∑ f(e)

Flows

e out of s

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink flow = 4 4 4 4

value = 4

7 Slides19 - Network Flow Intro.key - April 15, 2019

slide-4
SLIDE 4

The value of a flow f is: v(f) = ∑ f(e)

Flows

e out of s

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink flow = 10 9 4 10 9 1 6 1 10 9 6

value = 24

8

Find s-t flow of maximum value.

Maximum Flow Problem

s 2 3 4 5 6 7 t 15 5 30 15 10 8 15 9 6 10 10 10 15 4 4 source sink flow = 10 1 10 5 13 9 8 3 13 9 9

value = 28

9

Residual Graph

Original edge: e = (u, v) ∈ E. Flow f(e) = 6, capacity c(e) = 17 . Residual edges. e = (u, v) with capacity c(e) - f(e) AND eR = (v, u) with capacity f(e) Residual graph: Gf = (V , Ef ). Residual edges with positive residual capacity. Ef = {e : f(e) < c(e)} ∪ {eR : f(e) > 0}.

u v 17 6 u v 11

residual capacity

6

10 Slides19 - Network Flow Intro.key - April 15, 2019

slide-5
SLIDE 5

Augmenting Path Algorithm

Augment(f, c, P) { b ← bottleneck(P) foreach e ∈ P { if (e ∈ E) f(e) ← f(e) + b else { let e be the forward edge corresponding to eR f(e) ← f(e) - b } return f } Ford-Fulkerson(G, s, t, c) { foreach e ∈ E f(e) ← 0 // initially, no flow Gf ← G // initially, the residual 
 // graph is the original graph while (there exists an s-t path P in Gf) { f ← Augment(f, c, P) // change the flow update Gf // build a new residual graph } return f } / / forward edge, increase flow in G / / reverse edge, decrease flow in G / / edge on P with least capacity

11 Slides19 - Network Flow Intro.key - April 15, 2019