Index
Help
Created with Snap
Created with Snap
1
2
3
4
5
6
7
Tree has 0 vertices and weight 0.00
4x
.25x
.5x
1x
2x
4x
?
s = PickVertex()
for
v
in
Neighborhood(s):
F.AddEdge((s,v))
pred[v] = s
while
not
T.IsSpanning():
(u,v) = F.MinimumEdge(weight)
F.DeleteEdge((u,v))
T.AddEdge((u,v))
for
w
in
Neighborhood(v):
if
weight[(pred[w],w)] > weight[(w,v)] \
and
not
T.Contains(w):
F.DeleteEdge((pred[w],w))
F.AddEdge((w,v))
pred[w] = v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Edge (1,6) weight: 80
Edge (2,3) weight: 67
Edge (2,1) weight: 199
Edge (3,4) weight: 120
Edge (5,7) weight: 83
Edge (6,5) weight: 95
Edge (7,4) weight: 48
Vertex 1 at position (163,169) has predecessor 1
Vertex 2 at position (326,54) has predecessor 2
Vertex 3 at position (387,81) has predecessor 3
Vertex 4 at position (400,200) has predecessor 4
Vertex 5 at position (291,267) has predecessor 5
Vertex 6 at position (200,240) has predecessor 6
Vertex 7 at position (368,236) has predecessor 7