![Page 1: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/1.jpg)
Institut für Kartographie und GeoinformationProf. Dr. Lutz Plümer
Diskrete Mathematik IIVorlesung 4
SS 2002
Dijkstra-Erweiterungen zur Behandlung realer Straßennetze
![Page 2: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/2.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
2 2
Überblick: zwei Dijkstra - Erweiterungen
• Dijkstra: Finden kürzester Wege in Graphen• Reale Netze stellen besondere Anforderungen
– Größe des Netzwerkes (Effizienz)• Dijkstra-Erweiterung "Dijkstra mit Geometrie"
– Straßenverkehrsordnung (Abbiege- und Wendeverbote)• Übergang von Netzen zu Graphen• Ansätze:
– Modifikation des Graphen
– Modifikation von Dijkstra
• nur kurzer Ausblick
![Page 3: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/3.jpg)
Do
Ha
W
Du
K
D
15
8015
80
20
3020
![Page 4: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/4.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
4 4
Do
Ha
W
Du
K
D
20
15
80
80
20 30
15
Beispiel
![Page 5: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/5.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
5 5
Do
Ha
W
Du
K
D
20
15
80
80
20 30
15
Algorithmus von Dijkstra: Beispiel
![Page 6: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/6.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
6 6
Do
Ha
Du 20
80
20 30
W
K
D
8015
15
Do
Du
Ha
Do
Algorithmus von Dijkstra: Beispiel
MinimalerAbstand von Do
Du
80
Ha
20
![Page 7: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/7.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
7 7
Do
Ha
W
Du
K
D
20
80
80
20 30
15
15
W
Algorithmus von Dijkstra: Beispiel
Do
Du Ha
80 20
W
15
MinimalerAbstand von DO
![Page 8: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/8.jpg)
Do
Ha
W
Du
K
D
20
80
80
20 30
15
15
W
Algorithmus von Dijkstra: Beispiel
abgearbeitet
noch in Arbeit
noch nicht betrachtet
![Page 9: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/9.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
9 9
Do
Du Ha
W
80 20
15
15
Do
Ha
W
Du
K
D
20
80
80
20 30
15
Bereits vorhanden Du
Kürzester Weg
Algorithmus von Dijkstra: Beispiel
![Page 10: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/10.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
10 10
Du
Do
Ha
W
20
15
15
Do
Ha
W
Du
K
D
20
80
80
20 30
15
K
D
Du
Algorithmus von Dijkstra: Beispiel
30
K
80
D
![Page 11: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/11.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
11 11
Du D K
Do
Ha
W
20
15
30 80
D
Do
Ha
W
Du
K
D
20
80
80
20 30
15
15
Bereits vorhanden
kürzester Weg
Algorithmus von Dijkstra: Beispiel
![Page 12: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/12.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
12 12
Du K
Do
Ha
W
D
20
15
30 80
D
Do
Ha
W
Du
K
D
20
80
80
20 30
15
15
Algorithmus von Dijkstra: Beispiel
20
![Page 13: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/13.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
13 13
20
Do
Ha
W
Du
K
D
80
80
20 30
15
15
Bereits vorhanden
Algorithmus von Dijkstra: Beispiel
kürzester WegDu K
Do
Ha
W
D
20
15
30 80
20
![Page 14: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/14.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
14 14
Do
Ha
W
Du
K
D
20
80
80
20 30
15
15
D
K
Algorithmus von Dijkstra: Beispiel
KDu
Do
Ha
W
D
20
15
30 80
20
![Page 15: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/15.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
15 15
Do
Ha
W
D
K
Du
20
15
30
20
K
Do
Ha
W
Du
D
20
80
80
20 30
15
15
D
KK
Algorithmus von Dijkstra: Beispiel
15
![Page 16: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/16.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
16 16
Algorithmus von Dijkstra - Wiederholungalgorithmus Dijkstra (S)BLAU = ; GRÜN = {S}; dist(S) = 0;while( GRÜN )
wähle Knoten K aus GRÜN mit kleinstem dist(K)nimm K aus GRÜN heraus und färbe ihn BLAU;
für jeden Nachfolger Ki von K
wenn Ki noch nicht besucht
färbe Kante von K zu Ki rot und Ki grün;
dist(Ki) = dist(K) + dist(K,Ki)
wenn Ki GRÜN (erneut erreicht)wenn neuer Weg kürzer als alter Weg
setze neuen Weg rot und alten grün
setze dist(Ki) auf neuen Wert
färbe Ki BLAU
wenn Ki bereits BLAU färbe Kante von K zu Ki grün
![Page 17: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/17.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
17 17
Eigenschaften von Dijkstra - Wiederholung
• Ermittelt kürzeste Wege von einem Startknoten zu allen anderen
• Praxis: kürzester Weg von Startknoten zu einem Zielknoten
• man kann aufhören, sobald Zielknoten blau ist(kürzester Weg gefunden)
• dennoch ....
![Page 18: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/18.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
18 18
Dijkstra: RichtungslosHamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
Wien
![Page 19: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/19.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
19 19
Dijkstra: RichtungslosHamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
Wien
![Page 20: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/20.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
20 20
Dijkstra: RichtungslosHamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
Wien
![Page 21: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/21.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
21 21
Dijkstra: RichtungslosHamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
Wien
![Page 22: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/22.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
22 22
Dijkstra: RichtungslosHamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
Wien
![Page 23: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/23.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
23 23
Dijkstra: Richtungslos
• kürzester Weg von Frankfurt nach Hamburg
• Alle Knoten innerhalb des Kreises werden bearbeitet
Hamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
Wien
![Page 24: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/24.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
24 24
Schön wäre ...
Hamburg
Frankfurt
BrüsselPrag
Berlin
Mailand
München
• kürzester Weg von Frankfurt nach Hamburg
![Page 25: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/25.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
25 25
Erweiterung von Dijkstra
• Dijkstra nutzt die Geometrie der Knoten/Kanten nicht aus
• richtungslos: Die Richtung von Start- zum Zielknoten wird nicht berücksichtigt
• Erweiterung von Dijkstra "Dijkstra mit Geometrie"
![Page 26: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/26.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
26 26
390
330
Dijkstra mit Geometrie: Idee
D
K
HH
20BN
30
• Gesucht: kürzester Weg von K nach HH
• Dijkstra wählt BN aus (Weg zu K minimal)
• Dijkstra mit Geometrie wählt D aus (Summe von Weg zu K und Abstand zu HH minimal)
• Richtung: minimaler Abstand zu Zielknoten
30+330=360
20+390=410
30
20
![Page 27: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/27.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
27 27
Von Dijkstra zu "Dijkstra mit Geometrie"
• Nur eine Änderung: Auswahl des nächsten zu bearbeitenden (grünen) Knotens– Dijkstra: Knoten mit minimalem besten bisher gefundenen Weg– Dijkstra mit Geometrie: Knoten, bei dem Summe aus
• besten bisher gefundenem Weg und • Euklidscher Abstand des Knotens zu Zielknoten
minimal ist
• Beispiel ....
![Page 28: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/28.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
28 28
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
Gesucht: Kürzester Weg von S nach E
![Page 29: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/29.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
29 29
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
![Page 30: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/30.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
30 30
6 54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=7
![Page 31: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/31.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
31 31
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
6
![Page 32: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/32.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
32 32
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5
2
![Page 33: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/33.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
33 33
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
Summe minimal
2
![Page 34: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/34.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
34 34
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
![Page 35: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/35.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
35 35
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
![Page 36: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/36.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
36 36
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=10 3
![Page 37: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/37.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
37 37
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=109+0=9
![Page 38: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/38.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
38 38
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=109+0=9
Summe minimal
![Page 39: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/39.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
39 39
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=109+0=9
![Page 40: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/40.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
40 40
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=109+0=9
![Page 41: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/41.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
41 41
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=106+0=6
![Page 42: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/42.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
42 42
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=106+0=6
9+4=13
![Page 43: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/43.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
43 43
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=106+0=6
9+4=13Summe minimal
![Page 44: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/44.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
44 44
54
3
22
4
Dijkstra mit Geometrie: Beispiel
2
3
6
2 1
4
55
S
43
89
10
7
1
E
2
1+6=72+6=8
3+2=5 4+2=6
7+3=106+0=6
9+4=13
Fertig, da Zielknoten E blaukürzester Weg gefunden
![Page 45: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/45.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
45 45
Dijkstra mit Geometrie: Abstand
• Euklidscher Abstand: Schätzung für den unbekannten noch zurückzulegenden Weg
• einfach zu ermitteln• Problem: berücksichtigt nicht
– tatsächlichen Verlauf von Wegen– Topographie (Flüsse, Gebirge, etc.)
![Page 46: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/46.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
46 46
Dijkstra mit Geometrie: Heuristik
• Einbeziehung der Geometrie/Richtung: "Heuristik"• Heuristik: Daumenregel, die beim Suchen hilft• findet oft keine optimale Lösung, sondern nur Annäherungen an
optimale Lösung• Dijkstra mit Geometrie: optimale Lösung, wenn
– Euklidscher Abstand zu Zielknoten kleiner als tatsächlicher kürzester Weg
• OK, wenn Kantenkosten = Weglänge• Kantenkosten = Fahrtzeit?
S
E
![Page 47: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/47.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
47 47
21
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
10
Gesucht: kürzester Weg von S nach E
![Page 48: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/48.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
48 48
21
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
1010+20=30
10+10=20
Gesucht: kürzester Weg von S nach E
![Page 49: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/49.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
49 49
21
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
1010+20=30
10+10=20
Gesucht: kürzester Weg von S nach E
31+0=31
![Page 50: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/50.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
50 50
21
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
1010+20=30
10+10=20
Gesucht: kürzester Weg von S nach E
31+0=31
20+10=30
![Page 51: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/51.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
51 51
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
10
21
10+20=30
10+10=20
Gesucht: kürzester Weg von S nach E
31+0=31
20+10=30
30+0=30
![Page 52: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/52.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
52 52
10
2
1S
3
E
Beispiel: Kann die Richtung auf den falschen Weg führen?
1010
10
21
10+20=30
10+10=20
Abstand von 3 zu E größer als Länge der Kante von 3 zu E E würde vor 3 ausgewählt (nicht optimal)
31+0=31
20+10=30
30+0=30
![Page 53: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/53.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
53 53
Resümee
• Algorithmus "Dijkstra mit Geometrie"• Erweiterung von Dijkstra durch Einbeziehung der
Richtung zum Ziel (Heuristik)• zielgerichtete Suche
• findet optimale Lösung, wenn Kantenkosten=Weglänge• Im Bereich Informatik/"Künstliche Intelligenz" unter dem
Namen A* („A Stern“) bekannt
Hamburg
Frankfurt
MailandMailand
Hamburg
Frankfurt
![Page 54: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/54.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
54 54
Teil 2: Dijkstra - Straßenverkehrsordnung
![Page 55: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/55.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
55 55
Abbiegeverbote
C
DAZ
S
B
1
1
1
1
1
1
Abbiegeverbot: Wenn man von S kommt, darf man bei A nicht links abbiegen
![Page 56: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/56.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
56 56
Abbiegeverbote und Dijkstra
C
DAZ
S
B
1
1
1
1
1
1
![Page 57: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/57.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
57 57
Abbiegeverbote und Dijkstra
C
DAZ
S
B
1
1
1
1
1
1
1
![Page 58: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/58.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
58 58
Abbiegeverbote und Dijkstra
C
DAZ
S
B
1
1
1
1
1
1
1
2
![Page 59: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/59.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
59 59
Abbiegeverbote und Dijkstra
C
DAZ
S
B
1
1
1
1
1
1
Da A bereits abgearbeitet (blau) ist, bricht Algorithmus hier ab(findet keine Lösung)
![Page 60: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/60.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
60 60
Abbiegeverbote und Dijkstra
C
DAZ
S
B
1
1
1
1
1
1
Problem 1: Dijkstra findet keine LösungProblem 2: Lösungspfad (rot) enthält Zyklus!
![Page 61: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/61.jpg)
Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4 Gerhard Gröger - Diskrete Mathematik II - 2. Semester - SS 2002 - Vorlesung 4
61 61
Lösungsansätze
• Änderung des Algorithmus• Änderung des Graphen
– Transformation des Graphen mit Abbiegeverbot in einen ohne
– dann Anwendung von Standard-Dijkstra
A A1
A2
![Page 62: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 4 SS 2002 Dijkstra-Erweiterungen zur Behandlung realer](https://reader036.vdocuments.pub/reader036/viewer/2022062417/55204d7549795902118c975d/html5/thumbnails/62.jpg)
Fortsetzung in der Übung .....