Index
Help
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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)