Index
Help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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