Download GenuTEP - Eldorado

Transcript
Algorithmus 7 Diamantpunktzuordnung Schritt 2: Kantenzuordnung
Benötigt: P := pi ∈ IR2 | i ∈ {1 . . . 10} : Eingabe(teil)menge der Würfelpunkte
Benötigt: d(pi , pj ): euklidisches Distanzmaß
1: ∀pi ∈ P : (pi )y := 0 (Abb. 4.28(a))
2: markiere alle pi ∈ P als nicht zugeordnet
3: cluster := 0
4: zugeordnet := 0
5: minX := 0
6: maxX := 2/3 · maxi,j d(pi , pj )
7: while (zugeordnet < 8) und (minX < maxX) und (cluster < 4) do
8:
for pi ∈ P die nicht zugeordnet sind do
9:
for pj ∈ P mit j 6= i do
10:
if d(pi , pj ) ≤minX then
11:
if pj ist zugeordnet then
12:
füge pi in Cluster von pj ein und markiere pi als zugeordnet
13:
zugeordnet := zugeordnet+1
14:
else
15:
bilde Cluster aus pi und pj und markiere beide Punkte als zugeordnet
16:
zugeordnet := zugeordnet+2
17:
cluster := cluster+1
18:
end if
19:
end if
20:
end for
21:
end for
22:
minX := minX+1
23: end while
24: {Die Ausgabe des Algorithmus besteht im Erfolgsfalle aus 4 Clustern, welche jeweils 2
Punkte enthalten die eine Kante bilden (Abbildung 4.28(c)), siehe dazu auch Erläuterungen
im Text}
25: Nummerierung(P, K) (siehe Algorithmus 8)
70