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
def
AddEdge(u,v):
C = component[u]
D = component[v]
if
Order(C) < Order(D):
for
w
in
Vertices(C):
component[w] = D
MergeComponents(C,D)
else
:
for
w
in
Vertices(D):
component[w] = C
MergeComponents(D,C)
def
CreatingCircuit(u,v):
if
SameComponent(u,v):
return
True
else
:
return
False
E = Sort(Edges,byWeight)
for
(u,v)
in
E:
if
not
CreatingCircuit(u,v):
AddEdge(u,v)