Der Floyd-Warshall-Algorithmus
Transcript of Der Floyd-Warshall-Algorithmus
![Page 1: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/1.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d0 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 ∞ 3 1 ∞
d1 1 2 3 4 5
1
2
3
4
5
![Page 2: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/2.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d0 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 ∞ 3 1 ∞
d1 1 2 3 4 5
1
2
3
4
5
![Page 3: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/3.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d0 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 ∞ 3 1 ∞
d1 1 2 3 4 5
1
2
3
4
5
![Page 4: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/4.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d0 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 ∞ 3 1 ∞
d1 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 3 1 ∞
![Page 5: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/5.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d0 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 ∞ 3 1 ∞
d1 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
![Page 6: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/6.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d1 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
d2 1 2 3 4 5
1
2
3
4
5
![Page 7: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/7.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
d2 1 2 3 4 5
1
2
3
4
5
![Page 8: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/8.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
d2 1 2 3 4 5
1
2
3
4
5
![Page 9: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/9.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1
![Page 10: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/10.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ ∞
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ ∞
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 ∞
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
![Page 11: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/11.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
d3 1 2 3 4 5
1
2
3
4
5
![Page 12: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/12.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
d3 1 2 3 4 5
1
2
3
4
5
![Page 13: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/13.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
d3 1 2 3 4 5
1
2
3
4
5
![Page 14: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/14.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 4 ∞
5 10 3 1
![Page 15: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/15.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d2 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ ∞ 4 ∞ ∞
5 10 12 3 1 9
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
![Page 16: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/16.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d4 1 2 3 4 5
1
2
3
4
5
![Page 17: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/17.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d4 1 2 3 4 5
1
2
3
4
5
![Page 18: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/18.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d4 1 2 3 4 5
1
2
3
4
5
![Page 19: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/19.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1
![Page 20: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/20.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d3 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
![Page 21: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/21.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d5 1 2 3 4 5
1
2
3
4
5
![Page 22: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/22.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d5 1 2 3 4 5
1
2
3
4
5
![Page 23: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/23.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d5 1 2 3 4 5
1
2
3
4
5
![Page 24: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/24.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d5 1 2 3 4 5
1
2
3
4
5
![Page 25: Der Floyd-Warshall-Algorithmus](https://reader033.fdocument.pub/reader033/viewer/2022042307/625b516b6a35a6276037bf67/html5/thumbnails/25.jpg)
Der Floyd-Warshall-Algorithmus
Beispiel
Als nächstes betrachten wir folgenden Digraphen:
1
2
5 4
32
−2
10
−3
1
43
d4 1 2 3 4 5
1 ∞ 2 ∞ ∞ −1
2 ∞ ∞ ∞ ∞ −3
3 ∞ −2 ∞ ∞ −5
4 ∞ 2 4 ∞ −1
5 10 1 3 1 −2
d5 1 2 3 4 5
1 9 0 2 0 −3
2 7 −2 0 −2 −5
3 5 −4 −2 −4 −7
4 9 0 2 0 −3
5 8 −1 1 −1 −4