29.06.2013 Views

Curs 8 - Drumuri de cost minim [pdf] - Andrei

Curs 8 - Drumuri de cost minim [pdf] - Andrei

Curs 8 - Drumuri de cost minim [pdf] - Andrei

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.

Exemplu (2)<br />

1<br />

2<br />

4 3<br />

1<br />

2<br />

4 3<br />

Proiectarea Algoritmilor 2010<br />

Algoritmul lui Johnson<br />

Pentru grafuri rare.<br />

1 0 0 0<br />

0 1 1 1<br />

T 0 1 1 1<br />

1 1 1 1<br />

(3) =<br />

1 0 0 0<br />

1 1 1 1<br />

T 1 1 1 1<br />

1 1 1 1<br />

(4) =<br />

Folosește liste <strong>de</strong> adiacență.<br />

Bazat pe Dijkstra si Bellman-Ford.<br />

Complexitate: O(V 2 logV + VE)<br />

mai buna <strong>de</strong>cât Floyd-Warshall pentru<br />

grafuri rare.<br />

Proiectarea Algoritmilor 2010<br />

5/8/2010<br />

18

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

Saved successfully!

Ooh no, something went wrong!