11.07.2015 Views

Tema 3 – Algoritmos de encaminamiento

Tema 3 – Algoritmos de encaminamiento

Tema 3 – Algoritmos de encaminamiento

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Re<strong>de</strong>s <strong>–</strong> <strong>Tema</strong> 3: <strong>Algoritmos</strong> <strong>de</strong> <strong>encaminamiento</strong>Algoritmo <strong>de</strong> Bellman-FordINITIALIZATION1. d(S) = 02. for all v in N but S3. d(v) = ∞MAIN LOOP4. for k = 1 to N-15. for each (u,v) in E6. if d(v) > d(u) + c(u,v)7. d(v) = d(u)+c(u,v)8. prev(v) = uRamón Agüero Calvo26

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

Saved successfully!

Ooh no, something went wrong!