19 , , . : , n . 20 . , . .
""
"" ( ). – . "" . , , . . .
. . , w, e – – w(e). . .
. . , . , , . . , , . , – . , , – . , , , . . .
F. ( F, ). . Part(x) – , x , x. Unite(x,y) – , , x y . n – . . :
1- n- . (ai, bi – i).
for i = 1 to n do.
x := Part(ai).
y : = Part(bi).
If x y then Unite (x, y), F i.
T – , , S – . , w(T) w(S).
M – S, P – T. S T, et T, S. et S. , C. C es, S. , , . w(S), w(et) w(es) . ( S T) , . , , w(T) , w(S).
- .
a, b, c, d, e (a, b), (a, e), (b, c), (b, e), (c, d), (c, e), (d, e). . F . (a, e), , a e F ( (a, e) ), (c, d), , F, , (a, b). (b, e) , , : b e F, F (b, e), . (b, c), (c, e), d, e. , (a, e), (c, d), (a, b), (b, c). . . .
, . (), .
, - , .
: (1,6); (0,3), (2,6) (2,6), (0,3) – ; (3,4); (0,1), (1,6) (1,6), (0,1), (5,6).
, , , , .