13.07.2015 Views

Tema 4 – Algoritmos y protocolos de encaminamiento

Tema 4 – Algoritmos y protocolos de encaminamiento

Tema 4 – Algoritmos y protocolos de encaminamiento

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Re<strong>de</strong>s Telefónicas <strong>–</strong> <strong>Tema</strong> 4: <strong>Algoritmos</strong> y <strong>protocolos</strong> <strong>de</strong> <strong>encaminamiento</strong>Algoritmo <strong>de</strong> Floyd WarshallINITIALIZATION1. for all (u,v) in NxN2. d(u,v) = ∞3. pred(u,v) = NIL4. for all no<strong>de</strong>s u in N5. d(u,u) = 06. for each (u,v) in E7. d(u,v) = c(u,v)8. pred(u,v) = uMAIN LOOP9. for k = 1 to N10. for u = 1 to N11. for v = 1 to N12. if d(u,v) > d(u,k) + d(k,v)13. d(u,v) = d(u,k) + d(k,v)14. pred(u,v) = pred(k,v)Ramón Agüero Calvo28

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

Saved successfully!

Ooh no, something went wrong!