03.07.2013 Views

Voorbeeld - caagt

Voorbeeld - caagt

Voorbeeld - caagt

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Algoritme in pseudocode<br />

Input: gewogen n × m-rooster met → en ↓ pijlen<br />

Output: lengte van langste pad (0, 0) (n,m)<br />

1: s0,0 ← 0<br />

2: for i from 1 to n do<br />

3: si,0 ← si−1,0 + w(i−1,0),(i,0)<br />

4: for j from 1 to m do<br />

5: s0,j ← s0,j−1 + w (0,j−1),(0,j)<br />

6: for i from 1 to n do<br />

7: for j from 1<br />

<br />

to m do<br />

8: si,j = max<br />

si−1,j + w (i−1,j),(i,j)<br />

si,j−1 + w (i,j−1),(i,j)<br />

9: return sn,m Cursus Grafentheorie en Combinatorische Optimalisatie (2008–2009) – p.14/71

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

Saved successfully!

Ooh no, something went wrong!