Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II...

44
Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme

Transcript of Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II...

Page 1: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Institut für Kartographie und GeoinformationProf. Dr. Lutz Plümer

Diskrete Mathematik IIVorlesung 8

08.06.00

Voronoi-Diagramme

Page 2: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

22

Konstruktion des Voronoi-Diagramms

„Divide and Conquer“

1. Input: Gegeben ist eine Menge P von mindestens 2 Punkten

2. Divide: Zerlege P in zwei etwa gleich große Teilmengen P1 und P2

3. Rekursiv: Berechne Voronoi-Diagramme von P1 und P2

4. Merge: Verknüpfe die beiden in Schritt 3 gebildeten Diagramme

5. Halt: Der Abschluß ist erreicht, wenn das Voronoi-Diagramm eines Punktes zu bilden ist; dies ist die ganze Ebene

Wie oft ist dieser Zyklus zu durchlaufen?

log n mal

O(n * log n)wenn „Divide“ and „Merge“ nicht mehr als n Schritte benötigen,

Page 3: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

33

P1

P2

Aufteilung der Menge P in P1 und P2

P

Page 4: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

44

Voronoi-Diagramm von P1

Page 5: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

55

Voronoi-Diagramm von P2

Page 6: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

66

Was ist das schwierigste Teilproblem? - Merge

Page 7: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

77

Konstruktion des trennenden Kantenzuges

Was wissen wir über den trennenden Kantenzug?• monoton in Nord-Süd-Richtung• jede Kante ist Grenze (Mittelsenkrechte)

zwischen einer roten und einer grünen Region• Problem: sukzessive Identifikation der

benachbarten roten und grünen Punkte• die nördlichsten und südlichsten Teilstücke sind

unbeschränkt, also Halbgeraden • die benachbarten roten und grünen Punkte bilden

dort unbeschränkte Voronoi-Regionen• sie liegen also jeweils auf der roten bzw. grünen

konvexen Hülle• beginnen wir also mit den beiden Tangenten

Page 8: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

88

Tangente

Page 9: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

99

Tangente – konvexe Hülle

Page 10: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1010

Konvexe Hülle

Page 11: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1111

Eine Tangente T an die Punktmenge P

• geht durch zwei Punkte von P• teilt die Ebene in zwei Halbebenen so, daß alle

Punkte in der gleichen Halbebene liegen• die Tangenten bestimmen die Lage der Kanten für

die neue konvexe Hülle beider Punktmengen• Konstruktion der Tangenten im Detail:

– später

Page 12: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1212

Vereinigung

Mittelsenkrechte bilden

Page 13: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1313

Vereinigung

Page 14: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1414

Vereinigung

Aktive Voronoi-Regionen

Schnittpunkte mit Seg-menten suchen

Page 15: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1515

Vereinigung

Aktive Voronoi-Regionen

Schnittpunkte mit Seg-menten suchen

Neue aktive VR (Voronoi-Region)

Page 16: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1616

Vereinigung

Aktive Voronoi-Regionen

Schnittpunkte mit Seg-menten suchen

Neue aktive VR

Mittelsenkrechte zuwischenden aktiven VR

Page 17: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1717

Vereinigung

Schnittpunkte suchen

Page 18: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1818

Vereinigung

Schnittpunkte suchen

Neue aktive VR suchen

Page 19: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

1919

Vereinigung

Schnittpunkte suchen

Neue aktive VR suchen

Page 20: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2020

Vereinigung

Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 21: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2121

Vereinigung

Schnittpunkte suchen

Page 22: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2222

Vereinigung

Schnittpunkte suchen

Neue aktive VR suchen

Page 23: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2323

Vereinigung

Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 24: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2424

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Page 25: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2525

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 26: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2626

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Page 27: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2727

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 28: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2828

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Page 29: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

2929

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 30: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3030

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Page 31: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3131

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Mittelsenkrechte deraktiven VR

Page 32: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3232

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Page 33: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3333

Vereinigung

Nächsten relevanten Schnittpunkte suchen

Neue aktive VR suchen

Verknüpfung mit der Mittel-senkrechten vom Anfang

Page 34: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3434

Vereinigung

Page 35: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3535

Löschen der überflüssigen Segmente

Page 36: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3636

Löschen der überflüssigen Segmente

Page 37: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3737

Ergebnis: Voronoi-Diagramm von P

Page 38: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3838

Datenstruktur für Voronoi-Diagramm

• Doppelt verkettete Kantenliste• Durchlaufen des Kantenumrings in linearer Zeit• Direkter Zugriff auf die benachbarten Maschen

Page 39: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

3939

Kosten

• wie lange dauert die Konstruktion des trennenden Kantenzuges?

• Zahl der Teilkanten / Knoten des Kantenzuges• Zahl Berechnungen von Schnittpunkten mit den

benachbarten Voronoi-Regionen

Page 40: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

4040

Länge des Kantenzuges im Worst Case

O(n)

Page 41: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

4141

Größenordnung des Kanten-Umrings im worst case

O(n)

Page 42: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

4242

O(n) * O(n) = O(n2) ?

Voronoi-Regionen sind konvex

Kantenzug ist monoton

war jetzt alles umsonst?

Page 43: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

4343

O(n) * O(n) = O(n2) ?

Voronoi-Regionen sind konvex

Kantenzug ist monoton

Keine Kante öfter als zwei mal anfassen!

Page 44: Institut für Kartographie und Geoinformation Prof. Dr. Lutz Plümer Diskrete Mathematik II Vorlesung 8 08.06.00 Voronoi-Diagramme.

„Investitionen müssen sich amortisieren“

• Ziel: keine Kante mehr als zwei mal „anfassen“• Es gibt insgesamt höchstens 3* n – 6 Kanten O(n)• Konvexität der Voronoi-Regionen höchstens

zwei Schnittpunkte mit der aktiven Halbgeraden• Es genügt, die linken (grünen) Kantenumringe im

Uhrzeigersinn und die rechten (roten) Kantenumringe gegen den Uhrzeigersinn zu durchlaufen und den zuletzt gefundenen und verworfenen Schnittpunkt als Haltepunkt zu merken!

Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00Lutz Plümer - Diskrete Mathematik II - SS 2000 - Vorlesung 8 - 08.06.00

4444