[0] [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] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [ 59 ] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117]

(

/

/

2 CHOSEN UNCHOSEN, CHOSEN UNCHOSEN. , 2

CHOSEN, UNCHOSEN. , UNCHOSEN CHOSEN. 2 .

2 , CHOSEN UNCHOSEN. 2 , UNCHSN(/), NUMUN=yM-1 , . LIGHT, /- /- , VERTEX, /- .

2 : (1) LIGHT; (2) /- UNCHSN ( UNCHSN (NUMUN) UNCHSN (/)); (3) NUMUN, , 1; (4) LIGHT; (5) UNCHSN (/) , LIGHT , LIGHT(/) (/, UNCHSN(/)).

PRIM, . 1, 2, 3, . . . , -1 UNCHSN. 1

1


. 4.1.6. - PRIM.



, , . . NUMUN . - . 4.1.6.

, . 4.1.7, , 100 . ; .

CALL"CHECK, . 4.1.7 , , . , CHECK

SDBROUTINE PRIM(C,H,FROH,TO,COST.WEIGHT)

-

() G , -

. (BELL SYSTEM TECH.J. 36

( 1957). 1389-1401). PEAflHSAUHR -

* . .

(. ( 1972), 422).

C(I,J) ,, I J ,

I.LE.C(1,J).LE.999999. fEbPO

OTCYTCTBYET , C(I,J) = 1 ,

.

G 1.....,

2.LE.M.LE.100

FROM(I) 1- FROM(I)

0()- 0(1) COST(l)

COST(I)

WEIGHT

EDGES

LIGHT(I) VERTEX(I)

UNCHSN(T)

NEXT ,

NUMUN

UNCKSN(I)

VERTEX(I) , -

UNCHSN(I)

. 4.1.7. PRIM.



INTEGER EDGES .LIGHTdDD),NEXT,NUMUN,UNCK5K11D0) INTEGER VERTEXiIDD)

INTEGER C<1D0,10D),H,FR0M(1D0),10(1005.COSTllDO) INTEGER WEIGHT

= =

CALL 1.)

= () = "

EOGES = D NEXT = NUMUN =. -1 WE4GHT >» 00 1 00 I I.NUHUN

UNC.N(I) - I -1

LIGHT(I) = Cd.NEXTli -1

VERTEX(I) . NEXT M-1

106 CONTINUE

, -

" - -

200 00 300 I = 1.I4UMUN -1

J - UNCN(I) 1-1)/2

JK = C(J,NEXT) (-1)/2

IF(UIGHT(I) .LE. JK) GO TO 300 MlM-1)/2,»

VERTEX(I) - NEXT

LIGHTllJ - JK E

300 CONTINUE HlM-D/a

,

. 4.1.7.



[0] [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] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [ 59 ] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117]

0.001