03.01.2015 Views

Dynamic Programing

Dynamic Programing

Dynamic Programing

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Needleman-Wunsch Algorithm<br />

for any gap penalty models<br />

Does affine gap model work with simple Needleman-Wunsch Algorithm we just saw<br />

w1 ... wj ... wm<br />

v1<br />

:<br />

vi<br />

0<br />

+ (j) gap<br />

+(j-1)gap<br />

+ (i-1)<br />

gaps<br />

+s(vi, wj) +gap<br />

+gap<br />

+(i)<br />

gaps<br />

:<br />

vn<br />

Optimal<br />

alignment<br />

score<br />

NW (i, j) = max<br />

# NW (i ! 1, j ! 1) + s(v i<br />

,w j<br />

)<br />

%<br />

$ [NW (i ! n gap<br />

, j) + w(n gap1<br />

)] 1"ngap1 "i<br />

%<br />

&%<br />

[NW (i, j ! n gap2<br />

) + w(n gap2<br />

)] 1"ngap 2 " j<br />

match/mismatch<br />

delete<br />

insert<br />

What is the runtime or space

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!