. , , ,

,,,

TOC t "chap_number;1;chap_name;1;sc;2;ssc;3" 㠠 PAGEREF _Toc423280427 h 6

1 : PAGEREF _Toc423280428 h 7

1.1 ? PAGEREF _Toc423280429 h 7

1.1.1 PAGEREF _Toc423280430 h 8

1.1.2 蠠 PAGEREF _Toc423280431 h 10

1.1.3 蠠 PAGEREF _Toc423280432 h 11

1.1.4 蠠 PAGEREF _Toc423280433 h 13

1.1.5 PAGEREF _Toc423280434 h 16

1.1.6 PAGEREF _Toc423280435 h 19

1.2 蠠 PAGEREF _Toc423280436 h 22

1.2.1 ࠠ PAGEREF _Toc423280437 h 22

1.2.2 OSI PAGEREF _Toc423280438 h 24

1.2.3 OSI : IEEE PAGEREF _Toc423280439 h 26

1.2.4 ࠠ PAGEREF _Toc423280440 h 27

1.3 PAGEREF _Toc423280441 h 29

1.3.1 ⠠ PAGEREF _Toc423280442 h 30

1.3.2 : 젠 PAGEREF _Toc423280443 h 32

1.3.3 PAGEREF _Toc423280444 h 37

1.3.4 蠠 PAGEREF _Toc423280445 h 37

2 PAGEREF _Toc423280446 h 40

2.1 PAGEREF _Toc423280447 h 41

2.1.1 ⠠ PAGEREF _Toc423280448 h 42

2.1.2 頠 PAGEREF _Toc423280449 h 43

2.1.3 頠 PAGEREF _Toc423280450 h 45

2.1.4 PAGEREF _Toc423280451 h 47

2.2 ࠠ PAGEREF _Toc423280452 h 47

2.2.1 蠠 PAGEREF _Toc423280453 h 48

2.2.2 蠠 PAGEREF _Toc423280454 h 50

2.3 PAGEREF _Toc423280455 h 51

2.3.1 頠 PAGEREF _Toc423280456 h 52

2.3.2 : PAGEREF _Toc423280457 h 54

2.3.3 PAGEREF _Toc423280458 h 57

2.4 , PAGEREF _Toc423280459 h 60

2.4.2 ⠠ PAGEREF _Toc423280460 h 62

2.4.3 蠠 PAGEREF _Toc423280461 h 64

2.4.4 ⠠ PAGEREF _Toc423280462 h 64

2.4.5 ⠠ PAGEREF _Toc423280463 h 66

3 蠠 PAGEREF _Toc423280464 h 66

3.1 ࠠ PAGEREF _Toc423280465 h 68

3.1.1 ࠠ PAGEREF _Toc423280466 h 68

3.1.2 ࠠ PAGEREF _Toc423280467 h 71

3.1.3 ࠠ PAGEREF _Toc423280468 h 73

3.2 , 堠 PAGEREF _Toc423280469 h 75

3.2.1 ࠠ PAGEREF _Toc423280470 h 78

3.2.2 ࠠ PAGEREF _Toc423280471 h 81

3.2.3 ࠠ PAGEREF _Toc423280472 h 85

3 PAGEREF _Toc423280473 h 88

3.1 PAGEREF _Toc423280474 h 88

3.2 PAGEREF _Toc423280475 h 89

4 蠠 PAGEREF _Toc423280476 h 89

4.1 - PAGEREF _Toc423280477 h 91

4.2 𠠠 PAGEREF _Toc423280478 h 95

4.2.1 -ࠠ PAGEREF _Toc423280479 h 95

4.2.2 .(Toueg) PAGEREF _Toc423280480 h 98

4.2.3 PAGEREF _Toc423280481 h 102

4.3 Netchange PAGEREF _Toc423280482 h 106

4.3.1 ࠠ PAGEREF _Toc423280483 h 107

4.3.2 Netchange PAGEREF _Toc423280484 h 112

4.3.3 ࠠ PAGEREF _Toc423280485 h 113

4.4 蠠 PAGEREF _Toc423280486 h 114

4.4.1 ⠠ PAGEREF _Toc423280487 h 115

4.4.2 PAGEREF _Toc423280488 h 118

4.4.3 PAGEREF _Toc423280489 h 125

4.5 PAGEREF _Toc423280490 h 127

4.5.1 蠠 PAGEREF _Toc423280491 h 128

4 PAGEREF _Toc423280492 h 130

4.1 PAGEREF _Toc423280493 h 130

4.2 PAGEREF _Toc423280494 h 131

4.3 PAGEREF _Toc423280495 h 131

4.4 PAGEREF _Toc423280496 h 131

4.5 PAGEREF _Toc423280497 h 132

5 ⠠ PAGEREF _Toc423280498 h 132

5.1 堠 PAGEREF _Toc423280499 h 133

5.2 PAGEREF _Toc423280500 h 134

5.2.1 PAGEREF _Toc423280501 h 135

5.2.2 G PAGEREF _Toc423280502 h 138

5.3 PAGEREF _Toc423280503 h 141

5.3.1 젠 PAGEREF _Toc423280504 h 141

5.3.2 젠 PAGEREF _Toc423280505 h 142

5.4 PAGEREF _Toc423280506 h 144

5.4.1 PAGEREF _Toc423280507 h 145

5.4.2 ⠠ PAGEREF _Toc423280508 h 146

5.4.3 (livelock) PAGEREF _Toc423280509 h 147

5 PAGEREF _Toc423280510 h 149

5.1 PAGEREF _Toc423280511 h 149

5.2 PAGEREF _Toc423280512 h 149

5.3 PAGEREF _Toc423280513 h 149

6 ࠠ PAGEREF _Toc423280514 h 149

6.1 ⠠ PAGEREF _Toc423280515 h 150

6.1.1 ⠠ PAGEREF _Toc423280516 h 151

6.1.2 PAGEREF _Toc423280517 h 153

6.1.3 PAGEREF _Toc423280518 h 155

6.1.4 PAGEREF _Toc423280519 h 156

6.1.5 ࠠ PAGEREF _Toc423280520 h 156

6.2 PAGEREF _Toc423280521 h 158

6.2.1 젠 PAGEREF _Toc423280522 h 158

6.2.2 젠 PAGEREF _Toc423280523 h 159

6.2.3 -젠 PAGEREF _Toc423280524 h 161

6.2.4 ࠠ PAGEREF _Toc423280525 h 163

6.2.5 젠 PAGEREF _Toc423280526 h 164

6.2.6 ࠠ PAGEREF _Toc423280527 h 167

6.3 ࠠ PAGEREF _Toc423280528 h 169

6.3.1 ꠠ PAGEREF _Toc423280529 h 170

6.3.2 ⠠ PAGEREF _Toc423280530 h 171

6.3.3 ⠠ PAGEREF _Toc423280531 h 172

6.3.4 頠 PAGEREF _Toc423280532 h 173

6.4 : 󠠠 PAGEREF _Toc423280533 h 175

6.4.1 󠠠 PAGEREF _Toc423280534 h 176

6.4.2 PAGEREF _Toc423280535 h 177

6.4.3 頠 PAGEREF _Toc423280536 h 182

6.5 PAGEREF _Toc423280537 h 182

6.5.1 ⠠ PAGEREF _Toc423280538 h 182

6.5.2 젠 PAGEREF _Toc423280539 h 184

6.5.3 蠠 PAGEREF _Toc423280540 h 186

6 PAGEREF _Toc423280541 h 188

6.1 PAGEREF _Toc423280542 h 188

6.2 PAGEREF _Toc423280543 h 189

6.3 PAGEREF _Toc423280544 h 190

6.4 PAGEREF _Toc423280545 h 190

6.5 PAGEREF _Toc423280546 h 190

7 ࠠ PAGEREF _Toc423280547 h 190

7.1 堠 PAGEREF _Toc423280548 h 191

7.1.1 , 堠 PAGEREF _Toc423280549 h 192

7.1.2 PAGEREF _Toc423280550 h 193

7.2 蠠 PAGEREF _Toc423280551 h 196

7.2.1 -ࠠ PAGEREF _Toc423280552 h 196

7.2.2 Petersen / Dolev-Klawe-Rodeh PAGEREF _Toc423280553 h 200

7.2.3 PAGEREF _Toc423280554 h 203

7.3 蠠 PAGEREF _Toc423280555 h 207

7.3.1 젠 PAGEREF _Toc423280556 h 208

7.3.2 Gallager-Humblet-Spira PAGEREF _Toc423280557 h 210

7.3.3 GHS . PAGEREF _Toc423280558 h 212

7.3.4 GHS ࠠ PAGEREF _Toc423280559 h 215

7.3.5 GHS ࠠ PAGEREF _Toc423280560 h 219

7.4 Korach-Kutten-Moran PAGEREF _Toc423280561 h 220

7.4.1  PAGEREF _Toc423280562 h 221

7.4.2 KKM PAGEREF _Toc423280563 h 225

7 PAGEREF _Toc423280564 h 225

7.1 PAGEREF _Toc423280565 h 225

7.2 PAGEREF _Toc423280566 h 226

7.3 PAGEREF _Toc423280567 h 226

7.4 PAGEREF _Toc423280568 h 226

8 PAGEREF _Toc423280569 h 227

8.1 PAGEREF _Toc423280570 h 228

8.1.1 PAGEREF _Toc423280571 h 228

8.1.2 PAGEREF _Toc423280572 h 231

8.1.3 ⠠ PAGEREF _Toc423280573 h 233

8.2.2 Shavit-Francez PAGEREF _Toc423280574 h 237

8.3 , PAGEREF _Toc423280575 h 241

8.3.1 Dijkstra-Feijen-Van Gasteren PAGEREF _Toc423280576 h 242

8.3.2 : ࠠ PAGEREF _Toc423280577 h 245

8.3.3 頠 PAGEREF _Toc423280578 h 249

8.3.4 PAGEREF _Toc423280579 h 252

8.4 PAGEREF _Toc423280580 h 254

8.4.1 ࠠ PAGEREF _Toc423280581 h 254

8.4.2 , 蠠 PAGEREF _Toc423280582 h 256

8 PAGEREF _Toc423280583 h 259

8.1 PAGEREF _Toc423280584 h 259

8.2 PAGEREF _Toc423280585 h 259

8.3 PAGEREF _Toc423280586 h 259

8.4 PAGEREF _Toc423280587 h 260

13 PAGEREF _Toc423280588 h 260

13.1 PAGEREF _Toc423280589 h 260

13.1.1 , , PAGEREF _Toc423280590 h 260

13.1.2 蠠 PAGEREF _Toc423280591 h 262

13.1.3 堠 PAGEREF _Toc423280592 h 264

13.2 - PAGEREF _Toc423280593 h 265

13.3 蠠 PAGEREF _Toc423280594 h 268

13.3.1 : 堠 PAGEREF _Toc423280595 h 269

13.3.2 蠠 PAGEREF _Toc423280596 h 273

13.4 PAGEREF _Toc423280597 h 275

13.4.1 - PAGEREF _Toc423280598 h 276

13.4.2 - PAGEREF _Toc423280599 h 280

13.5 堠 PAGEREF _Toc423280600 h 285

13 PAGEREF _Toc423280601 h 289

13.1 PAGEREF _Toc423280602 h 289

13.2 PAGEREF _Toc423280603 h 289

13.3 PAGEREF _Toc423280604 h 289

13.4 PAGEREF _Toc423280605 h 290

13.5 PAGEREF _Toc423280606 h 291

14 PAGEREF _Toc423280607 h 291

14.1 PAGEREF _Toc423280608 h 292

14.1.1 PAGEREF _Toc423280609 h 293

14.1.2 PAGEREF _Toc423280610 h 295

14.1.3 PAGEREF _Toc423280611 h 298

14.2 蠠 PAGEREF _Toc423280612 h 303

14.2.1 PAGEREF _Toc423280613 h 304

14.2.2 頠 PAGEREF _Toc423280614 h 307

14.2.3 PAGEREF _Toc423280615 h 308

14.2.4 RSA PAGEREF _Toc423280616 h 310

14.2.5 -ࠠ PAGEREF _Toc423280617 h 310

14.2.6 堠 PAGEREF _Toc423280618 h 313

14.3 ⠠ PAGEREF _Toc423280619 h 315

14.3.1 ⠠ PAGEREF _Toc423280620 h 316

14.3.2 ⠠ PAGEREF _Toc423280621 h 318

INCLUDETEXT "E:\DISTR\(1-2)Bykov.doc"

, , , . ; . Tanenbaum [Tan88] Sloman and Kramer [SK87], , .

, . . , , 15 . - - . - .

, .

. ( 1 12) . , , , . , .

( ) . ftp.

. , ( ). , , .

1 :

, , . , . , , , , .

1.1. . , , , , , . , .

, . , , . , , , . 1.2.

, . Tanenbaum [Tan88], Sloman and Kramer [SK87], Bal [Bal90], Coulouris [CD88], Goscinski [Gos91]. , . 1.3 , , .

1.1 ?

, , . , . ( , . 2.6.) , , , . , (SIMD) . , .

, , , . , , , , , .

. Tanenbaum [Tan88], , , . , .

1.1.1

, , . . . . , , 1.1.2 1.1.6.

(1)   . , . , (WAN). : , , .
, , ( ). .

(2)   . , (, , ). , . , , , . , . , (LAN).
, , . -, -, . 50 , , 500 . -, , ( , ). , .

(3)   . , . , , . . .
, , , . .

(4)   . .
, , .

(5)   . , . , .
. . , . : , , ..

1.1.2

, , . . . , , .

, (, ..). 10 . , . .

, . 10 . , , .. , . .

, , . , , :

(1)   . , - . , . , . , , , - , .

(2)   . , . .

(3)   . , . , , .

(4)   . , . , .

1.1.3 , 1.1.4.

1.1.3

. ARPA . ARPANET 1969, 4 . , (MILNET, CYRPRESS). ARPANET ( (IMP)), .

UNIX , UNIX , uucp (Unix-to-Unix CoPy). UNIX UUCP . , BITNET, , ARPANET .

, ( ) . , Internet. (gerard@cs.ruu.nl) , .

. -. , . , .. - , , , . . 1.1. , , . .

. 1.1 -

, , , , . , 1 .

(1)   - ( 3). , , - . - , , , . .
, , , . , , , , .

(2)   . ( 4). - . , , . ( ) , . , , , , .. , , . , , .

(3)   . , . . [Tann88, 5.3].

(4)   . ( 5). - --, , , . , , , . , , .

(5)   . , , . , , , . , .

1.1.4

, . , ( , ) . ( ) .



. 1.2

. 1970- Ethernet Xerox. ARPANET, BITNET, .. , . ARPANET, BITNET, UUCP , Ethernet, Token Ring SNA .

, ethernet , .. , ; . . 1.2. , .

Ethernet ; , ( IBM), , , . , , . , , . , , .

. IBM - SNA , IBM. SNA , IBM.

. , , , . , . , . , , . , ( ) , , . , --. , , , .

( , ) , 2.

(1)   ( 6). , , , - .

(2)   ( 7). , , . , , , .

(3)   ( 8). , , , . , .

(4)   . , , - , , . , , , . , , , . , 6, ., [BGS87].

(5)   . , , . , . , , . , , , .

(6)   . ( , , , , ), , . , .

(7)   . , , , , . , ; ., , [LL86].

1.1.5

, , . 頠 . , .. . , . ( , ). , . , .

- - ( SIMD) - - ( MIMD) .

F

P

U

C P U


. 1.3

SIMD , . , , , SIMD . MIMD .

. , -. , .

, Inmos; . . 1.3. (CPU), (FPU), , . 4 (.. ). Inmos , . 32 . , ; .

Connection Machine CM-5, Thinking Machines Corporation [LAD92]. , , , . 128 , 16384 , 1012 . ( 16384 900 2 .) -5 - . , , - . , , , . .. SIMD, () MIMD .

, . , , .

, . .

(1)   . -, . , , , , . , . , , (, ) .

Inmos 104 , , 4.4.2, . , , , (. 5.5).

(2)   . (PRAM), . , , ; , .

, , . , , .

(3)   . , ; . , . , ; . , . . [Gos91, 9] [HJ90].

(4)   ( 3). . , , , , (., , 4.3). , , , .. , . , , , , .

1.1.6

() , , .

. , 80 125 . , (**) (!). (EOR). , . , .. ** !, , EOR, .

. , 1, , . , 2, EOR 125 . , , , 1.2.1, .

, , , . , , . .

, , , . , . [Dij68] [OG76]. , , .

(1)   . , , .. . , , , . , , [Dij68] : , . - .

, , , , , . , wait-free, , . , , . wait-free . [KK89].

(2)   -. , , , , , . - , ; 1 , 2 .

(3)   . , , . , , , , , . [DLM78] -, , .

, .. , . , , . - - [BA84].

, , , , . , , . , .

(1)                                  . [Dij68] , . V , , ( , ).

: 1, V. ; , V .

(2)                                  . [Hoa74] , , , . .. , , , . , , .

(3)                                  . [Bou83] , ; -.

UNIX. 1 1 2 2 , UNIX 1 | 2 . 1 2 ; 1 , , 2 , .

(4)                                  . , OCCAM ADA, , . ; .. , .

, , ( ). , OCCAM ADA .

1.4

1.2

. , ( 1.2.1). , , , , IEEE (, 1.2.2 1.2.3). , , ( 1.2.4).

1.2.1

, , . , , , . , , . ; . 1.4 . , . , i i + 1 i i + 1 (, i / (i + 1) ). , , .

, , i "", i / (i + 1) , "", (i l) /i . , (i 1) /i , p q, , i / (i + 1) , p q . i - , , (. , 1.3.1 3). , i , .., . , " " i layer-i . ( 0 1.4) - . 0/1 , i , , , , .. - , 0 ( ) , 0/1 . : , , . . , , , , , . . , "" , ( , , IEEE). / internet (TCP/IP) - , Internet. TCP/IP - , , . TCP/IP (. Davidson [Dav88] ) OSI , , .

( - SMTP), ( , FTP), (Telnet).

1.2.2 OSI

() , ( ) . (OSI) , . , IEEE . OSI , , , , , , , . , , ( , ).

(1) . , . , , , - , . - - , 1/2 , . ; .

(2). , , . , , . ( .) , , . (), , , , . , ; .

, , . , . , , ( ) , ( ). . , , ..

(3). , , . , - . , , . , , ( ). . , , . ( ) , , . ( c), . ; , c , , .

(4). , , , , . , . , .

, : , , .

(5). , . , , , . , , . . , , .

(6). , , . ( , 5/6) , ( , 6/7) - - . , , . , , .

(7). , , , , . , , , .

1.2.3 OSI : IEEE

OSI . , , - . , (. 1.1.4), , . , . , , . IEEE , OSI , (, , , , ). , , IEEE , , , , . , .

(1) . IEEE , . ( ..), , , , , .

Medium-access-control (2a). , , , . , . , , , , , , . : , , , , , . , , , , . , , (, , ), , . , , , . () , , , .

Logical-link-control (2b). OSI , : . , , OSI , . , logical-link-control OSI . , , , logical-link-control . ; , logical-link-control .

1.2.4

, , . , . , (. 2.1.2), , . , , , , ; , A. , , . ; , , ., , Bal [Bal90]. , , , , . , , , . . , , , .

. () . , , , , . , , . . . ; .

. : , , a . , , , . , , , . c , ; : , c . , , "" "". ( ) ( ). - , . , , , . , , . ; , , . , .

, , , . , , , , . , , ( ) . - (RPC). b, a , b, ; , . - ; , . , , , . [Dij68] [Hoa78], , . , () , .

. . , . . - , ( ). , . , , , , .

1.3

; . , , . , - , , . , 1.3.1 1.3.2 . ; . 1.3.3 . , . , 1.3.4.

1.3.1

, .

(1) . . , , , , . , . . , . , . , , , , , , , . ( , ) . , , . . , ; , . , , - ; , , , [Lam78]. , p q, p , q . , ( p q) ; - , . p q , .

(3) . , ; , . , -, - .

, . , , , . , , - , . , , , , .

, , , . ; , , . , , ( 2.2), , ( 2.21). ; ", " . , , . , - .

. 1.5

1.3.2 :

, , , Beisnes [Bel76l, . a b, , . , , . (NCPs), a b . a , m NCP A. NCPs ( , DN) , m b (NCP B), a ( NCP A). 1.5. a b, NCP A NCP B , . , , , , . , . , , NGP ; . m., , , a b, b. m, , . . , NCPs , ( ).

. , , , NCPs , . NCPs , NCP . , , , a, NCP NCP ( ), NCP . b . NCP A. NCP , NCP , . , NCP NCP , . , NCP ; NCP, NCP ( ) NCP , . , NCPs ( ), . NCP NCP , NCP , . , . NCPs . , .

C . , NCP , , a, , . NCP , , b . , , .

C . . , NCP (, m) (ack) NCP B. , NCP . NCP B, (, m), m b, (ack), . , , .

1. NCP send (, m)

2. NCP B receive (, m), deliver m., send (ack), close

3. NCP receive (ack), notify, close.

NCP (, m) , . (- , NCP , (, m) , (ack) , NCP B (, m) (ack).) , NCP A , , . , , , , , :

1. NCP A send ( data, m)

2. NCP B receive (data, m), deliver m, send (ack), close

3. DN ( ack ) is lost

4. NCP A timeout, send ( data, m)

5. NCP B receive (data, m), deliver m, send (ack), close

6. NCP A receive (ack), notify, close

, , , . , m1 m2, .

1. NCP A send ( , m1 )

2. NCP B receive (, m1), deliver m1, send (ack), close

3. NCP A timeout, send ( , m1 )

4. NCP B receive (, m1), deliver m1, send (ack), close

5. NCP A receive (ack), notify, close

6. NCP A send ( , m2)

7. DN ( , m2 ) is lost

8. NCP A receive (ack) (step 2), notify, close

m1 , , , . - . , , , T , . , ( , NCP NCP B). NCP 2T .

C . , , NCP , NCP . .

1. NCP A send (data, m)

2. NCP B receive (data, m), deliver m, send (ack)

3. NCP A receive (ack), notify, send (close), close

4. NCP B receive (close), close

(, m) NCP A, NCP A . (ack) (, m), , NCP , .

, . NCP , (close) , NCP (ack) , (close). NCP A , , ( (nocon)), NCP . (ack) , , NCP A , , , .

1. NCP A send ( data, m1 )

2. NCP B receive (data, m1), deliver m1, send (ack)

3. NCP A receive (ack), notify, send (close), close

4. DN ( close ) is lost

5. NCP A send ( data, m2 )

6. DN ( data, m2) is lost

7. NCP B retransmit (ack) (step 2)

8. NCP A receive (ack), notify, send (close), close

9. NCP B receive (close), close

, . , NCP A NCP B. , , , . .

1. NCP A send ( data, m, x)

2. NCP B receive ( data, m, x), deliver m, send ( ack, x, )

3. NCP A receive (ack, x, y), notify, send (close, x, y), close

4. NCP B receive ( close, x, y ), close

, , , NCP A 8 , 5. , NCP B (, m, x) m ( 2), . , 1 , (, m, x) NCP B m . , NCP B , , . , NCP B 4, a 2. NCP A NCP B, NCP B , . , , NCP B ; (close, x, y) . NCP B (ack, x, y) , NCP (nocon, x, y) , NCP B , .

1. NCP A send (data,m,x)

2. NCP B receive ( data, m, x ), send ( ack, x, y )

3. NCP A receive (ack,x,y), notify, send (close, x, y), close

4. DN ( close, x, y ) is lost

5. NCP B timeout, retransmit ( ack, x, y )

6. NCP A receive (ack, x, y), reply (nocon, x, y)

7. NCP B receive (nocon, x, y), deliver m, close

, NCP B , NCP , x y. NCP B, .

1. NCP A send (data, m, x )

2. NCP A timeout, retransmit ( data, m, x)

3. NCP B receive ( data, m, a:) (sent in step 2), send (ack, x,y1 )

4. NCP A receive ( ack, x, y1 ), notify, send { close, x, y1 ), close

5. NCP B receive (close, x, yi ), deliver m, close

6. NCP B receive (data, m, x ) (sent in step 1), send ( ack, x, 2)

7. NCP A receive ( ack, x, y2), reply { nocon, x, y2)

8. NCP B receive ( nocon, x,y2) in reply to ( ack, x, y2 ), deliver m, close

. NCPs, , , .

1. NCP A send ( data, m, x )

2. NCP B receive ( data, m, x ), send ( open, x, )

3. NCP A receive ( open, x, ), send ( agree, x, )

4. NCP B receive (agree, x, y), deliver m, send (ack, x, y), close

5. NCP A receive (ack, x, y), notify, close

NCP , , , NCP . (nocon, x, y) NCP (agree, x, y) , . , NCP A (ack, x, y), {agree, x, y) ; (nocon, x, y) . , NCP , (agree, x, y), NCP ( {data, m, x}) m! , NCP m, (ack, x, y) , . , NCP A {nocon, x, y); , , .

c . Beisnes [Bel76] , , , NCP . , - , , , . - ( NCPs, ), , . , ( NCP), . , c , , , , , .

1.3.3

, 80-x. , , , ( ) . , , . , , . , , " " (. 9).

, . , . (PoDC) 1982 , . (WDAG) (1985), (1987), (1989), Bari (1990), Delphi (1991), (1992), Lausanne (1993), Terschelling (1994). 1989, Springer-Verlag . (SToC) (FoCS) , . SToC , FoCS IEEE. (JPDC) , (IPL).

1.3.4

.

(1) , , , , .

(2) . 3.2 11 14. 9. 8. 3.

(3) , .

, . , : , , .

1: . , , . 2 , , . , , . , . , .

3 . , , Schoone, . , Fletcher Watson , . , , . 4 . Toueg . - Netchange Tajibnapis , Lamport. , . , . 5. , , , .

2: . " ", , . 6 " ", . , , , , . , , . .

- : , . 7. , , - O (NlogN) ( N ). , , . Gallager .

- , ( ) , . 8. , . (., Dijkstra, Feijen, Van Gasteren Dijkstra Scholten) .

9 , . Angluin, . , , .

10 , "", . , , , .

11 . , , . , , . , , : , .

3: . , , , . ; 12. 13. Fischer ; , , . , , . Bracha Toueg : , , , . , (. 9), .

14 . Lamport , . , , ( 11), . , "" . , , . 14 .

, - , 15. , , , . , . ( 6.4) ( 4). , ( 3) . , , c .

. A , , . . .

2

. . , , , , .

( ), . , , , . , . , , , , . , , , . , , .

, ( ). 2.1 , , . ? , , , . ( .)

2.2 2.3 , 2.1. 2.2 , . 2.3 , : . , ; , . , , . , 2.4 , .

2.1

, ( ) . , , . 2.1.1.

( ). , . . , .

. , . , , 15. , , [Dij68] [OG76].

, . , . , - . [CBMT92]. 2.1.2 ; 2.1.3 , . 2.1.4 .

2.1.1

, (), , , . ( ), .

2.1 S = (C, , I), , C, I .

. (g, d) Î g d.

2.2 S = (C, , I) . S E = (g0, g1, g2,), g0 Î I, i ³ 0, gi gi+1.

g, d , g d. , E = (g0, g1, g2,) gi gi+1 i , , .

2.3 d g, g Þ d, g = g0, g1, g2, , gk = d c gi gi+1 0 £ i < k. d , .

2.1.2

. , . , . , ( ) . ( ), , . M , M M(M).

2.4 (Z, I, ^i, ^s, ^r), Z , I Z , ^i Z x Z, ^s ^r Z x M x Z. ^ Z

c ^ d Û (c, d) Î ^i Ú $m Î M((c, m, d) Î ^s È ^r ).

^i , ^s , ^r , , , . p, q, r, p1, p2 .., P. 2.4 ; , , (. ). (Z, ^, I). , , , . , , , , .

2.5 P = {p1, , pN} , P.

, . ; , , ( ) ; , .

2.6 , p1, , pN , ( pi (Z, I, ^i, ^s, ^r)), S = (C, , I),

(1) C = {(cP1, , cPN, M) : ("p Î P : cp Î Zp) M Î M(M)}.

(2) à = (ÈpÎP àp), àp p; àPi

(cP1, , cPi, , cPN, M1), (cP1, , cPi, , cPN, M2),

:

  (cPi , cPi ) Î ^iPi M1 = M2;

  m Î M, (cPi , m, cPi ) Î ^sPi M2 = M1 È {m};

  m Î M, (cPi , m, cPi ) Î ^rPi M1 = M2 È {m}.

(3) I = {(cP1, , cPN, M) : ("p Î P : cp Î Ip) Ù M = Æ}.

, . . (c, d) Î ^ip () p, ^sp ^rp .

  = (c, d) p g = (cP1, , cP, , cPN, M), cp = c. , e(g) (cP1, , d, , cPN, M).

  e, e = (c, m, d) p g = (cP1, , cP, , cPN, M), cp = c. , e(g) (cP1, , d, , cPN, M È {m}).

  e, e = (c, m, d) p g = (cP1, , cP, , cPN, M), cp = c m Î M. , e(g) (cP1, , d, , cPN, M {m}).

, , . .

2.1.3

, , , . , , . , : , .

2.7 , p1, , pN , S = (C, , I),

(1) C = {(cP1, , cPN) : "p Î P : cp Î Zp}.

(2) à = (ÈpÎP àp) È (Èp,qÎP:p¹q àpq),

  àPi

(cP1, , cPi, , cPN), (cP1, , cPi, , cPN),

(cPi , cPi ) Î ^iPi ;

  àPiPj

(, cPi, , cPj , ), (, cPi, , cPj , ),

m Î M ,

(cPi , m, cPi ) Î ^sPi (cPj , m, cPj ) Î ^rPj .

(3) I = {(cP1, , cPN) : ("p Î P : cp Î Ip)}.

; . , , . ( , ). 2.6 2.7.

. , . , [CBMT92]. , .

, , , . , .

, . , . . , , , . , . , , , .

, .

(1)  

(2)  

, , , , .

2.1.4

. , ( ) , ( ).

2.8 , . , .

, [MP88]. , , ; , , . , , . , , . , [Fra86].

2.2

, , . , ; , . , ; . [CM88, Fra86, Kel76, MP88]. , . .

: . , , . , , . , , . , (. 2.4.4), (. 3), (. 9), ..

, , , . . , , , .

2.2.1

P . . , , , , . P(g), g , , , g, .

S = (C, à, I). , {P} à {Q}, , g à d ( S), (g) Q(d). {P} à {Q} , , , Q .

2.9 S,

(1)   g Î I,

(2)   P} à {P}.

, , . , , .

2.10 S, S.

. = (g0, g1, g2, ...) S. , (gi) i. -, (g0) , g0 Î I 2.9. -, P(gi ) gi à gi+1 , E. 2.9 P(gi+1) , . 

, , , (. 2.2). 2.10. , , , , ; , , . ( , , Q, .)

2.11 Q S Q Þ P ( g Î ). S.

. 2.10, Q , Q P, P . 

, . .

2.12 S P, Q . Q-,

(1)   g Î I, Q(g) Þ (g);

(2)   {Q Ù } à {Q Þ }.

2.13 Q Q-, Q Ù P .

. 2.9, ,

(1)   g Î I, Q(g) Ù (g);

(2)   Ù } à {Q Ù }.

.. Q , Q(g) g Î I, .. g Î I, Q(g) Þ (g), P(g) g Î I. , Q(g) Ù P(g) g Î I.

g à d Q(g) Ù (g). .. Q , Q(d) , .. {Q Ù P} à {Q Þ }, Q(d) Þ (d), (d) . , Q(d) Ù (d) . 

, , 3.1.

2.2.2

. . , , , ( ). , , .

S . term , . , . , , , . , . , , , .

2.14 S ( ), (term Þ ) S.

. <, .

2.15 (W, <) ,

w1 > w2 > w3 ... .

, , n- (. 4.3). , , , , . , f C W , f .

2.16 S . f W ( ), g à d , f(g) > f(d) (d).

2.17 S . S f (w.r.t ) , S.

. = (g0, g1, g3, ...) S. , , .. term Þ S, . , E , , , s (f(g0 ), f(g1), ...) gi, Œ. Œ f, s , , W, s . , Œ (g0, g1, ..., gk ) . Œ, (gk+1) . 

, ( 2.17), . . , , . , f , .

, 2.17

2.18 S , , .


. 2.1 -

2.3

. , b, a b. = (g0, g1, ...) Œ=(0, 1, ...), i , gi gi+1. , . - , 2.1, , . , , , . m s r, s r. , s r .

2.3.1, . , . 2.3.2. 2.3.3 ( ), , .

2.3.1

, , , . , , , . , .

2.19 g ( ) q q, g. q(g), q (g), (q(g)) = q((g)).

. , , , , (, , , d). d , , , , . , (, d) (c,Æ,Æ,d), (, m, d) (, Æ, {m}, d), (, m, d) (c, {m}, Æ, d). , = (, x, y, d) p g = (p1, ..., Cp, ..., N, M), = x Í M.

(g) = (p1, ..., d, ..., (M x) È ).

= (bp, x, , dp) q = (bq, xq, q, dq)

g         , ..., q, ..., M),


= bp, cq = bq, xp Í M, xq Í M. , xq , xp ( ) , q ( ) q.

g = (g),

g = (..., dp, ..., cq, ..., (M xp ) È ).

xq Í M xq Ç = Æ, , q Í (M xp È ), q g. gpq = eq(g), ,

gq = (..., dp, ..., dq, ..., ((M xp È ) xq ) È q ).

, gq = eq(g). gqp = ep(gq), ,

gqp = (..., dp, ..., dq, ..., ((M xq È q ) xp ) È p ).

M , xp Í M, xq Í M,

((M xp È ) q È q ) = ((M xq È q ) xp È ),


gpq = gqp . 

q , , ..

..., g, (g), q((g)), ...


g. 2.19 .

(1)   p = q;

(2)   , q - .

, , p q , q , , ep, . , , , . , , ( 2.19) g gpq g gq. , .

, , , . , .

2.20 . í, , ,

(1)   f f, í f.

(2)   s r , s í r.

(3)   í .

í= b, ( í b Ú = b). í= , b, í= b b í= . , || b. 2.1, b || f, d || i, ..

[Lam78] , . í . , í b = 0 , 1 , ..., = b , (1), (2) 2.20. , , (1), , , .., . 2.1 l , f, g, h, j, k, l.

2.3.2 :

, , , . , .

f = (f0 , f1 , f2 ,...) . - F = (d0, d1, d2, ...), i, fi di fi (di) = di+1. F f. , F f, . p p, f, p . , f , , (, , , d), , . , f , d0 , .

= (g0, g1, g2, ... ) Œ = (0 , 1 , 2 , ...) , f Œ. , s ( {0, ..., k-1}, k ) , fi = s(i). (f0 , f1 , f2 , ...) , fi í= fj i £ j, .., , , .

2.21 f = (f0 , f1 , f2 , ...) , . f F, . F , , F .

. F , di+1 , fi di. d0 = g0.

, j < i, fj dj dj+1 = fj (dj ). di = (cp1 , ..., cpN , M) fi =(c, x, y, d) , fi di, p = c Í .

, p = c . , . , f Œ.

1: fi - f, . fi Œ, , . , = .

2: fi f. f fi fi' = (c, x, y, d), = d. fi' fi Œ, , = d. , = .

, Í , f Œ. fi , = Æ Í . fi , fi . fj í fi , j < i , .., fi f, , Í .

, i, fi di, di+1 fi(di). , , , F , . gk . Œ , gk . f , dk , dk gk. , gk Œ. f, dk.

gk , Œ. Œ f , F. 


. 2.2 - . 2.1

F , F. , , F, F. 2.21, , F , E ~ F.

. 2.2 , , . 2.1. [Mat89c]. , , . 2.1 . 2.2.

, . . 2.1 (g), , , l, . . 2.2 , , l, .

, , , .. , . , , .. , . . , . sim , , , . , . 2.1 sim , 2.2 . 2.21, , , sim .

~ . .

2.22 ( ~) .

, . , . , . , . , , ( 2.21). . , .

, .

2.23 (, <) , b Î b ³ a. <1 < , <1 b.

, b , b , , b , b , b. , , .

2.19 . , , .

2.24 g 1 q, 2 r s, q, , 1 2 g. 1 2(g), 2 1(g), 1(2(g)) = 2(1(g)).

, , 2.19, 2.9. 2.20. [CBMT92]. 2.21 .

2.3.3

, , , . , Q - , (, <)

2.25 Q, ,

a í b Þ Q() < Q(b).

.

(1)   . , (0, 1, 2, ), Qg(i) = i. , .

, , . , , , , Qg . 2.19. , Qg(i) = i i ( ). , , Qg, i . , Qg , .

(2)   . , , . , . .

2.6, . , , ( , ) . , . , 2.19 , . , , (. 3.2) 11 14.

2.3

(3)   . [Lam78] , k (1, , k) ,

1 í 2 í ík = a

, í b, , , QL(a) < QL(b). QL , .

() , , QL(a) = QL(a) + 1.

(b) , , b , , QL(a) = max(QL(a), QL(b)) + 1.

QL(a) , .

, q ( 0). , , m qm , . 2.3. , QL() q , .. , . , QL .

. , , .

(4)   . , ( 2.25), . , , , 2.25 ,

a í b Û Q() < Q(b). (2.1)

, ( ) -- .

[Mat89b] X = NN, .. Qv(a) N. n , :

(1, , n) £v (b1, , bn) Û "i (1 £ i £ n) : ai £ bi. (2.2)

( , 2.5, ). , Qv(a) = (1, , N), i 1, í . , .

- [CB89] , ( (2.2)). N n , (2.1) , n ³ N.

2.4 ,

, . , . , . , . , , . , , , . , . , ( ), . q, , q. , , , , q p. , q, ( ) q.

. G = (V, E), , , . . .

. . . , , , . . . , , , , , .

(1)   . N- v0 vN-1 c v0vN-1 ( N). , . , , Token Rings [Tan88, 3.4], .

(2)   . N N 1 , . , , , , .

(3)   . N () N-1 , N-1 . , . , - .

(4)   . , .

(5)   . HCN = (V, E) N = 2n . V n:

V = {(b0 , ..., bn-1) : bi Î {0, 1}},

b , , b . n- , .

. 2.4

2.4. . , . , ( ) . , , (. 4).

2.4.2

( 2.1.2) , , q () q. , , . .

(1)   . , , , ( ). , , . () . , , ( ) .

, , , , , , , , . 2.6, .

, , . , . , . , . , , . , . , , , , , .

(2)   fifo. , fifo, , . , m1 m2 q m1 , m2, m1 q, m2. , fifo .

Fifo 2.6 , . , . fifo, , , . , .

, fifo , ., , 3.1. , . , , , ( ) , . , fifo , .. ( ) . fifo .

[Ahu90]. , , . . . [SES89] , . 1 2 m1 m2 q 1 2 1 í 2 , q m1 m2 . , , , fifo, , - . [CBMT92].

(3)   . , . , , . , .

2.6 , .. , . , .

2.4.3

, , : , 2.19. , ( ). , , , .

. , , . 3.2. , ( ) . .

, , .. . 3.2, 11 14.

2.4.4

, , . , , , . .

(1)   . : , , . , , (. ).

(2)   . , (), . , , (.. ). , , - () . , , , . , ( ) 9.

(3)   . , , . , , . . , . , . , , . , , , . . 2.5. , , r s (, b c, ), q.

. 2.5 () (b)

2.4.5

: , ,

INCLUDETEXT "E:\DISTR\(3)Vodovoz.doc" 3

, . , , . , ; , , , , . , , .

- , , . , , , , . , , , . , , . , . - , , . , , .

, , OSI ( 1.2.2). ; , . , , .

( 3.1) , ( ), , , OSI. ( 3.2) , ( ), OSI . , , .

(1) . . , ; , 3.1 ( . ). , , , ; , - . 3.2 , .

(2) . , , . , , . . , . , .

, , , . 3.1 , 2.2. [Wat81], , , . , , , . 3.2 , ( 2.6) , , .

. , . , , - , , .. , -, , ( [Tan88, 41). , , , . ; .

3.1

, . [Sch91, 2]. , , , fifo. , , 3.1.3, , , . 3.1.1, 3.1.2 .

p q. , . p , q, inp. p , q, , outp. , p inp outp. outp[i] udef i. q inq outq . , .. 0. 3.1.3 , "" , . .

p sp, , p q. , , p outp[0] outp[sp - 1]. sp . q sq. . , ; , - .

(1) .

outp[0..sp 1] = inq[0..Sp 1] outq[0..sq 1] = inp [0...sq 1].

(2) . k ³ 0, sp ³ k
sq ³ k - .

3.1.1

. , , . , , ( ) , . , , . , ; .

, , ,
< pack, w, i >, w - , i - ( ). , p ( q), = inp[i] q, , , q. p q , lp , , < pack, w, i >, p, 0.. i lp q. (q .) lp lq p q. :

(1) p inp[i] ( < pack, inp[i], i >) , outp[0] outp[i lp], . . , i < sp + lp.

(2) p < pack, w,i>, inp[0] inp[i lq] .

. ; . 3.1. p ap ( aq q), , p ( q, ) ..

3.1 Sp - i- p, Rp - p, Lp - p. p , . , - ( ). , , , , ap sp . Sq, Rq Lq , p q .

var sp, ap : integer init 0, 0 ;

inp : array of word (* *) ;

outp : array of word init udef, udef, ...',

Sp: {ap £ i < Sp+lp}

begin send < pack,inp[i],i> to q end

Rp: { < pack, w, i > ÎQp }

begin receive ;

if outp[i] = udef then

begin outp[i] := w ;

ap := max(ap,i-lp+1) ;

Sp := min{j|outp[j]= udef}

end

(* else , *)

end

Lp: {ÎQp}

begin Qp := Qp {} end

3.1 ( p).

. , Qp p Qq, q. , sp Rp , sp . , , , P - . ( i - .)

P º "i < sp : outp[i]¹ udef (0p)

/ "i < sq, : outq[i] ¹ udef (0q)

/ < pack, w, i > Î Qp Þ w = inq[i] / (i < sq + lq) (lp)

/ < pack, w, i > Î Qq Þ w = inp[i] / (i < sp + lp) (lq)

/ outp[i]¹ udef Þ outp[i] = inq[i] / (ap > i lq) (2p)

/ outq[i]¹ udef Þ outq[i] = inp[i] / (aq > i lp) (2q)

/ ap £ sq, (3p)

/ aq £ sp (3q)

3.1 P - 3.1.

. Qp Qq - , i, outp[i] outq[i] udef, ap,ap, sp sq 0; , P=true. P. -, , inp inq, .

Sp: , Sp (0p), , Sp sp outp[i] udef.

, Sp (0q), , Sp sq, 堠 outq[i] udef.

, Sp (1p), , Sp Qp sp.

, Sp (lq), Sp < pack, w, i > Qp w = inp[i] i < sp + lp, sp.

, Sp (2p) (2q), , Sp outp, outq, ap, aq.

, Sp (3p) (3q), , Sp ap , ap , sq , sp.

Rp: , Rp (0p), , Rp outp[i] udef, sp, (0p).

, Rp (0q), , Rp outq sq.

, Rp (lp), , Rp Qp sq.

, Rp (lq), , Rp Qq sp.

, Rp (2p), , Rp outp[i] w < pack, w,i>. .. Qp , Rp, (1p) , w = inp[i]. ap:= max (ap, i lq+1) , ap > i lq . , Rp (2q), , Rp outq aq.

, Rp (3p), , Rp
ap:= max(ap, i lq+1) ( ), (lp) , i < sq+lq, ap £ sq . Rp sq. , Rp (3q), , sp Rp.

Lp : , Lp (0p), (0q), (2p), (2q), (3p), (3q), , Lp . (lp) (lq) , Lp ( ).

Sq, Rq, Lq P , . ð

3.1.2

, 3.1 . , 3.2, .

3.2 3.1 .

. (0p) (2p) , outp[0..sp 1] =inq[0..sp1], (0q) (2q) outp[0..Sq -1] = inp[0..Sq -1].ð

, lp lq. , . lp lq ; , . , lp + lq > 0.

g = (cp, cq, Qp, Qq), cp cq - p q. g , Sp ( i).

d = Sp(g) = (cp, cq, Qp, (Qq È {m})),
, Lq d. Lq m, Lq(d) = g. Lq(Sp(g)) = g äàåò íà÷àëî íåîãðàíè÷åííûì âû÷èñëåíèÿì, â êîòîðûõ íè sp , sq .

, .

Fl. , .

F2. , .

Fl , , ; F2 , , .

: sp sq . , , sp, sq, . , , , .

Ëåììà 3.3 P sp lq £ ap £ sq £ aq+ lp £ sp + lp.

Äîêàçàòåëüñòâî. (0p) (2p) sp lq£ ap, (3p) ap£ sp . (0q) (2q) sp £ ap + lp . (3q) ap + lp £ sp + lp

Òåîðåìà 3.4 Àëãîðèòì 3.1 .

Äîêàçàòåëüñòâî. , . , , , , .

3.5 P , < pack, in[sq], sq> p
< pack, inq[sp], sp ) q .

Äîêàçàòåëüñòâî. .. lp + lq > 0, Ëåìì 3.3 , ..,

sq < sp + lp / sp < sq+lq.

P ap £ sq (3p) aq £ sp (3q), ,

(ap £ sq

, Sp i = sq Sq i = sp. ð

, sp sq . 3.5 , . C - , sp sq , sp and sq - , C. , p[sq], sq> p q[sp], sp > q , sp, sq, ap aq . , Fl, , F2, . , .. sp p sp ( q), , sp, sq . Òåîðåìà 3.4 . ð

Fl F2. F2-ìèíèìàëüíîå , , p q, , . , inp[i] , . Fl : ap , inp[ap] . , ().

3.1.3

. Àëãîðèòì 3.1 , .. ( in out) .. . , . L = lp + lq.

Ëåììà 3.6 P , < pack, w,i> p i < ap+L.

Äîêàçàòåëüñòâî. Sp i < sp+lp, Ëåìì 3.3 i < ap+L. ð

Ëåììà 3.7 P , outp[i]¹ udef, i < sp + L.

Äîêàçàòåëüñòâî. (2p), ap > i lq, i < ap + lq, i < sp + L ( Ëåìì 3.3). ð

Ðèñóíîê 3.2 .

Ðèñóíê 3.2. p inp[ap..sp + lp 1] , , p . p ( S Ðèñóíê 3.2). , ap , p , ( A Ðèñóíê 3.2). , sp , p , . Ëåìì 3.6, p L .

p outp. .. outp[i] i < sp, , p ( W Ðèñóíê 3.2). .. outp[i] = udef i ³ sp + L, outp[i] . outp[sp..sp +L1] p. Ðèñóíê 3.2 u R , . , , . 3.6 3.7 , 2L .

. , , fifo-. fifo , , p 2L- sp. , fifo .

Ëåììà 3.8 P',

P' º P

/ is behind in Qp Þ i > i' - L (4p)

/ is behind in Qq Þ i > i' - L (4q)

/ ÎQp Þ i³ ap - lp (5p)

/ ÎQq Þ i³ aq - lq (5q)

Àëãîðèòì 3.1.

Äîêàçàòåëüñòâî. .. , P - , , (4p), (4q), (5p) (5q) . , , (4p), (4q), (5p) (5q) . , .

Sp: , Sp (4p) (5p), , Sp Qp ap.

, Sp (5q), , Sp Qq, i ³ ap, , i³ aq - lq ( Ëåìì 3.3).

, Sp (4q), , < pack, w', i'> Qq, (lq)
i' < sp + lp, , Sp < pack, w, i> i ³ ap, 3.3 i' < ap+L £ i+L.

Rp: , Rp (4p) and (4q), , Rp Qp Qq.

, Rp (5p), , ap ( )  i' - lq +1, Qp i > i' - L ( 4). i ³ ap - lp ap.

, Rp (5q), , Rp Qq aq.

Lp: Lp Qp Qq, ap aq; (4p), (4q), (5p) (5q).

, Sq, Rq Lq P'. ð

Ëåììà 3.9 P' ,

Î Qp Þ sp -L£ i< sp +L

Î Qq Þ sq -L£ i< sq +L.

Äîêàçàòåëüñòâî. Î Qp. (lp), i < sq + lq, Ëåìì 3.3 i < sp + L. (5p), i ³ ap lp, Ëåìì 3.3 i ³ sp L. Qq . ð

Ëåìì modulo k,
k ³ 2L. , sp i mod k, p i.

. lp lq . [Sch91, Chapter 2]. ,

, .., ,

, .., p q q p,

, , .

, . , L = 1, ò.å., lp = 1 lq= 0 ( ). ap aq, -lp -lq, 0. , ap + lq = sp aq + lp = sq , ap sp ( aq sq) . , [Lyn68] , , , .

3.2 ,

, Dt- (Fletcher Watson) . [FW78], ( ) [Tel91b, 3.2]. ( 3.1), . , .

( ) , . ( 3.2.1 , ). . Òàêèì îáðàçîì, ãîâîðÿò, ÷òî ñîåäèíåíèå îòêðûòî ( ), .

( , ), . [FW78] [Tel91b, 3.2]. , , .

One direction. , , p q. p , q - (). , , , , .. q p.

. , , p q . data/ack (/) , ( ), , , .

. , , , . , - , . , .

, . . , , - , . , , .

, , 3.1, , . , .

. . , .

, . .

. , . , 0, , , .

. m ( ). Òàêèì îáðàçîì, s t,

s < t < s + m.

, m ( ).

. , . - , ( ). , Xt - , t Xt(t) Xt t1 and t2 ,

Xt(t1)-Xt(t2)=t2-t1.

, : d d. 3.2.3 , .

, 3.1, inp. p; p . inp, p ( ), êîãäà p , . .

, , 3.1. , () , , . , inp , .

, , , , inp . , , , . , , , , . ( p , ; .) , 3.2.2:

. inp q p (" " ) p.

. , q ( , inp).

3.2.1

, ( ) ( ) , . , , - , . , ( ). cs ( cr, ) , ( , ) . , , ( , ); . , , .

, 0. High, , Low. ( 3.1), Low High 1, . U, , . inp[i] Ut[i], U , . Òàêèì îáðàçîì, p Low ...High - 1, .

:

m : real ; (* *)

:

U : real ; (* *)

R : real ; (* - : R³ U+m *)

S : real ; (* - : S ³ R + 2m *)

:

Low : integer ; (* *)

High : integer ; (* *)

St : timer ; (* *)

:

Exp : integer ; (* *)

Rt : timer ; (* *)

:

Mq : channel ; (* q *)

Mp : channel ; (* p *)

:

B : integer init 0 ; (* *)

cr : boolean init false ; (* *)

cs : boolean init false ; (* *)

Ðèñóíîê 3.3 , .

, : ( -; ), . , . , , . m. , q, .

Ap: (* *)

begin if not cs then

begin (* *)

create (St, High, Low) ; (* cs := true *)

Low := High := 0 ; St := S

end;

Ut[B + High] := U, High := High + 1

end

Sp: (* i- *)

{ cs / Low £ i < High / Ut[B + i] > 0}

begin

send p[B + i],m > ;

St:=S

end

Rp: (* *)

{ cs / r >Î Mp }

begin receive r > ; Low := max (Low, i) end

Ep: (* *)

{cs / Ut[B + Low] £ -2m -R}

begin error [B + Low] := true ; Low := Low + 1 end

Cp: (* *)

{cs / St < 0 / Low = High }

begin B := B + High , delete (St, High, Low) end

(* cs := false *)

Àëãîðèòì 3.4 .

, St Rt . , m + U, . m + U ; , . Rt R , , R , R ³ U + m. R , Rt , . , ; , S , S - , , S ³ R+2m. St S , , St < 0. (ò.å. , ), .

Rq: (* *)

{ Î Mq }

begin receive ;

if cr then

if i = Exp then

begin Rt := R ; Exp := i + 1 ; deliver w end

else if s = true then

begin create (Rt, Exp) ; (* cr := true *)

Rt := R ; Exp := i +1 ; deliver w

end

end

Sq: (* *)

{cr}

begin send m > end

(* Rt, . Time *)

Àëãîðèòì 3.5

- , , , ( ). true, ( ). q , , ( Exp).

B . , . , 0, , , . , , i, "" B + i, B - , p . "" "" 3.7. B , "" inp [0 .. B-1].

Loss: { m Î M } (* M - Mp, Mq *)

begin remove m from M end

Dupl: { m ÎM } (*M - Mp, Mq *)

begin insert m in M end

Time: (* d > 0 *)

begin forall i do Ut[i] := Ut[i] -d ,

St := St -d ; Rt := Rt - d ;

if Rt £ 0 then delete (Rt, Exp) ; (* cr := false *)

forall <.., r> Î Mp, Mq do

begin r := r d ;

if r £ 0 then remove packet

end

end

Àëãîðèòì 3.6 .

, Mp p Mq q. - 3.4, - 3.5. , 3.6, . . Loss Dupl M Mp, Mq. Time d, , d . 0, .

Ðèñóíîê 3.7 .

3.2.2

. P0, , , , .

P0 º cs Þ St £ S (1)

cr Þ 0 < Rt£ R (2)

"i < B+ High : Ut[i] £ U (3)

"<... r>Î Mp, Mq : 0

< data, s, i,w, r>Î Mq Þ cs ÙSt³ r +m+R (5)

crÞ cs / St ³ Rt + m (6)

r> ÎMp Þ cs / St>r (7)

ÎMq Þ (w = inp[B + i] / i < High) (8)

(3): High , .

Ëåììà 3.10 P0 - , .

Äîêàçàòåëüñòâî. , , B = 0, , P0 - true.

Ap: (1) , .. St S (St = S). (3) , .. High, Ut[B + High] U. (5), (6) (7) , .. St . (8) , .. High .

Sp: (1) , .. St S. (4) , .. m. (5) , .. <.., m> St S, S = R + 2m. (6) (7) , .. St . (8) , .. w = inp[B + i] i < High.

Rp: Rp P0, (4) (7).

Ep: Ep P0.

Cp: Cp false (5), (6) (7), ((2), (5), (6) (7)) . Cp B, , .. , ( (5) (7)), (8) .

Rq: (2) , .. Rt R ( ). (6) , .. Rt R , è (4) (5) cs Ù St ³ R + m .

Sq: (4) , .. , m. (7) , .. < ack,i,r > r = m cr , (2) (6) St > m.

Loss: (4), (5), (7) (8) , .. .

Dupl: (4), (5), (7) (8) , .. m m , , .

Time: (1), (2) (3) , .. St, Rt, Ut[i] , , Rt 0. (4) , .. r , , r- 0. , Time ( r- ) , Xt > Yt +C, Xt Yt -, C - . , (5), (6) (7) . ð

, . 0k(i)

0k(i) ó error [i] = true / q inp [i].

, , . P1

P1º P0

/ Øcs Þ" i < B: 0k(i) (9)

/ cs Þ" i < B + Low : 0k(i) (10)

/ ÎMqÞ"i

/ cr Þ" i < B+ Exp : 0k(i) (12)

/ r>Î Mp Þ" i

Ëåììà 3.11 P1 - , .

Äîêàçàòåëüñòâî. , 0k(i) true i, false. , , B = 0, , P1 .

Ap: Ap , (10), .. Low = 0 "i < B : 0k(i) (9).

Sp: Sp < data, s, I, w, r >, .. s I = Low, (11) (10).

Rp: Low , < ack, I, r >. , (10) , .. (13) "i < B + I : 0k(i) , .

Ep: Low , Ep, , (10) .

Cp: Cp cs false, St < 0 Low == High. (10) , "i < B+ High : 0k(i) Cp, (9) . (10) false , (5), (6) (7) , (11), (12) (13) ; (10), (11), (12) (13) .

Rq: , q < data, true,l,w,r> (cr - false). "i < B+I : 0k(i) (11), w . ..
w = inp[B+I] (8), Exp := I + 1 (12).

, Exp
< data, s,Exp,w,r> . (12), "i < B + Exp : 0k(i) , w = Wp[B + Exp] , Exp (12).

Sq: m> (13) (12).

Loss: Loss .

Dupl: m (, , ) .

Time: (9)-(13). q (11), (12) (13).ð

, . ; Àëãîðèòì 3.4 , 2m + R , , . , , Ep p , , Ut[B + Low] = 2m Rl.

Òåîðåìà 3.12 ( ) inp q p U+2m+R+l p.

Äîêàçàòåëüñòâî. inp[I], B+High > I . inp[I], B > I, (9). B + Low £ I, B + Low..I 2m + R inp[I]. , 2m + R +l , ò.å., U+ 2m +R+l . I < B+ Low, , , ( (10)). ð

, , ( inp), . pr ( ,
pr =-1 and Ut[-1] = -¥ ). P2 :

P2º P1

/ Î Mq Þ Ut[B+i] > r -m (14)

/ i1 £ i2 < B + High Þ Ut[i1] £ Ut[i2] (15)

/ cr Þ Rt ³ Ut[pr] + m (16)

/ pr < B + High / ( Ut[pr] > -m Þ cr) (17)

/ cr Þ B + Exp = pr + 1 (18)

Ëåììà 3.13 P2 - , .

Äîêàçàòåëüñòâî. Mq , B + High , Øcr ,
Ut[pr] < -m, (14)-(18).

Ap: (15) , .. U, (3) .

Sp: (14) , .. Ut[B +i] > 0 r=m .

Cp: (14), (16) (18) , .. (5) è (6) , Cp . (15) , .. B B + High è . (17) , .. B B + High è pr è cr .

Rq: (16) , .. Rt R ( ) Ut[pr] £ U (3), è R³ 2m+U. (17) , .. pr < B+High, (8), è cr true. (18) , .. Exp i +1 è pr B + i, , (18) true.

Time: (14) , .. Ut[B + i] è r (è ). (15) , .. Ut[i1] è Ut[i2] . (16) , .. cr , è Rt è Ut[pr] . (17) , .. , Rt £ 0, ( (16)), Ut[pr] < -m. (18) , .., cr false, B, Exp è pr .

Rp, Ep, è Sq, (14)-(18). Loss è Dupl (14)-(18) , . ð

Ëåììà 3.14 P2 ,

< data, s,i1,w,r> Î Mq Þ (cr / B+i1 > pr).

Äîêàçàòåëüñòâî. (14), 1,w, r> Î Mq Ut[B+i1] >r -m > -m.

B +i1 £ pr , .. pr < B + High (15), Ut[pr] > -m, (17) cr true. ð

Òåîðåìà 3.15 () , q inp.

Äîêàçàòåëüñòâî. q 1,w,r > è w. , B + i1 > pr ( Ëåìì 3.14), w inp pr. , i1 = Exp, B+i1 = B+Exp = pr+1 (18), , w = inp[pr+1]. ð

3.2.3

. , .

. è , è , , , . , , , "" .

, . , , ( ), . , , , , .

, , .

. , , , , Ëåìì 3.9 [Tel91b, Section 3.2]. , ( p) : U + 2m+ R . Ap

{(High < L) V ( Ut[B + High - L] <-R -2m)}.

, , 2L- Exp, è - L- High. , modulo 2L.

. , () . - "" , , . , . , . Fletcher Watson [FW78] , "" , ; - . , "" . , , . , , Fletcher Watson "" , , .

Time-e: { d > 0}

begin (* p d ' *)

d ' := ... ; (* £ d ' £ d ´ (1 + e) *)

forall i do Ut[i] := Ut[i] - d ' ;

St := St - d ' ;

(* q d ' *)

d":=...; (* £ d '' £ d ´ (1 + e) *)

Rt := Rt - d " ;

if Rt < 0 then delete (Rt, Exp) ;

(* r - *)

forall (..,r) Î Mp, Mq do

begin r := r - d,

if r < 0 then remove packet

end

end

Àëãîðèòì 3.8 Time.

P2

"m Î M : A(m)

è , . ,

èëè

Þ $m Î M : A(m).

, , è îêàçàòåëüñòâ Àëãîðèòì, .

Time. , Xt ³ Yt + C,

Xt è Yt - è C -.

P1¢ = cs Þ St£ S (1¢)

/ cr Þ 0 < Rt £ R (2')

/ "i < B + High : Ut[i] < U (3')

/ " <.., r > Î Mp, Mq : 0 < r £m (4')

/ Î M, Þ cs / St ³ (1+e)(r+ m+(1+e)R) (5')

/ crÞ cs / St ³ (l+e)((i+e)Rt+m) (6')

/ < ack, i, r > Î Mp Þ cs / St > (1 + e)´r (7')

/ ÎMq, Þ (w = inp[B + i] / i < High) (8')

/ Øcs Þ /i < B: 0k(i) (9')

/ cs Þ /i < B + Low : 0k(i) (10')

/qÞ"i

/ cr Þ "i < B + Exp : 0k(i) (12')

/ r >Î MpÞ"i

/ q Þ Ut[B+i] > (l+e)( r -m) (14')

/ i1£ i2 < B + High Þ Ut[i1] < Ut[i2] (15')

/ cr Þ Rt ³ (1 + e)((l + e) Ut[pr] + (1 + e)2 m) (16')

/ pr < B + High / Ut[pr] >-(1+e)mÞ cr (17')

/ cr Þ B + Exp = pr+1 (18')

Ðèñóíîê 3.9 .

. Time , d d , , . e-, ãäå e- , , d d ', d /(l + e) £ d' £ d ´ (1 + e). ( e 10-5 10-6.) Time-e, Àëãîðèòì 3.8.

, Time Xt ³ Yt + C , , è
Xt ³ Yt + C (Xt - d) ³ ( Yt - d) + C. Time-e. Xt, Yt, d, d ', d", r, è c, d > 0 è r > 1,

(Xt ³ r2 Yt + c) / (£ d '£ d ´ r) / (£ d ''£ d ´ r)

(Xt-d ')³ r2(Yt- d") + c.

, Time-e

Xt ³ (1 + e)2 Yt + c.

, . , , R è S

R ³ (1 + e)((1 + e)U + (I + e)2) è S ³ (1 + e)(2m + (1 + e)R).

, . Ðèñóíê 3.9.

Òåîðåìà 3.16 P2'- , e- . .

3

3.1

Óïðàæíåíèå 3.1 , , Fl è FS, F2.

Óïðàæíåíèå 3.2 , L = 1 è ap è aq, -lq è -lp, ap+lq = sp è aq+lp = sq.

3.2

Óïðàæíåíèå 3.3 , , .

(1) , .

(2) , , , ?

Óïðàæíåíèå 3.4 , - , . , , .

Óïðàæíåíèå 3.5 , , , .

Óïðàæíåíèå 3.6 Time-e . ?

Óïðàæíåíèå 3.7 3.16.

Óïðàæíåíèå 3.8 , , , , Ep.

Ep: (* *)

{ Ut[B + Low] < 0 }

begin error[B + Low] := true ; Low := Low + 1 end

àêèì îáðàçîì - ? .

INCLUDETEXT "E:\DISTR\(4)Vodovoz.doc" 4

( ), , . . - , , , (, , ) , . - ( ) .

, () ; . .

1. . , , .

2. . , .

"" .

(1) . , .

(2) . , , () .

(3) . "" , , , . , " " .

- , , , .., .

(4) . ( ) .

(5) . , , , , , .

(6) . .

- , .

, , - , , - ( , ). , " " ; , " ", :

(1) . ( ) . , , .

(2) . () , . .

(3) . , . , () .

. .

. 4.1 , , , , d , d. , , .

4.2 , . . , : .

, 4.3, : . , , . " Netchange , , .

4.2 4.3 ( ) . . 4.4 , , . "" . - , , .

4.5 . , - , . , .

4.1 -

, , ( ), () . , . . (, , , - , .)

(1) P , P . P ; , P C(P) ÎÂ..

(2) , , i= 0,..., k
C()=C()+C().
, ( - u0 u0) C() = 0.

(3) .

( ). u v, , u v . , ; () .

4.1. u, v ÎV. u v G, , .

. , u v, So, , .., P' u v C(So)£C(P). C(So) ( )

V = {v1, ..., vn}. , P , v1, v1, v2 .., P u v P' C(P')£ C(P). Po =P, i = 1,..., N Pi . vi Pi-1 Pi = Pi-1. , Pi-1 = . uj1 uj2 vi Pi-1

Pi =

Pi - u v {v1, ..., vn} , PN - u v. Pi-1 Pi Q= uo, . . . , uj2 C(Pi-1) = C(Pi) + C(Q). , C(Pi) £ C(Pi-1) , , C(PN )£ C(P).

So, C(So) £ C(PN,), C(So) £ C(P) []

G , ; , . , , G ( , ).

4.2. d Î V Td = (V, Ed) Ed Í E v Î V, v d Td - v d G.

. V = { v1, ..., vN }. Ti = (Vi, Ei) ( i = 0, ...,N)

(1) Ti - G, .., Vi Ì V, Ei Ì E, Ti - .

(2) Ti ( i < N) Ti+1.

(3) i > 0, vi Î Vi d Î Vi.

(4) wÎVi, w d T, - w d G.

, TN Td.

, Vd = {d} Eo = Æ . Ti+1 . P= vi+1 d, l , ul Î Ti ( l , ul = d Î Ti ; l = 0). :

Vi = Vi È{ uj: j

( 4.1.) Ti Ti+1 vi+1 Î Vi+1. Ti+1 , Ti+1 , . (To , )

4.1 Ti+1.

, w Î Vi+1 , () w d Ti+1 - w d G. w Î Vi Ì Vi+1 , Ti Ti+1 ; w d Ti+1 , Ti, . w = uj, j < l Vi+1 V,. Q ui d Ti, Ti+1 uj d Q, , G. -, P' = P ul d, .., C(P') = C(Q): Q C(P') ³C(Q), C(Q)< C(P') ( ) Q , P, P. , R uj d , Q. , , R , P, R , P, P. Ž

, d , d, , 4.2 , . , , , 4.2. , table_lookupu , u ( ). , d , d, , , u¹d, table_lookupu(d) u Td.

, () , , . , , ( d), u1, . . . , uk , i , ui ¹d, i < k, table_lookupu(d) = ui+1, table_lookupu(d) = uj+1.. , , , d.


(* d u *)

if d=u

then

else table_lookupu (d)

4.2 - ( u).

4.3 , -.

. d, d , - .

, - d ( uo) uo, u1, u2, . .. , ui = uj, , < ui ..., uj> , -. , , , , , , uk (k < N). d , , uk = d, N 1 

, - . , , N 1 , . , , , , - ;

. , ( , (1) ), . , . ( ) , , - ; "" 4.3. , , - . , , ,

4.3 .

4.2

Toueg [Tou80a] . (u, v) u v u. . Toueg - [CLR90, 26.4]. - 4.2.1, Toueg 4.2.2. 4.2.3 ..

4.2.1 -

G = (V, E) , uv wuv . wuv= wvu , , . < uo, ..., uk> . u v, d(u, v), u v (¥ ). - d(u, v) u v.

, - S-; , S V.

4.4. S - V. < uo ..., uk> -S- i, 0 S(u. v), S- u v (¥ ).

Æ-, S- S, V- . .

4.5 u S, dS(u, u) = 0. , S- u¹ v.

(1) Æ - u v uv ÎE.

(2) uv Î E dS(u, v) = wuv dS(u, v) =¥ .

(3) S'=S È{w} S'- v - S- u v S- u w S- w v.

(4) S' = S È{w} dS (u, v)=min(dS (u, v), dS (u, w)+ dS (w, v)).

(5) u v V- u v

(6) d(u, v)= dV (u, v),

. u S dS (u, u) £.0 , ( 0 ) S- u u 0. , , G , , dS (u, u) = 0.

(1): Æ - , Æ - u v

uv.

(2): (1).

(3): S- u v w , 0 . w S-, - S-, w w.

(4): 4.1 . ( S- u v ) S' - dS(u, v) u v, , dS(u, v) = min(dS (u, v), dS (u, w) + dS (w, v) ) (3).

(5): S- - , .

(6): S- - , , , V- .

_____________________________________________________________________

begin (* S = Æ D = Æ- *)

S:=0;

forall u,v do

if u = v then D[u, v] := 0

else

if uv Î E then D[u, v] := wuv

else D[u. v] := ¥ ;

(* S *)

while S ¹ V do

(* : "u, v : D[u, v] = dS (u, v) *)

begin w V S ;

(* w- *)

forall u Î V do

(* w- u *)

forall v ÎV do

D[u. v] := min ( D[u, v], D[u, w] + D[w, v] ) ;

S:=S È{w}

end (*"u, v : D[u, v] = dS (u, v)*)

end

4.4 -.

4.5 " " ; . 4.4. 0-, , , S- S ( S "" ), , .

4.6 4.4 Q(N3) .

. D[u, v] = 0, u = v, D[u, v] = wuv , uv Î E D[u, v] = ¥ , S = 0. 4.5, (1) (2), "u, v D[u, v] = dS (u, v) . w S w, D[u, v] ( (3) (4) ) "u, v : D[u, v] = dS(u, v) . , S = V, .., ( (5) (6) ) S- .

N , N2 ( ), .ˆ

_____________________________________________________________________

var Su : ;

Du : ;

Nbu : ;

begin Su :=Æ ;

forall v Î V do

if v = u

then begin Du [v] :=0 ; Nbu[v] := udef end

else if v Î Neighu

then begin Du[v] := wuv ; Nbu[v] := v end

else begin Du[v] := ¥ ; Nbu[v] := udef end ;

while Su¹ V do

begin w V Su ;

(* w *)

if u == w

then " Dw"

else " Dw"

forall v Î V do

if Du[w] + Dw[v] < Du[v] then

begin Du[v]:= Du[w] + Dw[v] ;

Nbu[v] := Nb[w]

end;

Su := Su U {w}

end

end;

4.5 ( u).

4.2.2 .(Toueg)

Toueg [TouSOa], - . - , .., . . , . ; A1 . .

A1. .

A2. ( V).

A3. ( Neighu u) .

Toueg (4.6) , " " ( 4.5).

. - . D[u, v] - u; , Du[v] ., Du[v], u, w, u. - (w ), "". , S- ( Du[v]), ( Nbu[v]).

.

4.7 S w :

(1) u :Du[w] = dS(u, w)

(2) dS(u, w) < ¥ u ¹ w, Nbu[w]- S- w.

Tw = (Vw, Ew), (u Î Vw Û Du[w]<¥ ) (ux ÎEw Û (v¹wÙNbu[w]=x)) - w.

. -, , Du[w] < ¥ u ¹ w, Nbu[w] ¹ udef u Î Vw, u ¹ w x Nbu[w] = x, x Î Vw.

u¹ w Vw Ew, Tw Tw . ux ÎEw dS(u, w) =wux+ dS(x, w), o, u1, .. ., uk> Tw

dS(uo, w) = wuo u1 + wu1 u2 + + wuk-1 uou+ dS(uo, w),

.., 0 = wuo u1 + wu1 u2 + + wuk-1 uou

, . ‰

- 4.5. N . , , , () . , " Dw" w, " Dw" , Dw.

" w V S", . V , , ( , ).

.

4.8 4.5 N . u Du[v] = d(u, v), u v Nbu[v] u v, Nbu[v] = udef.

. Du[v] - ( 4.6). Nbu[v] Nbu[v] Du[v] .‰

. 4.5 , Toueg , u Du[w] = ¥ w- w- . Du[w] = ¥ , Du[w] + Dw[v] < Du[v] v. , , Tw ( w- ) w, Dw , Tw. , w Dw Tw Tw ( Tw) Tw.

____________________________________________________________________

var Su : ;

Du : ;

Nbu : ;

begin

Su := Æ ;

forall v Î V do

if v = u

then begin Du[v] := O ; Nbu[v] := udef end

else if v Î Neighu

then begin Du[v] := wuv ; Nbu[v] := v end

else begin Du[v] := ¥ ; Nbu[v] := udef end ;

while Su ¹ V do

begin w V Su ;

(* Tw *)

forall x Î Neighu do

if Nbu[w] = x then send < ys, w> to x

else send < nys, w > to x ;

num_recu := O ; (* u |Neighu| *)

while num_recu < |Neighu| do

begin < ys, w > < nys, w > ;

num_recu := num_recu + 1

end;

if Du[w] < ¥ then (* . *)

begin if u¹ w

then Nbu[w] ;

forall x Î Neighu do

if < ys, w > x

then < dtab, w, D>) x; ;

forall v Î V do (* w- *)

if Du[w] + D[v] < Du[v] then

begin Du[v] := Du[w] + D[v] :

Nbu[v] := Nbu[w]

end

end;

Su := Su È {w}

end

end

4.6 oueg ( u).

_____________________________________________________________________

w- u Du[w] < ¥ ( Tw) , . v u, u v u Tw. 4.6. w Tw. :

(1) u x; w- x u Tw.

(2) u x w- x u Tw

(3) w- Tw Dw .

( ) W , .

4.9 4.6 u v u v, , , . 0(N) ,, 0(N*|E|) , O(N2W) , O(N 3W) , 0(NW) .

. 4.6 4.5, .

( < ys, w> < nys, w> ) ( ) w- , 3N . < ys, w > < nys, w > O(W) O(NW) , . N2 < dtab, w,D> 2N - |E| ( ) , O(N2 - NW +2N-|E|-W) = O(N3W) . Du Nbu u 0(NW) .‰

w- , .., w. FIFO , , < dtab, w, D > Nbu[ w] ( Vw). , , w FIFO. FIFO w' w, w' w. , ( ) w'-.

Toueg , . ( u2 u1 u2 u1)

4.10 u1¹ w, u2 ꠠ u1 Tw, w- , u2 v w- , u1 v .

. u2 u1 Tw :

dS(u2, w) = dS (u2, u1) + dS (u1, w). (1)

u1 Î S:

dS(u2, v) £ dS (u2, u1) + dS (u1,v). (2)

u2 Du2 [v]

dS(u2, w) + dS (w, v) < dS (u2, v). (3)

(2), (1), dS(u2, u1),

dS(u1, w) + dS (w, v) < dS (u1, v) (4)

u1 Du1 [v] .‰

, 4.6 . Dw, ( ) u w- , Tw. D[v] Du[v] w- . ( 4.7), .

4.2.3

Toueg . , x ( ) x. a , . .

Toueg , , ; . .

-, , (w) . , ( , 6.9) Toueg.

-, Toueg d(u, v) £ d(u, w) + d(w, v). ( u) d(w, v), , .., u . , Toueg ( ).

, d(u, v) :

ì 0 u=v

d(u,v)= í (4.1)

î wuw+d(w,v) 堠

ࠠ Toueg.

(1) . (4.1), u (, wuw) (, d(w, v)). .

(2) . v (, d(w, v) w u) u v. , vo , , .

, - -. , Toueg. - (4.1); , ( Toueg) .

, ? - . ( ) (., , [Gaf87]). , 4.1 . 4.3, .

-. [MS79] ; . v, Tv v, v.

v, u v (Du[v]) u (Nbu[v]), u Tv. u , Du[v], Nbu[v] ( < mydist, v, Du[v]> ). u w d+wuv < Du[v], u Nbu[v] w Du[v] d + wuv. v W .

[MS79] i i , N . .

4.11 0(N2) , 0(N2 W) , 0(N2 |E|) , 0(N2|E|W) .

. .

. [CM82] ( , ).

, , vo ( ), u Du[vo] = ¥ . vo o,0> . u o,d> w, d + wuw < Du[vo], u d+wuv Du[vo] < mydist, vo, D Du[vo]> ; 4.7.

var Du[vo] : init ¥ ;

Nbu[vo] : init udef ;

vo :

begin Du[vo] := 0 ;

forall w Î Neighvo do < maydist, vo, 0> w

end

< maydist, vo, d> w u:

{ o,d> Î Mwv }

begin o,d> w ;

if d + wuw < Du[vo] then

begin Du[vo] := d+wuw ; Nbu[vo] := w ;

forall x Î Neighu do < maydist, vo, Du[vo]> x

end

end

4.7 - ( u).

Du[vo] d(u, vo), .., d(u,vq) £ Du[vo] ; . 4.3. , Du[vo] £ d(u, vo) u. , , .

4.12 4.7 u, Du[vo] £ d(u, vo).

. T vo v1 vN-1 vi, vj, i < j. C ; j j £ N 1 , i £ j, Dvi[vo] £ d(vi, vo). Dvi[vo] ; Dvi[vo] £ d(vi, vo) .

j = 0: d(vo, vo) = 0, Dvo[vo] = 0 vo, , Dvo[vo]£ d(vo, vo) .

j + 1: i £ j, Dvi[vo]£d(vi, vo), vj+1. vj+1, vi, ..., vo d(vj+1, vo) vj+1 vo, vi vj+1 T, i £ j. , , Dvi[vo]£ d(vi, vo). Dvi[vo] , vi < mydist, vo, Dvi[vo]> , < mydist, vo,d> vj+1 d £ d(vi,vo).

, C vj+1. Dvi[vo] £ d + , i d + £ d(vj+1, vo).

.; Netchange 4.3.3. - 8.2.1.

- . -, "" u . , . -, < mydist,.,. > , , .

vo. (.., ) v O(N |E|) ( O(W) ), .

4.13 0(N2) (N2W) , 0(N2|E|) 0(N2 |E| W) .

, , .

4.3 Netchange

Netchange [Taj77] " ". - , . [Lam82]. .

Nl. (N).

N2. FIFO.

N3. .

N4. .

, . : . u Nbu [v], v u u v. :

Rl. , .

R2. Nbu[v]

(a)    v = u Nbu[v] = local ;

(b)   u v ¹ u Nbu[v] = w, w u u v,

(c)    u v Nbu[v] = udef.

4.3.1

Netchange 4.8 4.9. , , . [Lam82], , . 4.3.3, .

v v. . u d(u, v) Du[v] d(w, v) ndisu[w, v] u. Du[v] ndisu[w, v], ndisu[w,v] .

Du[v] . u = v d(u, v) = 0 Du[v] 0 . u¹ v, u v ( ) u , v,  d(u, v) = 1 + min d(w, v).

wÎ Neigh u

, u ¹v d(u, v) d(w, v), ndisu[w, v]. N , N1 . 蠠 N ; N .

var Neighu : ; (* u *)

Du : ⠠ 0.. N ; (* Du[v] - d(u, v) *)

Nbu : ; (* Nbu[v]- v *)

ndisu : 0.. N ; (*ndisu[w, v] - d(w. v) *)

:

begin forall w Î Neighu , v Î V do ndisu[w, v] := N ,

forall v Î V do

begin Du[v] := N ;

Nbu[v] := udef

end ;

Du[u]:= 0 ; Nbu[u] := local ;

forall w Î Neighu do < mydist, u, 0> w

end

Recompute (v):

begin if v = u

then begin Du[v]:= 0 ; Nbu[v] := local end

else begin (* v *)

d := 1 + min{ ndisu[w, v] : w Î Neighu} ;

if d < N then

begin Du[v] := d ;

Nbu[v] := w with 1 + ndisu[w, v] = d

end

else begin Du[v] := N ; Nbu[v] := udef end

end;

if Du[v] then

forall x Î Neighu do < mydist, v, Du[v]> x

end

4.8 Netchange ( I, u).

v . . u d v (Du[v] = d), < mydist ,v,d>. w, u ndisu[w, v] d. ndisu[w, v] u d(u, v) ndisu . , d' , .

, . ( N3) < fail,. > . u1 u2 , Q u1 u2 u1 u1 Q u2 u1 u2 u1. ( ) < fail, . > . u1 u1 , u1 < fail, u2 > u2 < fail, u1 > . ( ) < repair, . > . u1 u2 u1 < repair, u2 > u2 < repair, u1 > .

w:

{ Qwv}

begin w;

ndisu[w,v] := d ; Recompute (v)

end

uw:

begin < fail, w> ; Neighu := Neighu {w} ,

forall v Î V do Recompute (v)

end

uw:

begin < repair, w> , Neighu := Neighu È {w} ;

forall v Î V do

begin ndisu[w, v] := N;

< mydist, v, Du{[v]> to w

end

end

4.9 ̠ NETCHANGE ( 2, ).

. u w , w Neighu . , , . w' ndisu[w', v]= ndisu[w, v]. ( ) w Neighu, u d(w, v) ( ). w Du[v] v ( u[v]> ). u w, u N d(w,v), .., ndisu[w, v] N.

P(u, w, V)º

up(u, w) Û w Î Neighu (1)

Ù up(u, w) Ù Qwu Þ

d = Du[v] (2)

Ù up(u, w) Ù Qwu Þ

ndisu[w, v] =Dw [v] (3)

L(u, v) º

u = v Þ (Du[v] = 0 Ù Nbu[v] = local) (4)

Ù (u ¹ v)Ù $w Î Neighu : ndisu[w, v] < N - 1)Þ

( Du[v] = 1 + min ndisu[w, v] = 1 + ndisu[Nbu[v], v]) (5)

w Î Neigh u

Ù (u ¹ v Ù "w Î Neighu : ndisu[w, v]³ N1) Þ

(Du[v] = N Ù Nbu[v] = udef) (6)

4.10 P(u, w, v) L(u, v).

Netchange. ; 4.10. P(u, w, v) u w u d(w,v) w d(w, v). up(u, w) () u w . L(u, v) u d(u, v) u, Nbu[v] .

. , ( ). , stable

stable = "u, w : up(u, w) Þ Qwu .

Neighu , .., (1) . .

(1) . , , .

(2) < fail. . > .

(3) .

4.14 uo, wo, vo, P(uo, wo, vo) .

. , .e., , (1) . Øup(uo, wo), (2) (3) . up(uo, wo), ndisuo[wo, vo] = N. wo = vo Dwo[wo] = 0 < mydist, vo, 0> Qw0u0, (2) (3) . wo ¹ vo Dw0[vo]=N , (2) (3) . .

(1). u w. Neigh , (1) . v¹vo P(uo, wo, vo). v = vo, u =uo, w=wo ndisu,[wo, vo] . , < mydist, vo, .> (2), (2) (3) . d = Dw0[vo] (2), (3) (3) . (2) , (2) . v = vo, u = wo ( uo u) (2) (3) Dw0[vo] Recompute(v) wo. , , < mydist, vo, . > uo, (3) , (2) , (2) (3) . < mydist, vo, . > Qw0u0, d = Dw0[vo]. v = vo u¹uo, wo P(uo, wo, vo).

(2). uw . u = uo w = wo (2) (3) . (1) wo Neighu0 . u = wo w = uo. u = wo w¹ uo (2) (3) Dw0 [vo] . < mydist, vo, . > wo (3) (2) , (2) (3) . P(uo, wo, vo).

(3). uw. u = uo w = wo up(vo,wo) , wo Neighu0 ( ) (1). < mydist, vo, Dw0 [vo]> wo (2) (3) , P(uo, wo, vo) . P(uo, wo, vo).

ˆ

4.15 uq vo, L(uo, vo) .

. Du0[uo] = 0 Nbu[uo] = local. vo ¹uo , ndisu[w, vo] = N w Î Neighu, Du0[vo] = N Nbu0[vo] = udef.

(1). u < mydist, v,d> w. u¹ uo v¹ vo L(uo, vo) . u = uo v = vo ndisu[w, vo] , Du0 [vo] Nbu0[vo] L(vo, vo).

(2). uw . u = uo w = uo Neighu0 , Du0[vo] Nbu0[vo] L(uo, vo).

(3). uw . u = uo Neighu0 w, u ndisu0[w, vo] N L(uo, vo).

4.3.2 Netchange

.

4.16 , Nbu[v] :

(1) u = v Nbu[v] = local;

(2) u v¹ u Nbu[v] = w, w u u v;

(3) u v Nbu[v] = udef.

. , stable P(u,w,v) u, v, w, u, v, w

up(u, w) Þ ndisu[w, v] = Dw[v]. (4.2)

L(u, v) u v

ì0 u ¹ v

Du [v] = í 1+ min Dw[v] u¹ v Ù$w Î Neighu : Dw[v] < N -1

îN w ÎNeigh u u¹v Ù"w Î Neighu : Dw[v]³ N -1

(4.3)

Du[v] = d(u, v) u v , Du[v] = N u v .

- d{u, v) u v Du[v]£ d(u, v).

d(u, v) = 0: u = v Du[v] = 0.

d(u, v) = k +1: w Î Neighu d(w, v) = k. Du[v] £ k, (4.3) Du[v] £ k + 1.

Du[v] Du[v] < N u v d(u, v) £ Du[v].

Du[v] = 0: (4.3) Du[v] = 0 u = v, u v, d(u, v) = 0.

Du[v] = k +1 < N : (4.3) w Î Neighu Dw[v] = k. w v d(w, v) £ k, u v d(u, v) < k+ 1.

u v Du[v] = d(u, v), Du[v] = N. , (4.2), "u,v : L(u, v) Nbu[v]. []

, - stable . , g,

ti = ( ) +

( u, v Du[v] = i)

f

f(g) = (to, t1,..., tN)

f(g) (N + l) , ( £l) . (N, £l) - ( 2.5).

4.17 < mydist,.,. > f.

. u Du[v] = d1 < mydist, v, d2> , Du[v] d. d < di + 1.

d < d1: d = d1 + 1 td2 1 ( td1 ), td d > d1 . f .

d = d1: < mydist, ., .> u, f td2 1, .. f .

d > d1: td1 1 ( td2 ), td d > d1 . f .

[]

4.18 , .

. , , , f . f ; . []

4.3.3

, , . stabl ( , ) stabl , . . , , . , stabl - , . , , , , .

. . . [Lam82] . w u .

(1) OQwu , w,

(2) TQwu , ( )

(3) IQwu , u.

, w u OQwu, OQwu TQwu TQwu IQwu, u IQwu. TQwu OQwu TQwu. < fail, w> IQwu, IQwu. P(u, w, v) .

. . Recompute Netchange uw w 1 wuw. N .

( ). .

; u Du[v] v. , , . , -.

4.4

. ( ). . . .

, , . , N; W(N) , . : ; 4.11. "" deg deg ; .

4.11 .

4.4.1

[SK85]. 0 N I, . ZN {0, 1,..., N- 1}. N, .e., (N 1) + 1º 0.

4.19 [a, b) ZN

ì {a, a +1,..., b -1} a

[a,b)= í {0,. . ., b- 1, a,..., N-1} a³b

î

[a, a) = ZN, a ¹ b [a, b) [b, a). [a, b) a < b.

4.20 T .

. v w T[w] T w. w T[w] , 4.12. , w T[w] w T[w] T[w]; T[w] [lw, lw +|T{w]|) (1w w).

[aw, bw) T[w]. w w. w u T[u], .., [au, bu). w T[w], ..,
ZN [aw,bw) = [bw,aw). []

4.12

2 log N . ZN , logN . ; . uw u

ì lw w u,

auw = í

î lu+|T[u]| w u

u degu a1,..., adeg u , a1 < ,...,< adeg u , 4.13. ZN degu , ; . 4.14. ( ) . , (log degu) . i degu, .e., adeg u+1 == a1.

(* d u *)

if d = lu

then

else begin ai, .. d Î [ai, ai+1) ;

ai

end

4.13 ( u).

4.14 ZN .

, . . T , . ; .

, dT(u, v) u v T dG(u, v) u v G. DG G, u v dG(u, v).

4.21 dT(u, v) dG(u, v). .

. G N , G , xy, G. dG(x, y) = 1 dT(x, y) = N-1, N1. . []

, .., wuw = wwu . dG(u, v) = dG(v, u) u v.

4.22 T u v, dT(u, v) £ 2G.

. T wo ( 4.2).

dT(u, v) £ dT(u, wo) + dT(wo,v)

= dT(u, wo)+ dT(v, wo) w

= dG(u, wo)+ dG(v, wo) T

= DG+DG DG

[]

, a ( 4.21), , s ( 4.22).

.

(1)   T

(2) ,( ).

(3) .

4.4.2

[LT87] .

4.23 (ILS)

(1) ZN , ,

(2) , ZN

ILS , 4.13.

4.24 .

G ( 4.25); , , . .

4.25 G .

. , T . . , v u u Î T[v]. ( ),

4.26 .

. ; [Tar72] 6.4. []

, T G.

4.27 ILS G ( T) .

(1) T, .., T[w] [lw, ,lw+|T[w]|). kw = lw+ |T[w]|.

(2) uw u auw.

(a) uw auw = lw

(b) w u ( T) auw = lw

(c) w u auw = ku ku ¹ N u . ( , 0 u (a), ku . N, .. N º0.)

(d) w u, u , ku º N, auw = lw.

ILS 4.15. (2a), 4, 8, 10 (2c), 9 (2d).

ILS . vÎT[u] Û lv Î [lu, ku). u v w ( u) 4.13. lv Î [auw, a) a u, a¹auw u a' Î [auw,, lv).

4.15 .

4.28 lu > lv lw < Iu

. -, auw £ lv. w u auw = lw > lu > lv . uw lw = auw < lv < lu. w u lw < lu . -, auw u, a' £ lv (.., lv ). u 0, ku ( 0£ lv, a' £ lv). ku ; w' auw = lw < ku, w' auw = lw < lu w u , 1w < lu. []

lu < lv. v Î T[u] lv > ku, ku < N u ku.

4.16 V ILS.

4.29 lu v lw £ lv.

. -, v Î T[u]; w' u vÎT[w]. auw = lw' £ lv auw £auw£lv < kw. w u, 1w = auw, lw < lv.

-, lv ³ ku. w u, . ku, ku £ lv. w' u 1w < ku , w' 1w u, w' 1w < lu. w u, lw < lu < lv. []

v . u v u v. lca(u, v) u v,

fv(u) = (-lca(u, v), 1u).

4.30 lu < lv fv(w) < fv(u).

. - v ÎT[u], lca(u, v) = lu. w' u v Î T[w], ( ) 1w £ lw < kw, w ÎT[w'], lca(u, v) ³ lw > lu. fv(w) < fv(u).

-, 1v > ku. , w u, vÏT[u], lca(w, v)= lca(u, v). 1w < lu , fv(w)< fv(u). []

. v 4.16. v u. 4.28, , , , w 1w£lv. w £lv 4.29. v, fv v, 4.30. 4.25. []

: . 4.25 ILS , . ILS , . , N , u v d(u, v) == 2, N 2 u v ( 4.8). ILS . ( 4.34).

4.31 ILS .

ILS .

ILS .

ILS ( ) ( , ). . ILS u lu ¹ 0 0, 0 0 1. , . , .

, , . , ILS , (Ruzecka).

4.1T -

4.32 [Ruz88] G ILS G u v u v 3/2DG .

ILC ILS . 4.7 ILS ILS ( 4.37), ILS .

, ILS. 4.15 ILS ; 4 2 1.

, . , , , . , , [BLT91].

4.18 ILS

4.33

. - 2, 4.17. (0) (6) , , ( ) . x . x 0 6 , 0 6 ZN . , x , . []

, Ta ILS ILS .

: .

. , , .

4.34 [LT87] ILS N .

. 0 N I . i i +1 (i+ [N/2]) mod N, 4.18. i i+1, ..., (i+ [N/2] ) -1 (i + [N/2]), . . . , i 1 , . []

4.19 ILS n x n.

ILS i 4.34 , ; .

4.35 [LT87] ILS n x n .

. , .., i- j- (j - l)n + (i - 1). 0, (j - l)n, (J - l)n + i, j n, 4.19. u v,

1: v u, u ;

2: v u, u ;

3: v u , u ;

4: v u , u .

, u v, . []

ILS 4.35 , ; .

4.36 ILS .

4.37 [FJ88] ILS .

, , .

(1) . 0(deg log N) deg.

(2) . ILC c , O(E) 0(N) ; 6.4.

(3) . , . 4.34 4.37.

. , 104 ( 1.1.5) .

, , ILS :

(1) . ILS . ILS . , () .

(2) . ILS W(N), ; 4.7.

(* A d u *)

if d = lu

then

else begin ai := . ai < d ;

ai

end

4.20 ( u).

4.4.3

, , , Ta [BLT93] . . a . . . ( 4.22.)

⠠ , . S ; S, s , S* S. , . , . , aabb, abba, aab, aabc, aa, aabbc. aabb, aab, aa aabbc, aabb, aabb. 4.20. a

4.38 ( S) G :

(1) S* G;

(2) , .

(PLS) , 4.20.

4.39 .

4.40 G PLS .

. , 4.25, . T G.

4.41 Ҡ PLS G .

(1) s.

(2) w u 1w lu ; .., u1, ..., uk u T 1ui = luai a1, . . . , ak k S.

(3) uw auw = lw

(4) w u auw = lw.

(5)    w u auw= s u : , auw = lw

PLS s, ( ). uw, auw = lw auw = s. u v, v lv < lu.

"" , , 4.20.

4.42 u v u ¹ v u lv.

. u T u s, lv. u v , v ÎT[u] . w u vÎT[w] auw < lv. []

u v w ( u) 4.20.

4.43 u Î T[v] w u.

. auv == s w u . auw = lw , auw v, lwv w v, u.[]

4.44 u v w v, v u.

. w' u v Î T[w'] auw =lw lv. auw ( u) lv, auw< auw < lv, w v u. []

4.45 uÏ T[v], w v dT(w, v) < dT(u, v).

. auw =s w u ; u v u u ÏT[v], v. auw = lw , auw < lv, w v. []

depth T, .., . v 2 - depth . v v depth 4.44. T[v] v depth 4.43, v depth . ( , depth .) v depth 4.45, v depth . ( , 2 depth.) 4.40

[]

4.46 G DG ( ) 2DG .

. PLS 4.22. []

. , depth T, k T. e depth , S ( ) k , depth log A . a deg 0(deg* depth * log k) .

. [BLT93]. .

4.5

- . , , , , . , ,

(1) . N , log N ; , .

(2) . 4.2 4.3, , .

(3) . . .

, , . , , , . 4.5.1, ( ) . , . .

; . [LUST89] . , . [ABNLP90] .

4.5.1

, l l . l , , ( ) N1 . .

, .

4.47 s £ N C1,..., Cm

(1) ,

(2) s ,

(3) 2s.

. D1, ..., Dm Di £ s s . s, . i . s , , 2s. []

, . . , ( ) . , .

4.48 [LT86] For N 0( , .

. ( 4.47) Ci ci d(v, ci) £ 2s v Î Ci Ci 2s. T G ci. T m , m-2 ( 2); 4.9. T ( ci), , .

ci ( ), T cj ( ), Cj ( ). , . T , . T . , 2s. 2m - 2 + 2s, 2N/s - 2+ 2s. s 0( []

4.48 , . T , T .

4.49 [LT86) N s f £ log N O(f N1/f) , 2f + 1 .

. 4.48, s T ( s). , < 2m T , .

f . G N . N/s N/s , .., N.(2/s) . i mi , i +1 mi/s mi/s , .., mi.(2/s) . f mf = N.(2/s)f .

, f 2f+1 . 2mf , s , 2mf + fs. s 2N1/f mf = O(1),

f s = O(f N1/f). []

logN O(logN) .

4

4.1

4.1 . ? .

4.2

4.2

< nys, w > 4.6; Tw, . ? ?

4.3 - vo ( 4.7).

"u, w : o,d> Î Mwu Þ d(w, vo) £ d

Ù" u : d(u, vo) £ Du[vo]

.

4.3

4.4 Netchange :

, A F. F A ? A F?

4.4

4.5 4.22 .

4.6 ILS ? ? ?

4.7 G T G G N = n2 , G T 0(n), u v u v N 1 ILS . ( G , ( 4.37) G ILS.)

4.8 ILS N . u v d(u, v) = 2, N 2 u v.

4.5

4.9 T 4.48 m . m m 2 .

INCLUDETEXT "E:\DISTR\(5)Vodovoz.doc" 5

(), , . . , , , , 5.1. B, . s t B v, v u B s. u v , , , , t u .

, , , , . ( .) - . , , , , , . OSI ( 1.2.2).

Figure 5.1 .

, , .

, ( 5.2) , , . , . , ( 5.3) ; , , , . 5.1, 5.4.

5.1

, G = (V, E); . B . B, b, c, bu, .., .

, .

. u "" p ( , ) u. u p.

. p u w ( , ). , p . , , , , , .., , .

, , , 2.7. , - , 2.6, , , . u p w, , . w , , . , , u, . , , , u p, u , w p. 2.6, .

(3) . p, , . , .

P , . (. 4); , . k - P. , k G; k , , k , .

, , , ( , u , u w , w). , .

(1) ( ) .

(2) , , .

(3) , .., , u, , u .

(. 5.2), - . 2, Zu u, M - ().

5.1 G = (V, E)- con={Genu, Foru}uÎ V , Genu Í Zu ´ M Foru Í Zu ´ M. cu Î Zu - u, , p Î M, (cu, p) Î Genu.

con p u, u - cu, , (cu, p) Î Genu, p u w , (cw, p) Î Forw. , ( ) . con - , con.

, .

5.2 G, con G, g G, p ( g) , con, g, p . , .

5.1, . , . - , .

5.3 , .

5.2

, , , , Merlin Schweitzer [MS80a]. , ( ) . p0, ..., ps -1 , , i, pi , pi+1 ( modulo s). ( ). 5.2.1 , . 5.2.2 , .

5.2.1

G B.

5.4 ( G, B) - BG , .., BG = (B,

(1) BG - ( );

(2) bc Î , b c - , , G;

(3) P Î P BG, (. )-P.

BG G;
b0, b1, ..., bs - BG, , u- , bi, u0, u1,..., us - , i < s uiui+1 Î E, ui = ui+1. G, , b0, b1,..., bs BG.

; , BG, .., , .

5.5 p - u v. b u p, BG b c v, - , p G.

BG nb(p, b) . p u fb(p) u.

fb nb - (first buffer) (next buffer). , nb(p, b) p. , , nb(p, b) , , b. "" BG, .., , .

. BG bgcBG , nb(p, b) / , p.

5.6 bgcBG .

p u , fb(p) . .

p u w ( u = w) , nb(p, b) ( w) . , p nb(p, b).

Theorem 5.7 bgcBG - .

. , , , bgcBG - .

b Î B, b BG , b. , BG ( , ) , .., nb(p, b) , b.

.. .. , bgcBG . " " , r . R - .

r = R: b u, , BG. , , b - , u , b. , R .

r < R: , r' , r < r' £ R, r' ( ).
g - p b r < R u. u - p, p , , . , nb(p, b) = c - b, , r' c r. , c , d, g, c - . d p c, , , p d '. , p g .

, "" ( ), , . . , , . p b1 u nb(p, b1) w . b2 u, p; , nb(p, b2) w . , b2 nb(p, b2).

, , (destination scheme) -- (hops-so-far scheme).

. N u, bu[v] v. v bu[v]. , v Tv , v. ( ; , , v, G.)

BGd = (B, bu[v1]bw[v2] Î , v1 = v2 uw - Tv1. , BGd - , , , , v , Tv. P Î P v - Tv, BGd v, - P. . , p v, u, fb(p) = bu[v], , w, nb(p,b) = bw[v].

5.8 dest bgcBG , fb nb .

Theorem 5.9 , N .

. dest - , . ð

, , , . , P , , 5.2. u1 v
á u1, w1, u2, . . ., v ñ, u2 v

á u2, w2, u1, . . ., v ñ.

5.2 , dest.

P ; , v á u1, w1, u2, w2, u1,v ñ. . 5.2.

dest , - , N.

--. u k +1
bu[0], . . ., bu[k]. , , , .

BGh = (B, bu[i] bw[j] Î , uw Î E. , BGh , , BGh. .. P k , ; P = u0, . .., ul (l£ k), bu0[0],bu1 [1],..., bul[l]- BGh P. : fb(p) = bu[0] ( p, u)

(p, bu[i]) = bw[i +1] , u w.

5.10 hsf bgcBGh , fb nb .

Theorem 5.11 , D + 1 ( D - ), , .

. k = D. hsf - , D +1 . ( , , , .) ð

-- i , i . -- ( hops-to-go), i , i ; . 5.3.

5.2.2 G

, ,. hsf , , . ( ), ( ) , , . , , , .

5.3 .

5.12 G - , G; . 5.3.

G1, ..., GB G B P , P Î P B P1, ..., PB, Pi - Gi.

B, , B . bu[l] u. bu[i], w bw [i], u w w Gi , bw[i + 1], u Gi.

5.13 P B , , B .

. G1. . .., GB - , bu[1], ..., bu[B] - u. uw Î , uw w Gi, wu Î , uw u Gi. BGa = (B, bu[i]bw[j] Î , uw Î E (i = j / uw Î (i + 1 = j / wu Î , , , , , . i , Gi.

(. 5.4) , P Î P P, :

acoc = bgcBGa - , B , . ð

. . , . , , .., wuw =wwu.

5.14 , .

. 5.13 3 , .

. u v, dc(u, v) u v da(u, v) - ; dc(v, u) = da(u, v) d(u, v) = min(dc(u, v), da(u, v)) . C ( ) dc(u, v) + da(u, v) = C u, v, d(u, v)£ C/2.

5.4 .

- , u v d(u, v) = C/2. G1 G3 v, G2 u: . 5.4.

u v G1 G3, v u G2. x, y - , u, v. , ..
d(x, y) £ C/2, P x y, u, v. P u, v , G1 , G2. P v , G1 G2; P u, G2 G3.

u, v d(u, v) = C/2, , d(u, v) C /2. , x, y , , d(x, y) C /2, d(u, v). ð

. , , .

5.15 , .

. 5.13, , . r, T1 r T2 r; . 5.5.

5.5 .

u v - u , T1, v, T2. ð

5.3

, Toueg Ullman [TU81]. , .

5.3.1

(forward-count controller). ( p) sp - , ; 0 £ sp £ k . sp , .. ; . Netchange 4.3. u, fu u. , 0 £ fu£ B .

5.16 FC (Forward-count) p u , sp < fu.

, , , .

5.17 B > k, FC - .

. , , , u , fu = B. k , B > k , .

FC : g - . d , g . d , , .. g - , , . p - d , .., sp - d.

u - , p. .. u p ( p ), w u , p. . . FC,

sp-1³ fw

sp£ k k < B , fu < B, , w ( d ). w, q , w, f'w w q w. .. q f'w ( q) , w q w,

f'w £ fw +1

q w sq < f'w, , ,

sq < f'w £ fw +1£ sp,

p. ÿ

(backward-count controller). , " " FC , , , , , . , p, tp - , . , 0 £ tp < k .

5.18 BC (Backward-Count) p u , tp > kfu.

, BC - ( 5.6) 5.17.

5.3.2

, , , , .

(forward-state controller). sp . u ( u) j - p u sp = s.

5.19 FS (Forward-State) p u ,

5.20 B > k, FS - .

. , . , g, d , . d. p sp, u -, p w - , p . - w d.

w , w p, . , w ; w, q - , , .., sq = min{s : js > 0}. , sq < sp, . w, r - , w , , sq £ sr . - w r. r

w, r w. w, , w , r ( r).

,

, i = sq,

, p w, ..,

sp>sp-1

. ð

(backward-state controller.) , "" FS, , BC, . tp , it u , t .

5.21 BS (Backward-State) p u ,

, BS 5.20.

. , , , :

5.22 , FC FS.

. , p u FC. i£ sp , FS . D

[TU81] , FC , BC. FS - , BS, BS , BC. , , .

5.4

, , , . , . ; . , . , , .., " " , , 5.2.

fb (p) nb (p, b) . , ; , ( ) , , . , , , .

, : . , , . 5.3 Bodlaender; . [Bod86].

5.4.1

. , , . , , , ; , .

, . Dest, , P , - . , , .

dest. , . , , , . , , .

, . , , k . k , , k , . , k , --, - . , , k - . , , , .

. , . , ; , 3.2.

3.2 , m. m0 , p k =m /m0 , .

5.4.2

. , 5.1 , - . , , , Merlin Schweitzer [MS80b], . Merlin Schweitzer , : , , , , , .

, p q, , , . - (q) (p), 5.1, .

, : . , .

, , () . ( 3.2, , inp , .) ( 5.1), , , , .

, . , - . , . , , , .

, , , . , , . , .

, , , , . .

, , , . ( 3.1, outp .) , .

, .

5.4.3 (livelock)

( 5.2) , , . .. , , , , 5.6. , u v , , w , u. s t, , , w , , w t. , , s . .

, , , .

5.23 , con, g, p (), , g, p . g - , .

5.6 .

, , .

; .

. , 5.2 - - , . Fl F2 - F3 - .

Fl. p , , fb (p) , p.

F2. g p u w, , g, nb (p, b) , p.

F3. p g, , g, p.

5.24 F2 F3 bgc, .

. . 5.7, R - . , , bgc, .

r = R: R , , , . , F3, , , , . , .

r < R: g - , b r < R p. p , , b F3. , p nb(p, b) r' > r. , , g, . ( F2), p , , g, b .

5.25 F1, F2 F3 , , , .

. 5.24 . ( Fl) , , . F2 , . ð

, , . , , , , , .

. 5.3 , -. , . Toueg [TouSOb] ( FC) FS ( ), -.

5

5.1

5.1 , , .

5.2

5.2 , dest , 5.2.

5.3 ( --) fb nb , bu[i] , i . bu [i] ? ?

5.4 , BGa ( 5.13)- , .., P Î P P. , , , fb nb BGa.

5.5 , , , . ( 4.4.2)? ?

5.3

5.6 , BC BS - .

5.7 , , BC, FC.

INCLUDETEXT "E:\DISTR\(6-7)Ivanova.doc" 2

6

. - broadcasting (, ), , , , . , , . , , ( 7), ( 8), , .

, , , . ( 6.1.1) ( 6.1.2). , , , .. , , ( 6.1.3-5). 6.2 . 6.3 ; , . 6.4 .

, , . -, , .. . -, , . . [Tel91b, 4.2], .

6.1

, , ( ), ( ) ( ). P, - E. , , . ( ) , . ; . 6.1.

6.1.1

2, , . - , (-) p; . 2.20. C |C|, , p, Cp. , , decide ( ); decide. , .

6.1 - , :

a)    . :

" C : |C| < ¥

b)    . decide:

" C : $ e Î C : e - decide.

c)     . decide - :

" C : " e Î C : ( e - decide Þ " q Î P $ f Î C: f p e).

. , , , -, . , , .. , . - . - , - - .

, . , ; . 6.19.

1)    . , , , . , - . 6.20, .

2)    . , , , ..; . 2.4.1 B.2.

3)    . ; . 2.4.4. :

(a) . .

(b) . .

(c) (sense of direction). . B.3.

4)    . . , decide, ; , - . ( 6.2.2) .

5)    . , , (message complexity), (bit complexity) , ( 6.4). . 2.4.5.

, , , . , - : , . 6.9, 6.11, 6.12 6.18 . 6.15 6.16/6.17 ; , 1-2 .

.[AK1]  ; , . , , , .

, : , ; . 6.3.

6.1.2

, , .

. -, .

6.2 e Î C p f Cp , f p e.

. f e, .. , f p e f¢ p f. f , . , p, f, . , , f - p, p f. - - , , f. , p .

, - , .

6.3 C - p; - q fatherq - q, q . T = (P, ET), E= {qr: q ¹ p & r = father} - , p.

. .. T 1, , T . , .. eq - q, , qr Î ET , ep eq, p - .

f (3) 6.1 q, , decide.

6.4 C - , dÎ C - decide p.

" q ¹ p: $ f Î Cq: ( f p dp & f - send)

. .. C - , f ÎCq, dp; f Cq, dp. , f - send, , ( 2.20) , ( )

f = e0, e1, ..., ek = dp,

, i < k, ei ei+1 - , send-receive. .. f - q, dp, e1 , q, f - send.

.6.1 .

. 6.4 , , , N-1. decide ( ), N , |E| .

6.5 C - p, decide dp p. C N .

. 6.2 C p, , , 6.4, , p send. 6.4 send , N.

6.6 A - . A |E| .

. , A C, |E| ; xy, C ; . .6.1. G¢, z x y. .. , x y G¢ G. G. , C , G¢, decide z.

7 ; . 7.14 7.16.

6.1.3

, . (PIF - propagation of information with feedback) [Seg83]. , M ( ), , .. M. ; .. notify, M. .

PIF- decide.

6.7 PIF- .

. P - PIF-. P (decide). P dp, q, 2.21 2.23 , P, , q - , .

, 2.21 ; . 6.1.

6.8 PIF-.

. A - . A PIF-, , M, () A. M A. , A M , , , .. M. decide ; , , M, decide notify PIF-.

PIF- , A A, 6.1.1, . M , . w - M, A w*|E|.

6.1.4

, . (SYN) [Fin79]. q aq, bp, aq , - bp. .

SYN- bp decide.

6.9 SYN- .

. S - SYN-. S bp (decide). S bp, aq, ( 2.21 2.23) S, bp aq.

6.10 SYN-.

. A - . A SYN-, , q aq , q A A. bp decide p. 6.4, decide aq q.

SYN- , A, A, 6.1.1.

6.1.5

, . , , .

(X, £) - , c a b, c £ a, c £ b, " d : ( d £ a & d £ b Þ d £ c). , X , ; a Ù b. .. Ù - , (a Ù b = b Ù a) (.. a Ù (b Ù c) = (a Ù b) Ù c), :

inf { j1, ..., j k} = j1 Ù ... Ù j k .

. q jq, X. , inf {j: q Î P} , . out .

write, out, INF- decide.

6.11 INF- .

. I - INF-. , C I ¡, p J outp write q. ¡¢, ¡ , q jq¢, , jq¢ < J. q write p C, C, write, , ¡¢. p J, C.

6.12 .

. , A. q vq, jq. . , q , vq . , q v, vq vÙ v. p decide, vp outp.

, . J, .. J = inf { jq: q Î P}. a q v(a) vq a. .. vq jq, , v(a) £ jq a q. v , a b, a p b Þ v(a) ³ v(b). , .. v , J £ v . , d - decide p, v(d) J £ v(d) , .. d q, v(d) £ jq q. , J = v(d).

INF- A, , A X. , , [Tel91b, 4.1.1.2].

6.13 ( ) * - X, :

(1) , .. a * b = b * a,

(2) , .. (a * b) * c = a * (b * c),

(3) , .. a * a = a

£ X , * - .

, - , , , .

6.14 &, Ú, min, max, , , Ç È , , .

, , , 6.5.2.

6.2

. p.

6.2.1

. , . , p Nextp , , , .

; ( ) , , ; . 6.2.

:

begin send to Nextp; receive ; decide end

-:

begin receive ; send to Nextp end

6.2 .

6.15 ( 6.2) .

. p0. , N .

. p0 , .. send . , , . , , p0, (.. , ), . , (1) p0 , (2) p, , Nextp , (3) p ¹ p0, , . Next , . .. p0 , p0 decide.

p ¹ p0 p0, , .

6.2.2

. , . , . . , ( ), . , ; . 6.3.

var recp[q] for each q Î Neighp : boolean init false ;

(* recp[q] = true, p q *)

begin while # {q : recp[q] is false} > 1 do

begin receive from q ; recp[q] := true end ;

(* q0, recp[q0] = false *)

send to q0 with recp[q0] is false ;

x : receive from q0 ; recp[q0] := true ;

decide

(* :

forall q Î Neighp, q ¹ q0 do send to q *)

end

6.3 .

, , . fpq - , p q, gpq - , q p. Tpq , p pq ( p pq); . .6.4.

, (. .6.4)

Tpq = 蠠 P =

. 6.4 Tpq.

forall 6.3 ; .

6.16 ( 6.3) .

. .. , N . , ¡ ; , ¡ decide.

F - rec false ¡, K - , ¡. .. ¡ ( ¡ ), F = (2N-2) - K; rec 2N-2, K true.

, ¡ . N-K , ¡, rec, false; , , ¡ - . K , ¡, rec, false; , , ¡ - . , F ³ 2(N-K) + K, (2N-2) - K ³ 2(N-K) + K , -2 ³ 0; , , ¡ . . 6.5.

, , . fpq - , p q, gpq - , q p. , , " s Î Tpq $ e Î Cs: e p gpq.

, , gpq. , gpq fpq ( p), p , r Î Neighp r ¹ q, grp fpq. , r s Î Trp e Î Cs, e p grp, , e p gpq.

dp p grp r Î Neighp, , " s Î P $ e Î C: e p dp.

(, . .6.4) . 6.3 , ; , x, . forall ( 6.3), . 2N-2 .

6.2.3 -

- - . [Chang; Cha82] - . , , [Segall; Seg83].

, , 6.3. . 6.5.

. - , , . - , (father). , .

var recp : integer init 0 ; (* *)

fatherp : P init udef ;

:

begin forall q Î Neighp do send to q ;

while recp < # Neighp do

begin receive ; recp := recp + 1 end ;

decide

end ;

-:

begin receive from neighbor q ; fatherp := q ; recp := recp + 1 ;

forall q Î Neighp, q ¹ fatherp do send to q ;

while recp < # Neighp do

begin receive ; recp := recp + 1 end ;

send to fatherp

end

6.5 -.

6.17 - ( 6.5) .

. .. , , , . ¡ - , C p0.

( 6.3) T = (P,ET), pq Î ET Û fatherp = q. , , , , ( 6.3 , T - , , , ). , , C, , , ( - -). , C C. , fatherp ¹ udef p ¹ p0. T , , 6.3.

p0; Tp p. , T, (frond edges). ¡ p, , , fatherp, , C . fp - , p ( C ), gp - , p p ( ). ,

(1) p p ¹ p0;

(2) Î Tp e Î Cs , e p gp.

.

p - . p C (.. - ). , p , , .. ¡ - , . Tp p, , , fp p gp.

p - . p C . , C fp¢ p¢ p, , .. ¡ - , C gp¢. , p , , .. ¡ - , . Tp Tp¢ p p. , , gp.

, , p0 decide, .

, 6.5, . (, - (Merlin-Segall) , v0; . 4.2.3. -). ( p0) , , . , , . , , , ( -). , .

6.2.4

. , . , 6.6, .

6.18 ( 6.6) .

. , . , , N-1 . , , , .

, .

var recp : integer init 0 ; (* *)

:

begin forall q Î Neighp do send to q ;

while recp < # Neighp do

begin receive ; recp := recp + 1 end ;

decide

end ;

-:

begin receive from q ; send to q end

6.6 .

6.2.5

, . [Tel91b, 4.2.3]. .

, , D. ( ), D D¢ > D. , ; , (, N-1). D¢. [Peleg; Pel90] , , .

. , . , p (, p) (, p ). p Inp, - Outp.

D . , i , (i+1)- ; . 6.7.

cons D : integer = ;

var recp[q] : 0..D init 0, q Î Inp ;

(* , q *)

Sentp : 0..D init 0 ;

(* , *)

begin if p - then

begin forall r Î Outp do send to r ;

Sentp := Sentp + 1

end ;

while minq Recp[q] < D do

begin receive ( q0) ;

Recp[q0] := Recp[q0] + 1 ;

if minq Recp[q] ³ Sentp and Sentp < D then

begin forall r Î Outp do send to r ;

Sentp := Sentp + 1

end

end ;

decide

end

6.7 .

, , D ( , D ). pq, fpq(i) - i- , p q, gpq(i) - i- , q p. p q FIFO, fpq(i) p gpq(i) . fpq(i)  gpq(i) , FIFO, .

6.19 fpq(i) p gpq(i) , FIFO.

. mh : fpq(mh) - , gpq(h), .. h- q mh- p. fpq(mh) p gpq(h).

.. C , mh , , m1, ..., mi i. j £ i , mj ³ i. fpq(i) p fpq(mj) p gpq(j) p gpq(i).

6.20 ( 6.7) .

. .. D , . ¡ - C , , C , , ( ).

, ¡ , , . .. ¡ , qp Recp[q] = Sentpq. , .. , , Recp[q] > 0 Þ Sentp > 0. , p0, Sentp0 > 0, , Sentp > 0 p.

, . p - Sent ¡, .. q Sentq ³ Sentp ¡. , , q - p, Recp[q] = Sentq , minq Recp[q] ³ Sentp. , Sentp = D; p , . , Sentp = D p, Recp[q] = D qp, , .

, . P = p0, p1, ..., pl (l £ D) - , , 6.19,

0 £ i < l , ,

0 £ i < l - 1. , 0, p1, ..., pl = p D. , q l £ D r p, , p.

D , , |E|*D. , |E| . , , 2|E|*D.

var recp : 0..N - 1 init 0 ;

(* *)

Sentp : 0..1 init 0 ;

(* , *)

begin if p - then

begin forall r Î Neighp do send to r ;

Sentp := Sentp + 1

end ;

while Recp < # Neighp do

begin receive ;

Recp := Recp + 1 ;

if Sentp = 0 then

begin forall r Î Neighp do send to r ;

Sentp := Sentp + 1

end

end ;

decide

end

6.8 .

. , 1; , , ; . 6.8. N(N-1) O(log N) .

6.2.6

[Fin79] - , . , , . , .

p , Incp NIncp. , Incp - q , q p, NIncp - q , r q r p. . Incp = {p}, NIncp = Æ. , , p , Incp NIncp. p , Inc NInc, p. p , p NIncp. , p ; . 6.9. , q , q dp, : r q r dp, .

, p, , .

6.21 ( 6.9) .

. , , , . .. 1 , , 2N , 2N*|E|.

C - , , ¡ - . , 6.20, p ( ), q - p , q . , ( ).

var Incp : set of processes init {p} ;

NIncp : set of processes init Æ ;

recp[q] : boolean for q Î Inp init false ;

(* , p q *)

begin if p - then

forall r Î Outp do send p, NIncp> to r ;

while Incp ¹ NIncp do

begin receive from q0 ;

Incp := Incp È Inc ; NIncp := NIncp È NInc ;

recp[q0] := true ;

if "q Î Inp : recp[q] then NIncp := NIncp È {p} ;

if Incp NIncp then

forall r Î Outp do send p, NIncp> to r

end ;

decide

end

6.9 .

, ¡ . -, pq, Incp Í Incq ¡. , Incp p p, NIncp>, q Incq := Incq È Incp. , Incp = Incq p q. .. p Î Incp Inc , p Incp = P.

-, , NIncp = Nincq p q. .. , p : " q Î Inp : recp[q], , p : p Î NIncp. NInc , , NIncp = P p. Incp = P NIncp = P , Incp = NIncp, , p ¡ .

, dp p . e p Inc(e) (, , NInc(e)) Incp (NIncp) e ( 6.12). .

6.22 e Î Cq : e p f, q Î Inc(f).

. 6.12, , e p f Þ Inc(e) Í Inc(f), e Î Cq Þ q Î Inc(e), .

6.23 q Î NInc(f), r Î Inq e Î Cr : e p f.

. aq - q, q NIncq := NIncq È {q}. aq - q Î NInc(aq), a¢, q Î NInc(a¢); , q Î NInc(f) Þ aq p f.

, r Î Inq e Î Cr, aq. .

p Incp = NIncp; , Inc(dp) = NInc(dp).

(1) Î Inc(dp) ;

(2) Î Inc(dp) , q Î NInc(dp), , Inq Í Inc(dp).

: Inc(dp) = P.

6.3

, , , , , .

6.24 , .

(1) , , .

(2) , , , .

, . , .

(3) , , .

, . , , , (), , , . 7.4 , , x .

6.25 f- ( ),

(1) ( );

(2) f(x) min (N, x+1) .

( 6.2) , , x+1 x ( x < N), N , x- .

6.3.1

; 6.6, . , ; . 6.10.

var recp : integer init 0 ; (* *)

:

(* Neighp = {q1, q2, .., qN-1} *)

begin while recp < # Neighp do

begin send to qrecp+1 ;

receive ; recp := recp + 1

end ;

decide

end

-:

begin receive from q ; send to q end

6.10 .

6.26 ( 6.10) 2x- .

. , , , . (2x-1)- - qx, (2x)- - . , 2x , x+1 p, q1, ..., qx.

6.3.2

n´n G = (V,E),

V = Zn ´ Zn = { (i, j) : 0 £ i, j < n}

E = {(i, j)(i¢, j¢) : (i = i¢ & j = j¢ 1) Ú (i = i¢ 1 & j = j¢) };

. B.2.4. ( n.) , (. B.3), .. (i, j) (i, j+1) Up, (i, j-1) - Down, (i+1, j) - Right, (i-1, j) - Left. (i, j) , , ; .

( ):

send to Up

:

begin if k=n2 then decide

else if n|k then send to Up

else send to Right

end

6.11 .

, .. ( ) 6.11. k- , n|k (k n), .

6.27 ( 6.11) x- .

. , , n2 . p q U R , p = q , (n|U & n|R). p0 , pk - , .

n2 n - , n2-n - . .. n, n2-n n, pn2  = p0, , .

, p0 pn-1 ; .. n2 , , . , pa = pb 0 £ a < b < n2. pa pb , .. pa = pb, n. , , ,

# {k : a £ k < b & n|k} n,

# {k : a £ k < b & n |k} n.

b-a, , n|(b-a). (b-a) = l*n, {k: a £ k < b} l n. , n|l, n2|(b-a), .

.. p0 pn-1 , x x+1 .

6.3.3

N- G = (V,E),

V = { (b0,...,bn-1) : bi = 0, 1}

E = { (b0,...,bn-1),(c0,...,cn-1) : b c 1 };

. B.2.5. , (. B.3), .. b c, b c i, i . , ; .

, , 6.12. 6.11.

( ):

send n -1

:

begin if k=2n then decide

else begin l - : 2l|k ;

send l

end

end

6.12 .

6.28 ( 6.12) x- .

. , 2n . p0 - , pk - , . k < 2n, pk pk+1 1 , l(k), :

.. i < n k Î {0, ..., 2n} l(k) = i, p0 = p2n . 6.27, , pa = pb , 2n|(b-a), , p0, ..., p2n-1 .

, , , , x x+1 .

6.3.4

1895 [Tarry; T1895]. ; . 6.13.

R1. .

R2. - (, ), , R1.

var usedp[q] : boolean init false q Î Neighp ;

(* , p q *)

fatherp : process init udef ;

( ):

begin fatherp := p ; q Î Neighp ;

usedp[q] := true ; send to q ;

end

q0:

begin if fatherp = udef then fatherp := q0 ;

if "q Î Neighp : usedp[q]

then decide

else if $q Î Neighp : (q ¹ fatherp & Øusedp[q])

then begin q Î Neighp {fatherp} Øusedp[q] ;

usedp[q] := true ; send to q

end

else begin usedp[fatherp] := true ;

send to fatherp

end

end

6.13 .

6.29 ( 6.13) .

. .. , 2|E| . .. , . , - p, , p , . , , p, , p, , 1. , p , . , .

, 3 , , .

(1) , , . , . , ; .. , .

(2) p , p . , , p , , , (1) p . p, , fatherp , , p . , p , ; , .. , p , , .. p . .

(3) . , p q , p , q . , p . , (2), .

, 6.3. , - p fatherp. , ( ), . , fatherp .

6.4 :

, , . , : , . - , . T G p T[p] p, A[p] p, .. T p. , q Î T[p] Û p Î A[q].

6.30 T G , pq q Î T[p] Ú q Î A[p].

, DFS- (DFS - Depth-First Search), , , , (. 4.4.2). 6.4.1 , ( , ) . . 6.4.2 , , . . 6.4.3 . 6.6 , , 2N-2 .

. , . .

6.31 - , :

T1. .

T2. - .

6.19. , , . 6.5.3.

6.32 .

. , .

6.4.1

, , ; . 6.14.

R3. , , R1 R2.

6.33 ( 6.14) , 2|E| 2|E| .

. .. , T. , ( ), , , 2|E| , . , R3 , - .

-, R3 , , . pq - p . q p, q ( q fatherq p ) usedp[q] = false (.. p ). , R3, q p.

, pq - , p, q Î A[p]. , , pq. .. pq - , q , q :

..., q, ..., p, q

, r1, r2, r1, r1r2 - , r1. , , , - T, , pq. q p, , q fatherq , qp, R2 .

var usedp[q] : boolean init false q Î Neighp ;

(* , p q *)

fatherp : process init udef ;

( ):

begin fatherp := p ; q Î Neighp ;

usedp[q] := true ; send to q ;

end

q0:

begin if fatherp = udef then fatherp := q0 ;

if "q Î Neighp : usedp[q]

then decide

else if $q Î Neighp : (q ¹ fatherp & Øusedp[q])

then begin if fatherp ¹ q0 & Øusedp[q0]

then q := q0

else q Î Neighp {fatherp}

Øusedp[q] ;

usedp[q] := true ; send to q

end

else begin usedp[fatherp] := true ;

send to fatherp

end

end

6.14 .

2|E|, 6.6 ( 2), . 2|E|, 6.32, . Cheung [Che83].

6.4.2 , O(N) . , . 6.4.3 O(N).

6.4.2

, , , , . - , 6.33. , . , , .. N-1 .

. , . [Awerbuch; Awe85b] , , , , . , , , .

p ( ), p r, , . , p . , r p , p , , p . r, r p, p ; . 6.15.

- usedp[fatherp] = true, p . , ; - p, usedp[q] = true q, .

6.34 ( 6.15) 4N-2 4|E| .

. , , 6.14, , . .. fatherp p, , 6.14.

N-1 , 2N-2 . , , - /, 2 .

. , ( ), ( ). , 4|E| .

var usedp[q] : boolean init false q Î Neighp ;

(* , p q *)

fatherp : process init udef ;

( ):

begin fatherp := p ; q Î Neighp ;

forall r Î Neighp do send to r ;

forall r Î Neighp do receive from r ;

usedp[q] := true ; send to q ;

end

q0:

begin if fatherp = udef then

begin fatherp := q0 ;

forall r Î Neighp {fatherp} do send to r ;

forall r Î Neighp {fatherp} do receive from r ;

end ;

if p - and "q Î Neighp : usedp[q]

then decide

else if $q Î Neighp : (q ¹ fatherp & Øusedp[q])

then begin if fatherp ¹ q0 & Øusedp[q0]

then q := q0

else q Î Neighp {fatherp}

Øusedp[q] ;

usedp[q] := true ; send to q

end

else begin usedp[fatherp] := true ;

send to fatherp

end

end

q0:

begin usedp[q0] := true ; send to q0 end

6.15 .

, , . ( 6.15) , , 2N-2 .

. [Cidon; Cid88] , . , .. 2 , . . [Lakshmanan; LMT87]. . p r. r, , r , p r. r p, . (, .)

p ( mrsp), . , p mrsp. , , p , , r; , p rp, , r . r p p, .. r mrsr. r , p; r ; . 6.16/6.17.

6.35 ( 6.16/6.17) DFS- 2N-2 , 4|E| .

. 6.14. ( 6.15), . , , , , .

. p t, t q p , , , t+1. , p t+1, t+1 p , . .. 2N-2 , 2N-2 .

, 4|E|.

var usedp[q] : boolean init false q Î Neighp ;

fatherp : process init udef ;

mrsp : process init udef ;

( ):

begin fatherp := p ; q Î Neighp ;

forall r Î Neighp do send to r ;

usedp[q] := true ; mrsp := q ; send to q ;

end

q0:

begin usedp[q0] := true ;

if q0 = mrsp then (* , *)

end

6.16 ( 1).

q0:

begin if mrsp ¹ udef and mrsp ¹ q0

(* , *)

then usedp[q0] := true

else (* , *)

begin if fatherp = udef then

begin fatherp := q0 ;

forall r Î Neighp {fatherp}

do send to r ;

end ;

if p - and "q Î Neighp : usedp[q]

then decide

else if $q Î Neighp : (q ¹ fatherp & Øusedp[q])

then begin if fatherp ¹ q0 & Øusedp[q0]

then q := q0

else q Î Neighp {fatherp}

Øusedp[q] ;

usedp[q] := true ; mrsp := q ;

send to q

end

else begin usedp[fatherp] := true ;

send to fatherp

end

end

end

6.17 ( 2).

, . , , . , , .

, , ( ), 6.15, . , , . , DFS-, , .. 2|E|, O(N) .

6.4.3

, , . p, L, L. usedp[q] , .. p q, q Î L; . 6.18.

6.36 DFS- , 2N-2 2N-2 .

; w - , , L Nw ; . 6.14.

var fatherp : process init udef ;

( ):

begin fatherp := p ; q Î Neighp ;

send to q

end

q0:

begin if fatherp = udef then fatherp := q0 ;

if $q Î Neighp L

then begin q Î Neighp L ;

send < tlist, LÈ{p} > to q

end

else if p -

then decide

else send < tlist, LÈ{p} > to fatherp

end

6.18 .

6.5

6.5.1

6.19 , . ; C/D , (C) (D); T , ; ; . N - , |E| - , D - ( ).

C/D

T

6.2:

6.2

C

N

N

6.3

D

N

O(D)

-

6.5

C

2|E|

O(N)

6.6

C

2N-2

2

6.7

D

2D|E|

2D

6.8

D

N(N-1)

2

6.9

D

£4N|E|

O(D)

6.3:

6.10

C

2N-2

2N-2

6.11

C

N

N

6.12

C

N

N

6.13

C

2|E|

2|E|

6.4:

6.14

C

2|E|

2|E|

6.15

C

4|E|

4N-2

6.16/6.17

C

4|E|

2N-2

6.18

C

2N-2

2N-2

: (6.7) (6.9) .

6.19 .

, . 6.20 , . , ( B.3).

C/D

C

N

6.2

D

O(N logN)

7.7

C

2|E|

6.5

D

O(N logN + |E|)

7.3

C

2(N-1)

6.5

D

O(N)

6.3

6.20 .

6.5.2

6.1.5 , . , , , , , . (. 6.14). , - , .. . ( 1, , 0 ), , , .

, , . , , , , .

. , , 6.12 . . , (anonymous) , , ( D=2). , , (anonymous) . , .6.21. , 1, 6 8 - . , 9, , , , . 9.7.

.6.21 .

. A - , . p jp, p. s. , p , p :

s := s + jp ; jp := 0

, p jp = 0 s . , , s .

. dp p p, p. , . , , q , . , , . .

, - . , Tpq , p q. , , , , . , q p q. p , , p . - T, ; . 6.15.

. , . . , (p, jp); , . , , , ; S = {(p, jp): p Î P} - p Sp = {(p, jp)}, . .

, . S, N*w , w ; . 6.16.

6.5.3

. 6.31, .

, . , , , .

6.37 (one-time complexity) - .

O1. .

O2. - .

6.31 , O1 T1. .. , T2, , O2, , . , T2 , O2, , , T2 , O2. , , T2, , . -.

, : . , O1 O2, T1 T2 . , O1 O2 6.31 .

6.38 - O(D). - Q(N), 1.

. O1 O2. d d d T. ( d.) DT - T; DT £ D d T (2DT + 1) - d . ( d.) , 2DT + 1 .

T1 T2. d d . ( d.) , F , F £ D. DT ( ), .. N , N-1. d T (F+1)+(DT-d) . ( d.) , (F+1)+DT , .. O(N).

, W(N) - , N , N. N-1 ( , ). , , , 1/N , . , T2, , N-1. , , ; N .

, . , , . , . 6.31 ; . , ( 6.38), , . , N-1 .

a- , , - a 1 (a - £1). , . , a- - O(min(N,D/a)).

, , . . -, , .. . -, .

, . , . C - .

6.39 C - m1, m2, ..., mk , i (0 £ i £ k) mi mi+1.

(chain-time complexity) - .

, 6.31, , . ( , 6.38), k . () 1, , () k. , ( ), . , , , .

6

6.1

6.1 PIF- , (. 6.7 6.12). .

6.2 (X, £) b , c Î X, b £ c.

6.11 , (X,£) . ?

, ?

6.3 , (1) , (2) (the least common ancestor).

U, (1) , (2) .

6.4 ( 6.13).

6.2

6.5 , ( 6.3) .

6.6 - ( 6.5), , (. 4.4.3) 2|E| O(N) .

, O(D) ? (D - .)

6.7 , 6.19 , pq, , . , ?

6.8 6.12 , , .

, ?

6.9 , , .

(1) -?

(2) ?

6.3

6.10 - G = (V,E), V = V1 È V2 V1 Ç V2 = Æ E = V1 ´ V2.

2x- .

6.11 : Q(N logN) .

6.4

6.12 , DFS-.

6.13 , (. 4.4.2) .

O(N) ? O(N) ?

6.14 , , , (P). , , N .

6.5

6.15 - ( 6.5) .

6.16 , , .6.21, , . , S = {(p, jp): p Î P} .

6.17 ( 6.8) ?

7

, . [LeLann; LeL77], ; . 7.2.1. , , , (leader), - (lost).

, . , , . .. , .

( , ). .

(1)

(2)

(3)

(4)

7.1

, , , , (leader), - (lost). , , , .

7.1 - , .

(1) .

(2) , .. .

(3) , , - .

, . , , () , . , , , , . .

p statep leader () lost (). , statep sleep (), p , cand (), p , , . , active, passive ., .

7.1.1 ,

, .

(1) . , , .

, (.. ) , . , , , , .

, , , .

(2) , , . , p - p. P, .. £. , , w.

, , . , , , ( , ) . . .

, , , . , .

(3) . - , . , , , . , , , .

(, [Bodlaender, Bod91b] ), , . , 11; , .

(4) O(w) . . , .

7.1.2

, . , . 6.1.5, . , , , , . .. , (. 6.19).

. - , ( 6.2.2). , . , , wake-up. , , . ws , , wr , . , 6.3, ( 6.12) , . , ; , , - ; . 7.1.

var wsp : boolean init false ;

wrp : integer init 0 ;

recp[q] : boolean q Î Neighp init false ;

vp : P init p ;

statep : (sleep, leader, lost) init sleep ;

begin if p - then

begin wsp := true ;

forall q Î Neighp do send to q

end ;

while wrp < # Neighp do

begin receive ; wrp := wrp + 1 ;

if not wsp then

begin wsp := true ;

forall q Î Neighp do send to q

end

end ;

(* *)

while # {q : Ørecp[q]} > 1 do

begin receive from q ; recp[q] := true ;

vp := min (vp,r)

end ;

send p> to q0 with Ørecp[q0] ;

receive from q0 ;

vp := min (vp,r) ; (* decide vp *)

if vp = p then statep := leader else statep := lost ;

forall q Î Neighp, q ¹ q0 do send p> to q

end

7.1 .

7.2 7.1 , O(N) O(D) .

. , , . v, , . , - .

, 4N-4. D , , , , D+1 . , , D , D , 3D+1. , 2D , ; . 7.2.

(.. - FIFO), . , .

. -, , - , . -, , , , . , , 3N-4+k, k - [Tel91b, .139].

. , , 6.12.

7.3 ( 6.7) , O(D*|E|) O(D) .

[Peleg; Pel90] ; O(D*|E|) O(D) , D, .. .

. ( 6.9) , . O(N*|E|) , , , . , O(N) , O(N2|E|).

7.2

. [LeLann; LeL77], O(N2). (Chang) (Roberts) [CR79], O(N2), O(N logN). - 7.2.1. O(N logN) 1980 ., Hirschberg Sinclair [HS80]. , Hirschberg-Sinclair , . , W(N2), Petersen [Pet82] Dolev, Klawe Rodeh [DKR82] , O(N log N) . 7.2.2.

. , 0.34N logN , [Bodlaender; Bod88]. Pachl, Korach Rotem [PKR84] W(N logN) , . 7.2.3.

7.2.1 -

[LeL77] , . , , , . , FIFO, , . ( , .) p , p, p , p - ; . 7.2.

var Listp : set of P init {p} ;

statep ;

begin if p - then

begin statep := cand ; send to Nextp ; receive ;

while q ¹ p do

begin Listp := Listp È {q} ;

send to Nextp ; receive ;

end ;

if p = min (Listp) then statep := leader

else statep := lost

end

else repeat receive ; send to Nextp ;

if statep = sleep then statep := lost

until false

end

7.2 .

7.4 ( 7.2) , O(N2) O(N) .

. ( FIFO), q , p , . , p Listp, , . N N , O(N2). N-1 , , . , N . , 2N-1 .

- , . , , .

- [CR79] , , , . .. p , q > p. p , q < p, , p; . 7.3.

var statep ;

begin if p - then

begin statep := cand ; send to Nextp ;

repeat receive ;

if q = p then statep := leader

else if q < p then

begin if statep = cand then statep := lost ;

send to Nextp

end

until statep = leader

end

else repeat receive ; send to Nextp ;

if statep = sleep then statep := lost

until false

end

(* . , *)

7.3 -.

7.5 - ( 7.3) , Q(N2) O(N) .

. p0 - . -, p0, 0>, p0. , p0 .

- , .. , p0. p p > p0 ; p0 , p . p , 0>. , .

.7.4 -.

N N , O(N2). , W(N2) , , (. . 7.4) . 0, i N-i , ,

- . , .

7.6 - , , O(N logN) .

. ( Friedemann Mattern.)

, , N . N , s . (N-1)! ; pi - , i s; . . 7.5.

.7.5 .

, i> , i. N , , N(N-1)! . i> i , , s. Ai,k - , i> k . i>

i> i , pi p1 pi, (1/i)*(N-1)! ;

i> k ( k £ i), pi k-1 , pi. , pi - k pi-k+1, ..., pi, 1/k , .. (1/k)*(N-1)!. , ki> k , , k , .. ³ k , ³ k+1 . , , (  k < i ).

i> :

, Hi. 7.3

i , ( ) .

N(N-1)! , ,

.. (N-1)! , , , N×HN, 0.69N logN (. .7.4).

7.2.2 Petersen / Dolev-Klawe-Rodeh

- O(N logN) , . O(N logN) [Franklin; Fra82], , . Petersen [Pet82] Dolev, Klawe, Rodeh [DKR82] , O(N logN) . , FIFO.

, , . , , , . , , . . , , . .. , , , . , logN , .

.7.6 p q r.

, [Fra82]. , ; . . 7.6. q r p; r q, p . q r, p, q ( ) , p, r q, , p. q , , q , q (.. p = q). , q .

7.7. p , cip. p . , , . ( acnp), , p . , acnp , cip , . p p>, . , acnp = cip; p>.

var cip : P init p ; (* p *)

acnp : P init udef ; (* *)

winp : P init udef ; (* *)

statep : (active, passive, leader, lost) init active ;

begin if p - then statep := active else statep := passive ;

while winp = udef do

begin if statep = active then

begin send p> ; receive ; acnp := q ;

if acnp = cip then (* acnp - *)

begin send p> ; winp := acnp ;

receive

end

else (* acnp - *)

begin send p> ; receive ;

if acnp < cip and acnp < q

then cip := acnp

else statep := passive

end

end

else (* statep = passive *)

begin receive ; send ;

receive m ; send m ;

(* m - , *)

if m - then winp := q

end

end ;

if p = winp then statep := leader else statep := lost

end

7.7 Petersen / Dolev-Klawe-Rodeh.

7.7 7.7 O(N logN) .

. , i- , i- . ; , . , .. FIFO, , . .

7.8 i k (k>1) , ci, 1 k/2 . .

. , , , . , , , . acn, , . , , , .. . , , k/2.

7.8 , £ ëlogNû+1, , , .

7.9 p cip, winq = cip q.

. p> , , p. p , acnp = cip p>, winp = acnp.

( winp); , - .

ëlogNû+1 , 2N , , 2N logN + O(N). 7.7 .

Dolev . 1.5N logN, Petersen , 1.44N logN . Dolev . 1.356N logN. 1.356N logN 10 , 1.271N logN Higham Przytycka [HP93].

7.2.3

. .. , .

Pachl, Korach Rotem [PKR84] .

(1)

(2)

(3)

(4)

(5)

(6) , , , . , A - , B . B , A, , . B , , B A (, ).

. , , .

s = (s1, ..., sN), t .. . D, .. D = {(s1, ..., sk): si Î P i ¹ j Þ si ¹ sj}. s len(s), s t st. s s¢s¢¢, s = s¢¢s¢ ; si, ..., sN, s1, ..., si-1. CS(s) (cyclic shift - ) s, |CS(s)| = len(s).

, (s1, ..., sN), s1 sN ( N) . , s s-. t - s, t- s-.

, , , (trace) . m p , p - , m (p). m p , s = (s1, ..., sk), m (s1, ..., sk, p). s s-. , .

E - D. E (exhaustive),

(1) Î E Þ t Î E ;

(2) " s Î D: CS(s) Ç E ¹ Æ.

, . , , E. t s-, t - - r Î CS(s). M(s,E) E, s-, Mk(s,E) - k;

M(s,E) = |{ t Î E : t - r Î CS(s) }|

Mk(s,E) = |{ t Î E : t - r Î CS(s) len(t) = k}|.

, , A - , , EA - s , s- , A s-.

7.10 t u s s- , A t-, s- , A u-.

. sk s-, s = (s1, ..., sk), s1 sk. u- t- (, ), , , u-.

7.11 EA - .

. , EA , , A s- s-, t s A t- s-. 7.10 A t- t-, t Î EA.

, EA D, A s-. , ( 6.11), len(s). s E.

7.12 s- A M(s,EA) .

. t Î EA - r s. EA, A t- t-, r-, s-. , t {t Î E: t - r Î CS(s)} s- t-, , M(s,E).

I Per(I) I. aveA(I) , A , I, worA(I) - . , I N ,

(1)

(2)

.

7.13 N*HN.

. , I,

k , s Î Per(I) N s k. N! Per(I) N*N!. N*N!/k , k . .. EA D, EA ,

, - , . , , N*HN 0.69N logN 0.356N logN.

, , , . , 0.5N*HN Bodlaender [Bod88] , . , , . , , Bodlaender [Bod91a] , 0.5N logN (1/4-e)N*HN ( ).

, . , , , , - Q(N logN). , ; , , , 11.

.. , .

7.14 W(N logN) , , .

.7.8

INCLUDETEXT "E:\DISTR\(7-8)Lugovaya.DOC" 7.3

, . Ω(N logN+½E½) . 6.6 . 7.3.1 , , . 7.3.2 .

7.15 ( ) Ω(Nlog N + ½E½).

7.8 .

. Ω(N log N + ½E½) , , Ω(N logN). , ½E½ , , , G, ½E½ ; . 7.8. G ', G , , C. G. G ', , . o

7.16 Ω(NlogN + ½E½).

7.3.1

. ; , p p, . , , , , , , . , .

A, Ex(A) . ; - , caw , udef. , caw . , , q, p, p .

var cawp : P init udef ; (* *)

recp : integer init 0 ; (* átok, cawp ñ *)

fatherp : P init udef ; (* cawp *)

lrecp : integer init 0 ; (* áldr, . ñ *)

winp : P init udef; (* *)

begin if p is initiator then

begin cawp := p;

forall q Î Neighp do send á tok, pñ to q

end;

while lrecp < #Neighp do

begin receive msg from q ;

if msg = á ldr, r ñ then

begin if lrecp = 0 then

forall q Î. Neighp do send á ldr, r ñ to q ;

lrecp := lrecp + 1 ; winp := r

end

else (* á tok, rñ *)

begin if r < cawp then (* *)

begin cawp := r , recp := 0 , fatherp :== q ;

forall sÎ Neighp , s ¹ q

do send á tok, r ñ to s

end;

if r = cawp then

begin recp := recp + 1 ;

if recp = #Neighp then

if cawp = p

then forall s Î Neighp do send á ldr, p ñ to s

else send á tok, cawpñ to fatherp

end

(* r > cawp *)

end

end;

if winp = p then statep :== leader else statep :== lost

end

7.9 .

q> cawp, , q . q = cawp, . q < cawp cawp = udef, p q, cawp q. , q ( , q), q . , , ( ) Lemma 6.3. N - 1 ; .

7.17. - , , Ex(A), NM .

. p0 . , p0 , , , , p0. , p0 , , p0 .

p , p , p . p ¹ p0 - , p , p0 ( ) , p0 (Lemma 6.4). p0 p, , p .

N , , NM. o

Ex(A). , A, , , . O (Nt) ( t - ), t , p , p .

, Chang-Poberts; . 7.9. 7.9 . , udef > q qÎ P. , , átok, rñ r < cawpp, If r = cawp , cawp. p ( átok, pñ ), p áldr, pñ , , p - .

7.3.2 Gallager-Humblet-Spira

, . CE C . 7.2 , CE£CT+O(N), , , 2½E½ , CT £ CE + 2½E½. CE ( 7.15) , , , Ω(N log N + E) .

Gallager-Humblet-Spira (GHS), () , 2½E½ + 5N log N . , CE C q (N log N + E). [GHS83]. ( ) , , .

GHS .

(1) e w (e). , w (e) - , .

, , , . , , 2½E½ .

(2) , . ( , ), , . , .

. G = (V, E) , w {e) e. T G N-1 , T, T , MST, ( ) T. , , , , - .

7.18 , MST.

. , .. T1 T2 ( T1 ¹ T2) - . e , , ; T1 ¹ T2. , , e T1, T2. T2 È {e} , T1 , , e', T1. e w (e) < w (e '), T2 È {e} {e '} T2, , T2 - MST. o

7.18 - , () . , , , MST.

, , MST. e - F, e F, - . , , MST , .

7.19 F - e - F, F È {e} -

. , F È {e} - MST; MST, MST , f, - F. e - w (e) < w (f), f MST e MST, . o

MST - Prim Kruskal. Prim [CLR90, 24.2] . Kruskal [CLR90, 24.2] , , , . .. Kruskal , .

7.3.3 GHS .

, , . , , .

GHS .

(1) , .

(2) .

(3) , .

(4) , , .

(5) , .

.

(1) . , , . , . .

(2) . , , . , , , .

(3) . , , , . , , , . , , 0 . , F1 F2 , F1 È F2 F2. F2, F2 . ; , - . - , , . , .

Lemma 7.20. , , N log N .

. , , ). L 2L , - logN, , log N . , N log N. o

. F FN L F = (FN, L); eF F.

A. eF F ' = (FN ', L ') L < L ', F F ', FN ' L '. F.

B. eF F ' = (FN ', L ') L = L ' eF ' = eF, L + 1 w (ep). F F '.

C. ( , L > L ' L = L ' eF ' ¹ e F ) F, , B .

var statep : (sleep, find, found);

stachp [q] : ( basic, branch, reject) for each q Î Neighp ;

namep, bestwtp : real ;

levelp : integer;

testchp, bestchp, fatherp : Neighp;

recp : integer;

(1)   , :

begin pq p ;

stachp [q] := branch ; levelp := 0 ;

statep := found ; recp := 0 ;

send á connect, 0 ñ to q

end

(2)   á connect, L ñ q:

begin if L < levelp then (* *)

begin stachp[q] := branch;

send á initiate, levelp ,namep ,statep ñ to q

end

else if stachp[q] = basic

then (* C *)

else (* B *) send á initiate, levelp +1 ,w(pq) ,find ñ to q

end

(3)   áinitiate, L,F,Sñ q:

begin level p := L ; name p := F ; state p := S , father p :== q ;

bestch p := udef ; bestwt p :.= ¥ ;

forall r Î Neigh p : stach p [r] = branch Ù r ¹ q do

send á initiate, L, F, Sñ to r ;

if state p = find then begin rec p := 0 ; test end

end

7.10 gallager-humblet-spira ( 1).

7.3.4 GHS

. p 7.10, stach p [q] pq. - branch, , , MST, reject, , MST, basic, . branch . p , . C p, state p, - find, c p found . 7.10/7.11/7.12 . , .

(4) procedure test:

begin if $q Î e Neigh p : stach p [q] = basic then

begin testch p := q with stach p [q] = basic and w(pq) minimal;

send átest, level p , name p ñ to testch p

end

else begin testch p := udef ; report end

end

(5) á test, L, F ñ q:

begin if L > level p then (* ! *)

else if F = name p then (* *)

begin if stach p [q] = basic then stach p [q] := reject ;

if q ¹ testch p

then send á reject ñ to q

else test

end else send á accept ñ to q

end

(6) á acceptñ q:

begin testch p := udef ;

if w(pq) < bestwt p

then begin bestwt p := w(pq) ; bestch p := q end ;

report

end

(7) á reject ñ q:

begin if stach p [q] = basic then stach p [q] := reject ;

test

end

7.11 the gallager-humblet-spira ( 2).

, , , . , sleep, ( (1)) , .

. , , á connect, L ñ ; L - . , , - . (1). A á connect, 0 ñ .

(8) procedure report:

begin if rec p = #{q : stach p [q] = branch Ù q ¹ father p }

and testch p = udef then

begin state p := found ; send á report, bestwt p ) to father p end

end

(9) á report, w ñ g:

begin if q¹ father p

then (* reply for initiate message *)

begin if w < bestwt p then

begin bestwt p := w ; bestch p := q end ;

rec p := rec p + 1 ; report

end

else (* pq *)

if state p = find

then

else if w > bestwt p then changeroot

else if w = bestwt p = ¥ then stop

end

(10) procedure changeroot;

begin if stach p [bestch p] = branch

then send á changeroot ñ to bestch p

else begin send á connect, level p ñ to bestch p ;

stach p [bestch p] := branch

end

end

(11) áchangerootñ:

begin changeroot end

7.12 gallager-humblet-spira ( 3).

, , , e = pq. , L, p q á connect, 1ñ e, á connect, Lñ , e - branch, . (2). pq , p q áinitiate, L + 1, N, S ñ, . - w (pq), find , ; . (3). á initiate, L + 1, N, Sñ . p q, p á connect, L ñ e, (initiate, L' , N, S ñ q; . (2). , L ' N - q, q . p (. (3)), . q (S = find) p test.

( , . (4), (5), (6), (7)) , , , . , áreport, wñ; . (8). p áreport, wñ, , recp, 0 (. (3)) áreport, wñ; . (9). áreport, wñ , .

áreport, wñ , ; ; . (9). , áreport, wñ . áreport, wñ , . , ( ¥).

, bestch , , . á connect, L ñ , ; á changeroot ñ. , , á changeroot ñ, ; . (10) (11). á changeroot ñ , áconnect ,Lñ .

. p ; . (4). ( - reject branch ), . (4), ; . (6). - , p , p , .

pq, p á test, levelp, namep ñ q , á reject ñ, á accept ñ á test, L, F ñ . áreject ñ, q (. (5)) q , p, test, q; q . á reject ñ p pq ; . (7). á reject ñ , pq q , á test,L,Fñ; á test, L, F ñ q p; . (5). q p, á accept ñ. p pq ; . (6).

á test, L, F ñ p L> levelp. - , p q , áinitiate, L, F, S ñ p. p q á accept ñ .

. F = (name, level) , áconnect, levelñ , , F ' - = (name', level'). , áconnect, levelñ p , q. q áacceptñ p á test, level, nameñ, p . , test (. (5)) level' £ level.

, , áconnect, levelñ áinitiate, L, F, S ñ .

A: level' > level, p ; á initiate, level', name', S ñ, F. F q F ' q F', F . q (find found) á initiate, level', name', S ñ.

B: F ' pq, - pq: . (2). , , connect branch : , branch, connect .

, F , q áconnect, Lñ, q , .

. , áconnect, Lñ . 7.19 , MST , , , . , ( logN) , .

7.21 Gallager-Humblet-Spira (7.11/7.12 7.10/ ) , 5 N log N + 2½E½ .

. , , . , á report, wñ , ( ), .

F1 = (level1, name1) F2 = (level2, name2). ( connect, level1 ) , level1 ³ level2 ( connect, level2 ) F2, . (2). ( test, level1, narne1 ) , level1 > level2, . (5). , F1 F2, .

(1) level 1 > level2 ,

(2) level1 = level2 Ù w(eF1) > w(eF2);

(3) level1 = level2 Ù w(eF1) = w(eF2) F2 . (.. eF1 - F2, w (eF2) > w (eF1).)

.

, , reject test 2½E½. , initiate accept , report, changeroot connect , test , . accept report test . report initiate. 2½E½ + 5N log N. o

7.3.5 GHS

Gallager-Humblet-Spira - , . , , . , ( ). , , .

. GHS Ω(N2), . ( ½E½ ) 5N log N; . 7.11. Awerbuch [Awe87] , 0 (N), , 0 (½E½ + N log N).

Afek [ALSY90] , , , - 0 (N1/2). Lemma 4.47 .

, , 7.15 Ω(NlogN +½E½) . Johansen [JJN ^ 87] , 3N log N + 2½E½ +0(N) , GHS , . Barllan Zernik [BIZ89] , , . - , 0 (NlogN +½E½)) 0 (N3), .

, . Korach, Moran Zaks [KMZ85] , Ω(N2) . , MST 7.15. 0 (N log N) , ; . [KMZ84].

7.4 Korach-Kutten-Moran

, , , , .. 0(N log N) Ω(NlogN). Korach, Kutten, Moran [KKM90] , . - , . , , , , . ; , .

7.4.1

Korach-Kutten-Moran ( 7.3.1) Peterson/Dolev-Klawe-Rodeh ( 7.2.2). , . (), ; , . , fifo , , , - fifo ; . [KKM90].

, , Peterson/Dolev-Klawe-Rodeh . , , . , . , , . Peterson/Dolev , . Korach-Kutten-Moran ; , . , , , , .

7.13. , : annexing, chasing, waiting. (q, l), q - l - . levp p, catp annexing , p ( p). waitp - udef, p, q, (q, levp) p. lastp chasing: , p annexing levp, chasing ; lastp = udef. trav: , decide, .

(q, l) annexing ( IV 7.13) .

(1) : q (. IV 7.13).

(2) p levp > l: , ( 7.13; l> levp l = levp.)

(3) , l: , (. II 7.13).

(4) l, catp > q (. VI) chasing (. III): .

(5) l, annexing catp < q: chasing (. V).

chasing (g, l) , , .

(1) levp > l: .

(2) waiting l: , (. II ).

(3) l, chasing: waiting (. III).

waiting , .

(1) : waiting (. 1).

(2) : , (. II).

7.13 , . , p levp, annexing, p . p, p , .

. Korach-Kutten-Moran , , , , .

Lemma 7.22 k> 1 l, k/2 l + 1.

var levp : integer init 1;

catp , waitp : P init udef',

lastp : Neighp init udef:

begin if p is initiator then

begin levp := levp + 1 ; lastp := trav(p. levp) ;

catp := p ; send (annex, p, levp ) to lastp

end ;

while . . . (* , *) do

begin receive token (q,l) ;

if token is annexing then t := A else t := C ;

if l > levp then (* Case I *)

begin levp := l ; catp := q ;

waitp := udef ; lastp := trav(q, l) ;

send ( annex, q, l ) to lastp

end

else if l == levp and waitp ¹udef then (* II *)

begin waitp := udef ; levp := levp + 1 ;

lastp := trav(p, levp) ; catp := p ;

send ( annex, p, levp ) to lastp

end

else if l = levp and lastp = udef then (* III *)

waitp := q

else if l = levp and t = A and q = catp then (* IV *)

begin lastp := trav(q, t);

if lastp = decide then p

else send ( annex, q,l) to lastp

end

else if l = levp and ((t = A and q > catp) or t = C) then (* C V *)

begin send ( chase, q, t ) to lastp ; lastp := udef end

else if l = levp then (* C VI *)

waitp := q

end

end

7.13 korach-kutten-moran .

. k/2 l + 1, , , l .

, l , k> l l, l + 1. q , l. (q, l) , p, l. (q, l) chasing , p chasing, (q, l) waiting. , l chasing .

(r, l) , chasing . (r, l) chasing, chasing . , (r, 1) waiting, p¢, l. p" (r, l), annexing,

(r, l), chasing r. chasing (r, 1) p ', , waiting , p '. l + 1 , .. .

7.23 Korach-Kutten-Moran ( 7.13) - .

, . , , , , , (q, 1) . l ' < l , . l l, cat = q ( , ), . , q .

f, f (a) + f (b) £ f (+ b). f (x) - (. 6.3) , f - .

7.24 f (x) - , f , KKM (1+log k)[f(N)+N] k .

. k , 2-l l, , - ëlogkû.

annexing . l p1, , pj Ni, annexing (pi, l), S1j Ni £ N . .. f (x) - , annexing (pj, l) f (Nj) , annexing l S1j f(Ni) , f (N), f . chasing , N chasing .

(1 + log k) , f (N) + N , . o

Attiya. Attiya [Att87]. , q , , r , p. annexing r, "", p r, p . , , q , . , r, . f (x) - , 3. S1j f(N/i)

7.4.2 KKM

f (x) - , - f (x) -.

. - x-, KKM 2N log N .

. - 2x-, KKM , 3N log N 7.24. , - 2N log N + 0 (N) . , chasing, chasing , 3.S0logN+12-i N= 0(N). 2NlogN + 0 (N) . Ω(NlogN ) Korach, Moran, Zaks [KMZ84].

, [LMW86]. , , 1 N-1, , pq p p q : . B. 3. Loui, Matsushita. West [LMW86] 0 (N) , Ω(N2) , [Tel94].

. - x-, KKM 2N log N .

( , Up, Left ..) x- ( 6.11). Peterson [Pet85] , 0 (N) , .

. - x- (. 6.12), KKM , 2N log N . Tel [Tel93] , 0 (N) . 0 (1.51) [Tel94], GHS .

Tel [Tel93] , 0 (N) .

7

7.1

7.1 , - , , , .

7.2 , 7.1 2D.

7.2

7.3 , Σ1m Hi = (m + 1)Hi - m 7.2.1.

7.4 , ln (N + 1) < HN < ln (N) + 1. (ln .)

7.5 Chang- , . ?

7.6 Chang-, S , S, , ?

7.7 7.7, ëJog N + 1û . , , . , ?

7.8 ecr ( Lemma 7.10) Chang-.

7.3

7.9 Chang-. ?

7.10 , Gallager/Humblet/Spira , sleep.

7.11 , GHS , , N .

, 5N l 3N - 1 . , 5NlogN .

7.4

7.12 , O (NlogN) .

7.13 , 0 (NlogN) .

7.14 , 0 (NlogN) .

7.15 , O (N (logN + k)) k ( , , k ).

8

, ; , . ; , . , , , . , . , , ; . , - . , . , .

, , . , ; , . , , . , . ; .

. , ( , , ), . , . , . , , .

, . 8.1.3. , , . , , , , , , , . , 9 , , . , .

, , , . , , . 8.1 , . 8.2 , ( ) , , . 8.1. . . , 8.3 8.4 .

8.1

8.1.1

. 2, .

p - Zp, - . p - p p , . p , .. p - p. p , . , , , . , . .

(1) . , . (c, m, d ) ( ) p, d - . p (c, m, d'), d' , , d' (d', d). d' , p (d', d).

(2) . , . (c, m, d) p, d - . (c, m, d'), d' , , d' (d', d). d' , p (d', d).

(3) , p p. , p , ; , . .

p ; statep. 8.1

var statep : (active, passim) ;

Sp: { statep = active }

begin send (mes) end

Rp: { A message ( mes) has arrived at p }

begin receive ( mes ) ; statep := active end

Ip: { statep = active }

begin statep := passive end

8.1 .

, , , . .

, , . , . , .

term , , ; , .

8.1

term <==> ("p ÎP : statep = passive)

Ù("pq Î E : Mpq (mes)).

. , . , , (mes), , .

, , (mes), . o

. , - , , . ( ) , term : . , .

. , . .

(1) . .

(2) . term , .

(3) . , term.

Francez [Fra80]. Francez , ; "" , . ; , "", . . , "", , . , , .

, . . , , , .

8.1.2

N ú Eú , . ; W. W , , , , , , .

. , , . , W. ú Eú , Chandrasekaran Venkatesan [CV90],.

8.2 , .

. , , . , .

g , p q, , . , , ; , .

, g, , , d = Ip(Iq (g)). ; p q . , , . ( , .) , d , .

, , p d. , , g, p , , gp= I p (g). p gp d, , p gp. , , .. q . , , q p, , p q . , , p q , . ,

(1) , p q , , ;

(2) , ;

(3) , .

. o

8.3 W .

. , . , , ( ) . , , , . q, , q . q, , q . , W . o

. Chandrasekaran Venkate- [CV90] ôEô .

Cl. - fifo.

C2. , , , .

, , pq. , pq.

var SentStopp : boolean init false ;

RecStopp : integer init 0;

Procedure Announce;

begin if not SentStopp then

begin SentStopp := true;

forall q Î Outp do send ( stop ) to q

end

end

{ ( stop ) p }

begin receive (stop) ; RecStopp := RecStopp + 1 ;

Announce ;

if RecStopp = #Inp then halt

end

8.2 .

, . Chandrasekaran Venkatesan , .

, , [CV90], , C2 , C1 - . , , . C2, , , - fifo, [CV90] .

8.1.3

, ( stop ). , ( stop ). ( stop ) , stop , . 8.2.

8.2 , , , , .

8.2

, , , , . , . , , , . 8.2.1 , . 8.2.2 , .

8.2.1 Dijkstra-Scholten

Dijkstra Scholten [DS80] ( [DS80]). ( [DS80]), p0.

T = (VT, ET) .

(1) T T - p0.

(2) VT , .

p0 p0 Ï VT , T , , term .

, T , , . p (mes), (mes) , (mes) p. p, , q, q p. , , (mes) q (mes, q).

T . , . , .

var statep : (active, passive) init if p = p0 then active else passive;

sp : integer init 0;

fatherp : P init if p == p0 then p else udef;

Sp: { statep = active }

begin send (mes, p) ; scp := scp + 1 end

Rp: { (mes, q) p }

begin receive (mes, q);, statep := active;,

if fatherp = udef then fatherp := q else send ( sig, q ) to q

end

Ip: { statep = active }

begin statep := passive ;

if scp = 0 then (* p T *)

begin if fatherp = p then Announce else send (sig , fatherp) to fatherp ;

fatherp := udef

end

end

Ap: { (sig ,p) p }

begin receive (sig,p) ; scp := scp -1 ;

if scp = 0 and statep = passive then

begin if fatherp = p then Announce else send ( sig, fatherp ) to fatherp ;

fatherp := udef

end

end

8.3 dijkstra-scholten .

- T; , T. p q; q. , p, p (sig, p) . p, , .. , p p .

8.3. p fatherp, pÏVT , p p , p, p - T. scp p T.

, T, , . g 8.3,

VT = {p : fatherp ¹ udef} È { (mes,p) } È { ( sig,p) }

ET = {(p, fatherp) : fatherp ¹ udef Ù fatherp ¹ p}

È { ((mes, p), p) : (mes, p) }È{((sig,p), p) : (sig, p) }.

P,

P º statep = active Þ p Î Vp (1)

Ù (u, v) Î ET Þ u ÎVT Ù v Î VT Ç P (2)

Ù scp = #{v : (v, p) ÎET } (3)

Ù VT ¹ Æ Þ T p0 (4)

Ù (statep = passive Ù scp = 0) Þ p Ï VT (5)

. , T ( ), (1) . (2) ; , T - , . (3) , (4) , T - , p0 - . (5) , , , . , , P , fatherp = p p = p0.

Lemma 8.4 P - Dijkstra-Scholten .

. statep = passive p ¹ p0 fatherp0 ¹ udef, (1). , ET = Æ, (2). scp = 0 p, (3). VT = {po} ET = Æ, T - p0, (4). VT - p0, p0 .

Sp: Sp, VT, (1) .

, p, (mes, p), VT, , (2) . , VT (mes, p) ET ((mes, p), p), , T , scp , p, (3) (4) .

, VT , (5) .

Rp: p VT (fatherp ¹ udef) p VT , (1) .

fatherp , - q, p, - q, q VT, (2) . q , (mes, q) q p (sig, q), scq , (3).

, (4) . p VT , (5) .

Ip: p (1), (2), (3) (4). , p , p VT. scp = 0, p VT, (5) .

p T, , p T.

p, - p, VT, (2) . , p fatherp, fatherfather p , (3) . , (4) .

, , fatherp = p, p = p0 p, , , p T, T , (4).

Ap: p , scp (3). , p , , p VT. statep = passive scp 0, p , (5). p VT, , Ip. o

8.5 Dijkstra-Scholten ( 8.3) - .

. S , , S = SpÎ P sc p . S = 0, S ( Sp), S - , ( Ap), S ( (3)). , .

, , . Ap .. S , . , , VT . , (5), VT . , T , , T . , p0 , , p0 .

, , p0 , , VT. (4), T , , term. o

Dijkstra-Scholten ; , p q q p. 8.2, .

, , , () ().

8.2.2 Shavit-Francez

Dijkstra-Scholten Shavit Francez [SF86]. , - , . p Tp.

F = (Vp , Ep), (1) F F - , ; (2) Vp . Dijkstra-Scholten , . , , . , , , . , , , .

. , Tp , . , p ; p , p . , ; , . ( , ; , .)

8.4, . p fatherp , , PÏVT, p p p, p - F. sp p F. empty , , p .

Dijkstra-Scholten . g 8.4,

VF = {p : fatherp ¹ udef} U { (mes, p) } U { (sig,p) }

Ƞ

Ep = {(P, fatherp ): fatherp ¹ udef Ù fatherp ¹ p}

U {((mes, p), p) : (mes, p) } U {((sig,p}, p) : (sig,p} }.

Q, . , Lemma 8.4. (1)-(5) Q Dijkstra-Scholten (6) , , . , , .

Q Û statep = active Þ p Î VF (1)

Ù (u, v)Î EF Þ uÎ VF Ù v ÎVF Ç P (2)

Ù scp = #{ v : (v, p) Î Ep } (3)

Ù VF ¹ Æ Þ F is a forest (4)

Ù (statep = passive A scp = 0) Þ p Ï Vp (5)

Ù emptyp Û Tp is empty (6)

Lemma 8.6 Q - Shavit-Francez .

. statep = passive - p, fatherp = p p, (1). , Ep = Æ, (2). scp = 0 p, (3) . VF = {p : p -} EF = Æ, F - , , , (4). VF - , ; (5). emptyp (p - -) Tp , , p - , (6).

Sp: Sp, VF, (1) .

, p, , VF, (2) .

, VF (mes, p) EF ((mes, p), p), , F , scp , p, (3) (4) .

, VF, (5) .

- , , empty , (6) .

Rp: p VF (fatherp ¹ udef) p , (1) .

fatherp , - q, , q, q VT , (2) .

q , (mes, q) q p (sig, q), scq (3).

, (4) . , VF, (5) .

, (6) .

Ip: p (1), (2), (3), (4). , p , p VF. scp = 0, p VF, (5) .

, p F, p , F. , - p, VF, (2) . , p fatherp , scfather p , (3) . , (4) . , (6) . , , fatherp = p, p , p , p Tp , Tp emptyp (6).

var statep : (active, passive) init if p is initiator then active else passive ;

scp : integer init 0 ;

fatherp : P init if p is initiator then p else udef ;

emptyp : boolean init if p is initiator then false else true ;

Sp: { statep = active }

begin send (mes, p) ; scp := scp + 1 end

Rp: { (mes, q) p }

begin receive (mes, q) ; statep := active ;

if fatherp = udef then fatherp := q else send ( sig, q ) to q

end

Ip: { statep = active }

begin statep := passive ;

if scp = 0 then (* Delete p from F *)

begin if fatherp = p then emptyp := true else send ( sig, fatherp } to fatherp ;

fatherp := udef

end

end

Ap: { (sig,p) p }

begin receive (sig,p) ; scp := scp - 1;

if scp = 0 and statep = passive then

begin if fatherp = p then emptyp := true else send ( sig, fatherp ) to fatherp ;

fatherp := udef

end

end

, p , emptyp decide .

8.4 shavit-francez .

Ap: p , scp , (3) . , p , p VF. statep=passive scp = 0, p , (5) .

p VF, , Ip.

8.7 Shavit-Francez ( 8.4) - + W .

. 8.5 , . , . , + W .

, . , , 8.5, F . , , , , , , .

, , . , p , , emptyp , p . empty , ( p) emptyp , . (6), VF , term. o

, Shavit-Francez , , 8.2 8.3. ( ).

, , ; , p q q p. ; , Shavit-Francez , .

8.3 ,

, 8.2. ,

. , , , . .

, ; , , . , .

, . , ; , . po pN -1 po , pN -1. pi + 1 ( i < N -1) pi. , p0.

, - Dijkstra, Feijen, Van Gasteren ( 8.3.1); . ; , , . Safra ( 8.3.2), , ; . ( 8.3.3); , , Shavit-Francez.

8.3.4 .

8.3.1 Dijkstra-Feijen-Van Gasteren

Dijkstra, Feijen, Van Gasteren [DFG83] , ; 8.5. ,

term Û "p : statep = passive

term Û "p : statep = passive

var statep : (active, passive);,

C pq: { statep = active }

begin (* p , q *)

statep := active

end

Ip: { statep = active }

begin statep := passive end

8.5 .

term 8.1 8.1.

, , , . [DFG83]. , t , , , . pt, t 1. t = 0; P , P, t = 0, p0. , p0 , , t = N - 1.

P = P0,

P0 º "i (N > i> t) : statep = passive.

, P0 t = N - 1, t = 0 statepp0 = passive, . P0, , .

1. , .

, P 1; , P . P0 , pj pi, j > t i £ t; . 8.4. P0 , P (P0 Ú P1), P1 , P0 , P1 . , , P = (P0 Ú P1)

P1 º $ j (t ³ j ³ 0) : colorpj = black.

, P0 , P1 , .

2. .

(P Ù colorp0 = white Ù t = 0) Þ Ø P1, , , p0 ( ) .

P ; , , t - . P. ( ), P (P0 Ú P1 Ú P2),

P2 º .

P2, .

3. p0 , .

( ) Þ Ø P2, p0, , ( ).

, , , , P. ; p0, . , .

4. , p0 .

, ; , , .

, p, , P i > t, P , p0 , PN - 1. , .

5. . . 8.6.

var statep : (active, passive) ;

colorp : (white, black) ;

Cpq: { statep = active }

begin (* p , q *)

colorp := black; (* 2 *)

state q := active

end

Ip: { statep = active }

begin statep := passive end

, p0:

begin send ( tok, white ) to pN -1 end

Tp: (* p (tok ,c) *)

{ statep == passive } (* I *)

begin if p = p0

then if (c = white Ù colorp = white)

then Announce

else send ( tok, white} to pN -1 (* 4 *)

else if (colorp = white) (* 3 *)

then send ( tok, c ) to Nextp

else send ( tok, black ) to Nextp ;

colorp := white (* 5 *)

end

8.6 dukstra-feuen-van gasteren .

8.8 Dijkstra-Feijen- Gasteren ( 8.6) - , .

. P º (P0 Ú P1 Ú P2 ) , P . , p0 . , , ØP2 , p0 砠 t = 0 ØP1 , P0 p0 term. .

, , . , , , . , , , , . o

, . , 8.2 ; - ½ N.M ; . 8.5.

"" . , T. .. , , T , . ( , .. .) .. 3N , T + 3N . - T ( , ), , Ω(N.T ). , - N.T.a, Ω(N.T ) . , 0 (N + T), .

8.3.2 :

, Dijkstra-Feijen-Van Gasteren - . (cf. 8.1). [Dij87]; Dijkstra-Feijen-Van Gasteren.

B. term

("p : statep = passive) Ù B = 0.

P , P, t = 0, p0. , p0 , , t = N - 1.

B ( ), p mcp , Pm ,

Pm º B= SpÎP mcp .

Pm , mcp = 0 p, .

. p , 1; p , 1.

p0 , term, (t = 0). .. term B, q , . P = Pm Ù P0 ,

P0 º ("i (N > i > t) : statePi = passive) Ù ( q = SN>i>t mcPi ) .

, P0 , t = N -1 q = 0, t = 0 P ,

("i > 0 : statePi = passive) Ù (mcP0+ q = B),

p0 state P0 = passive mcP0 + q = 0.

P0 , p0 , pN -1 q = 0. P0, ; .

1. , q.

, P ; , P p, i > t. P0 , , B> 0. .. , P1,

P1 º (Si £ t mcPi + q )>0.

P1 pi i > t ; , P, Pm Ù (P0 Ú P1) pi i > t.

var statep : {active, passive) ;

colorp : (white, black) ;

mcp : integer init 0 ;

Sp: { statep = active }

begin send ( mes ) ;

mcp := mcp + 1 (* M *)

end

Rp: { (mes) p }

begin receive (mes) ; statep := active ;

mcp := mcp - 1; (* M *)

colorp := black (* 2 *)

end

Ip: { statep = active }

begin statep := passive end

, p0:

begin send (tok, white, 0) to pN - 1 end

Tp: (* p (tok,c,q ) *)

{ statep = passive } (* I *)

begin if p = p0

then if (c = white) Ù (colorp = white) Ù(mcp + q = 0)

then Announce

else send (tok, white,0) to pN -1 (* 4 *)

else if (colorp = white) (* I and 3 *)

then send ( tok, c, q + mcp ) to Nextp

else send ( tok, black, q + mcp ) to Nextp ;

colorp := white (* 5 *)

end

8.7 safra's.

p0 , , t = 0, P1 mcP0 + q > 0, mcP0 + q = 0 ( ), ØP1 . P1, . , P1 pi i £ t. 8.3.1, :

2. P Pm Ù (P0 Ú P1 Ú P2 ),

P2 º $ j (t ³ j ³ 0) : colorp = black.

, P1 , P2 , P . (P Ù colorP0 = white Ù t = 0) Þ ØP2 , , , p0 ( ) .

P ; , , t - . P. ( ) , P Pm Ù (P0 Ú P1 Ú P2 ÚP3),

P3 º .

P3, .

3. , .

.. ( ) Þ ØP3 p0, , ( ).

, , , P. , p0, , p0 , mcP0 + q ¹ 0. , .

4. , p0 .

, ; , , - .

, p P i > t, P p0 , pN -1. , .

5. . . 8.7.

8.9 ( 8.7) - .

. , P, Pm Ù (P0 Ú P1 Ú P2 ÚP3) - .

, , t = 0, stateP0 = passive, colorP0 = white, mcP0 + q = 0. Ø P3, Ø P2, Ø P1, Pm Ù P0, stateP0 = passive mcP0 + q = 0 term.

, , , 0. , mcP0 +q = 0 , , . o

Dijkstra-Feijen-Van Gasteren, ; , - , . Dijkstra-Feijen-Van Gasteren, T Q(T + N) .

- . Mattern [Mat87] , , . p - mcp[P]. p q, p mcp [q] := mcp [q]+l p , mcp [p] := mcp [p] - 1. , p , mcp ( ). , 0.

- , . , , . , , , , . , ; p , , p.

, ( , ), . , . , . , , , . ( ), .

8.3.3

, , , . ; Dijkstra-Feijen-Van Gasteren, ., , Naimi [Nai88]. , Shavit-Francez, .

, , p , p . , , , , , , , . p quiet(p) ,

quiet(p) Þ (statep = passive Ù , )

. ("p : quiet(p)) Þ term.

, , p , , , . , Pa

Pa = " p : (unackp = # ( , p) + # ( p))

.

var statep : (active, passive) ;

colorp : (white, black) ;

unackp : integer init 0 ;

Sp: { statep = active }

begin send (mes) ; unackp:= unackp + 1 : (* A *)

colorp := black (* B *)

end

Rp: { ( mes ) q p }

begin receive (mes) ; statep := active ;

send (ack) to q (* A*)

end

Ip: { statep = active }

begin statep := passive end

Ap: { (ack) p }

begin receive (ack) ; unackp := unackp 1 end (* Rule A *)

, p0:

begin send ( tok, white ) to pN -1 end

Tp: (* p (tok,c) *)

{ statep = passive Ù unackp = 0 }

begin if p = p0

then if c = white Ù colorp = white

then Announce

else send (tok, white ) to pN -1

else if (colorp = white)

then send ( tok, c ) to Nextp

else send ( tok, black ) to Nextp ;

colorp := white (* B *)

end

8.8 , .

A. , p unackp, q, p q ; , p 1 unackp.

quiet ( , quiet(p) , p , p ) , quiet

quiet(p) º (statep= passive Ù unackp = 0).

Dijkstra-Feijea-Van Gasteren. P0 ,

P0 º " i (N > i> t) : quiet(p).

P1 , pj j> t pi i £ t , pi. , , , pj ( , P0 ), unackPi > 0. , Pb

Pb º " p : (unackp > 0 Þ colorp = black),

B. , ; , quiet.

, P0 , P1 , (P0 Ú P1) .

8.8, - Pa Ú Pb Ú (P0 Ù P1 ÙP2 ) ,

Pa º" p : (unackp =: #( p)

+ #( p))

Pb º" p : (unackp > 0 Þ colorp = black)

P0 º" i (N > i> t) : quiet(p)

P1 º$ i (t ³ i ³ O): colorPi , = black

P2 º .

8.10 8.8 - .

. , p0 quiet . , ØP2 ØP1, Pa Ù Pb ÙP0 . quiet(p0) (p0) , quiet, term.

, , quiet. , , quiet, , . o

, . [Tel91b, 4.1,3] ( ) ,

m. (. 3.2). , quiet m , , quiet, . p quiet (1) m p . .

8.3.4

, ; . ; , Francez Rodeh [FR82] Topor [Top84] , . Tan Van Leeuwen [TL86] , , . , , , .

( ), , ( ). , , , . , , , , . .

( 8.3.1). , 8.3.2 8.3.3.

, ; , P = P0,

P0 º .

, , , , . , P0 ( ). P0 1, .

1. . , P0 , . , , P (P0 Ú P1),

P1 º .

2.

2. .

, . P. , , . , ; , infirna, " " infirnum. , ; , , . , , ; , . , , , , , . P (P0 Ú P1 Ú P2),

P2 º .

.

3. .

, , . , , . , , .

4. .

5. .

. , , , , , .

. , B, , B A. , , , . , , ; . 8.4.2.

8.4

: .

8.4.1

Mattern [Mat89a] , , , ( 6.31). , ( , ).

, 0 1 ( ), .

S1. ( ) 1.

S2. .

S3. .

, ( , ) . , , , ret .

, , ; term .

1. ret = 1, .

, . , , , .

var statep : (active, passive) init if p = p0 then active else passive ;

credp : fraction init if p = p0 then I else 0 ;

ret : fraction init 0 ; for p0 only

Sp: { statep = active } (* 3 *)

begin send (mes,credp / 2) : credp := credp / 2 end

Rp: { (mes,c) p }

begin receive (mes,c) ; statep := active;

credp := credp + c (* 4 and 5b *)

end

Ip: { statep = active }

begin statep := passive ;

send ( ret, credp ) to p0 ; credp :== 0 (* 2 *)

end

AP0: { (ret, c) p0 }

begin receive ( ret, c ) ; ret := ret + c ;

if ret = 1 then Announce (* I *)

end

8.9 .

2. , .

, 1, ret = 0, , S1- S3 z.ncz. ; . , ; , , .

3. p , p .

; , , , .

4. .

, - . , , S3; , , S1 . , .

5a. ,

.

5b. , .

8.9. , , ( , ) 5b. , .

8.11 ( 8.9) - .

. 1-5, , S1 Ù S2 Ù S3 ,

S1 º 1 = ( S(mes, c) c )+ (SpÎP credp )+ ( S(ret, c) c )+ret

S2 º"( mes, c ) : c > 0

S3 º"p Î P : (statep = passive Þ credp = 0) Ù (statep = active Þ credp > 0).

, ret = 1, , term .

, , (ret, c), 1 . , . ( term), credp = 0 p ( term S3), (ret, c) ( ). , ret = 1( S1), . o

5a, . ( , p0 , .) 5b, , . , 5b . . 5a, ret - 2 (i.e .., 2-i i). .

- , ( , ) . piggybacking. piggybacking , , . ( piggybacking, , .)

, ( ) . , . , . ret (ret, ) , . , . , .

8.4.2 ,

, . , ( 2.3.3); ( 2.3.3). Rana [Ran83].

8.3.3, quiet(p) p,

quiet(p) Þ statep = passive Ù p, , ("p quiet(p)) Þ term. , quiet

quiet(p) º (statep = passive Ù unackp = 0).

t, quiet ; . , quiet ; , quiet, , .

var statep : (active, passive) ;

θp : integer init 0 ; (* *)

unackp : integer init 0 ; (* *)

qtp : integer init 0 ; (* quiet *)

Sp: { statep = active }

begin θp := θp + 1 ; send (mes, θp) ', unack p := unack p + 1 end

Rp: { (mes, θ) q p }

begin receive (mes, θ) ; θp := max(θp, θ) + 1 ;

send ( ack, θp ) to q ; statep := active

end

Ip: { statep = active }

begin θp := θp + 1 ; statep := passive ;

if unackp = 0 then (* p quiet *)

begin qtp := θp ; send (tok, θp , qtp , p) to Nextp end

end

Ap: { ( ack, θ) p }

begin receive ( ack, θ ) ; θp :== max(θp, θ) + 1 ;

unackp := unackp - 1 ;

if unackp = 0 and statep = passive then (* p quiet *)

begin qtp := θp ; send (tok, θp, qtp ,p) to Nextp end

end

Tp: { ( tok, θ, qt, q ) p }

begin receive ( tok, θ, qt, q} ; θp := max(θp, θ) + 1 ;

if quiet(p) then

if p = q then Announce

else if qt ³ qtp then send (tok , θp , qt, q) to Nextp

end

8.10 rana.

8.3 p, . ( , , .) .

; .

8.3.4 . , .

p, quiet, qtp, , , , quiet qtp. , . , , quiet , . 8.10 , .

8.12 ( 8.10) - .

. , term g, . Ap and Tp. Ap 1 ( ack, q ) , . quiet ; N , N . a + N2 d, term .

p0 qt d, , qtP0 ³ qtP p. p0 quiet ( , qtP0), (tok,qtP0 ,qtP0 ,p0 ). p0. , p quiet qtP £ qtP0, . , p qtP0 quiet p0, p0. p0, p0 quiet, .

, p0 ; , p0 quiet (tok,qtP0 ,qtP0 ,p0 ), . . , term , p0 ; , p , p quiet. p quiet p0; , p quiet, . q , quiet (tok, θ, qt, p0). , q , r, p0.

( r quiet , , q quiet, q.)

θq > qtP0 . , , q quiet, r θ0 > qtP0 . , r quiet, , θr > qtP0 , qtr > qtP0 , r . r ; .. . o

, , Huang [Hua88].

8

8.1

8.1 .2. A.1?

8.2

( 6.31) .

8.2. Dijkstra-Scholten ?

8.3. Shavit-Francez , , Gallager-Humblet-Spira . - Ω(NlogN).

0 (N) 0 (N) ?

8.3

8.4. P0 Dijkstra-Feijen-Van Gasteren, , pj pi, j £ t i > t?

8.5 , m , m Dijkstra-Feijen-Van Gasteren m(N - 1) .

8.4

8.6. 8.9, 5a , 5b?

8.7 , . , , , . 8.10, .

8.8 ( 8.10) .

INCLUDETEXT "E:\DISTR\(13)Shabounin.doc" 13

. , [FLP85], 13.1. , , . , . . 13.1.3.

13.1

, [FLP85] , 1- . , . ( 2.1) , .

13.1.1 , ,

- , , ,

13.1

. 2.19. o

( 1 0) . , ; , ( ) .

13.2 t- - , N-t , , , . ( , .)

, , ,

13.3 1-- - , .

(1)     . 1- , .

(2)     .

(3)     . ,

v-, , 0- 1-. - - . v-, , , v-. , 0-, 1- , , 1-, 0-. , , .

- , ( ) , 0- , 1-. , .

13.4 t- S N-t ,

. , ( t- , ; o

13.5 .

. - - .

N-t , , ( 13.4). 0-, 1-; , 0-.

, 1- - , ( 13.1), - 0-, 蠠 o

13.1.2

, , ( 13.6). , , ( 13.7). , ( 13.8). , - 1-- .

13.6 .

. ( 13.3), 0- 1- ; - , -

, - . , , . - , .

, ; 1- 1-, . 0-, , ; 0-.) o

ñòðîèò , , . s ( ) . , , . , , .

13.7 s - p , s .

. - , s, .., = {: s }; s (, s - , ).

, v- . , , , .. , v- v =0,1. (.. s ), , v-, (.. s ), , s.

- . , 1-

(1)     , ;

(2)     , 0- - 1-.

- . , - , . , , e q. - , , 1-, 1-, .. 0-. , s , ( 2.19) , p = q, - , . o

13.8 , , 1-- .

. , , ,

, . , ,

, , . o

13.1.3

, , , 1-- ; . (. 12.2.2).

, , , , , , , . , , .

(1)     . 13.2 - , , , .

(2)     . 13.3 , , , , , , .

(3)     . 13.4 , , .

(4)     . 13.5 , ; - .

(5)     . 14.

, 13.3 ; . 13.1. ( 13.6) , , 13.2.

13.2 -

- , , , 0, .

13.9 t-- - , N-t , , , , .

t--- , t-- . , .

var init 0;

begin shour

(* ..: forall do send

while < L

do begin receive

shout

while

do begin receive

end;

G

end

13.1 .

, . , -, (t < N/2). - (. 13.3).

. , [FLP], . . ; . 13.1.

, ; . , shout

forall do send to .

) . - .

- , , , . - , . , , , , -

, , ,

13.1 , G.

. , ; K. . , , (x). K, , K (, , , ).

-, , , L . . [IKWZ90] , , . [MNHT89] , .

, ; . , - . , , ; . , , .

13.3

, , , ; , . 13.3.1 , , . 13.3.2 , .

X D, ( )

T: , - ,

13.10 t- T .

(1)     . t- , .

(2)     . ,

, , , , , T.

(1)     : . , , ..,

(2)     : . , 1, 0, ..,

(3)     : . - . e, .

(4)     : . , . , 1, ..., K, , .

, , ,

13.3.1 :

[ABND+90]. (t - )

t. , N/2 ; , - t

13.11 .

. t. t , "", , (. 13.4). ; - , . .

13.4, , S t . , , , . , ( N-t) , i, j, , i, j.

. S T; , ( ). - , T , o

, t < N/2.

var

begin set,

while true

do begin receive

if then

begin

if and then

(* : *)

end

else if then

skip (* *)

else (* ; Vp *)

begin if then else ;

set,

end

end

end

13.2 .

. ( 13.2), p , p ; , . , , p . , , .., , , , N . , p N , ,

, p ( 0, , , V ( , V - 1, 0.

, p, V N-t, - V. , p (N-t)- V Vp.

13.12 , , q r

. , q r N-t r N-t . 2(N-t) > N, , p, q r . , - o

13.13 t- .

. p - ; , N . , , ,

, ; p, ( - p). , q , p . , , p. o

V , p (s, r), s - V, r - V. N-t , N-t ,

13.14 13.2

. , t- , . , , o

. , 13.2 ; , "" . A [ABND+90] , , , , , .

, , . A [ABND+90] , 1 N + t. - N + 1.

A , . 1 , t-- , .

13.3.2

( 13.8) [MW87] . T -

E = {(, ): }.

T , . , T ( ) , , 13.6 , . , - , , , , (1) (2) ,

(1)     . , ( )

13.15 1-- T .

. , , , A, ; ', 13.8. , , , "0" "1".

A, , d, N-1 . , A; N-1 .

, p N-l

, , ( ) , . , ' .

. , N-1 .

. , , N-1

1: A. ; N-1

2: , r, A. N-1 , r. , r , , , r , , ,

, .

. A, 0, 1; .

, ' , , 1-- . 13.8. o

. , , , . , , . , 13.2 ; , , , (, ); , .

13.15 , , ,

, , , [BMZ90]. .

13.4

13.8 , , . , 0, ; . 9. , , ; [BT85]. (t < N/2 t < N/3, ) .

, , , .

(1)     . ,

() ; Las Vegas ( 9.1.2).

, . , . ( 9), .

, , . ; N-t . R(q, p, k) , k p (-k) q N-t . ,

(1)    

(2)    

, 13.4 , ( ). , , ( ).

13.4.1 -

. t < N/2 , t < N/2.

13.16 t--

. , P, .

13.17 P .

. 13.6; . o

S, S-, 0- 1- S. S-0- , S, 0- , 1- , , S-1- .

, S T,

13.18 S-1- T-1-.

. , , S T ; , , . o

13.19 P .

. , S-l- T-1- ( 13.18). , , ( ) 0- S-v- T-v-. p - , S-1- S-0-; o

P 13.17 13.19; 13.16 . o

- . - , [BT85] : k ( ) N-t k. (. 13.10).

, p 0 1 . - , (1 ); , N/2, . -, , . p k, p k+1; p . , , t ; , . 13.3.

var : (0, 1) init (* p*)

: integer init 0 (* *)

: integer init 1 (* p*)

: integer init 0 (* *)

: integer init 0 (* *)

begin

while do

begin

shout

while do

begin receive;

if r > then (* *)

send< vote, r, v, w> to p (* *)

else if r = then

begin

if w > N/2 then (**)

end

else (*r <

end;

(* : *)

if then

else if then

else if then

else

(* , t *)

if then

end;

(* *)

shout

shout

end

13.3 -

, ; . , , N-t ; , N-t , . , , - - ( 13.24).

13.20 .

. , k, p v, q w; k > 1, 1 . , k-1, p N/2 v, q N/2 w. N ; , p q , , r, v- p w- q. , v =w. o

13.21 , , .

. k , , p - , k, v - p. , k v-; , 13.20 , k.

k t v ( p), , v- k. , , k + 1, v ( , p k + 1). , , k + 1, v.

k + 1 v-, , k + 2 v (p ). , k + 2 , , N-t v- v. o

13.22

. S - N-t ( ) , . , , , S N-t S,

, S , -t .

Pr [ S k + 2]

. o

13.23 v, v 2.

. v 1, v 2. , . o

13.24 13.3 - , t-- t < N/2.

. 13.22, - 13.21; 13.23. o

13.11.

13.4.2 -

, , , . ( , , ( S), , ,

13.25 t-- .

. , , . (, , ).

, S T ,

13.26 S-0- T-0-, S-1- T-1-.

. , t , , . , , S T , , - , S ( T) v ( , , . S , v- S. S, T , T. , -, . o

13.27 .

. , , S-1- T-1- ( 13.26). , , 0- (, S T). S-v- T-v-. p - , S-1- S-0-; o

. 13.25 . o

p

r

q

r

p


13.4 , .

- . t < N/3, t-- . , , . p r r q ( 13.4), . , p , r.

- , - ( 13.5) . , , . (t < N/3) -; (N + t) /2 .

, , , . , . . , , r p q, p q, r ( ).

. ( initial, in), , , ( echo, ec). , (N+t)/2 . () ( 13.28), ( 13.29). ( 13.30).

, p v- r k, p . , p k N-t , p .

var : (0, 1) init

: integer init 0;

: integer init 0;

: integer init 0;

repeat forall do begin end;

shout

(* N-t *)

while do

begin receive from q;

if q

then skip (*q , , *)

else if t=in and

then skip (*q , , *)

else if

then (* *)

send to p

else (* *)

case t of

in: shout

ec: if then

begin

if

then

end

else skip (* *)

esac

end;

(* *)

if then else

if then

until false

13.5 - .

13.28 p k v r, r v k.

. p (N+t)/2 () ; s p. s p r, , r , r v k. o

13.29 p q r k, .

. , k p v- r, q w-. , p (N+t)/2 , q (N+t)/2 . N , , , t p q. , , v = w. o

13.30 k, , .

. r, k p N-t , p v- r k, N-t . , p N-t . o

- .

13.31 ( ) v k, v k .

. S - (N + t)/2 , p v- k. q k N-t , S. 13.29, q (N-t)/2 v-, , q v k.

, v , , v l; , v l+1. l+1 N-t , (N-t)/2 . 13.28, (N-t)/2 v-, , , v l+1. o

13.32 Pr [ p k] = 0.

. S - N-t , p k. > 0 S k N-t , k + 1, S. , S k + 1 k + 1.

Pr [ p k + 2]

p k],

. o

13.33 v, v.

. 13.31 , v . o

13.34 13.5 - , t-- t < N/3.

. 13.32 - 13.31; 13.33. o

13.12. 13.5 ; , , . v k p "" . k. , p v , ( 13.31). , - , p , .

13.5

. , c , g, , . , , , :

(3)     . , ( ) .

, , , , , .

13.35 1-- , , , , , , .

. . ; ,

(1)     , "1"

, ; S = P {g}, , 0-.

(2)    

o

, ( ) ( ). , () , , .

13.36 t-- - , .

(1)     . , . , .

(2)     . , .

(3)     . , .

, , 13.25, t < N/3. [BT85], 13.6, : (initial) ( in), (echo) ( ec), (ready) ( re). , , , .

, . , , . (N+t)/2 v, . , , ( 13.37). t ( , ) . 2t ( , t ) . 13.6 , , .. .

var : integer init 0;

ëÿ : shout

Äëÿ âñåõ ïðîöåññîâ:

while do

begin receive from q;

if q

then skip (*q , *)

else if t = in and

then skip (*q g, , *)

else begin

case t of

in: if then shout

ec: if

then shout

re: if then shout;

if then

esac

end

end

13.6 - .

13.37 .

. ( ), .

p - , v, q - , w. , , . - , t+1 , , . , p v- (N+t)/2 q w-- (N+t)/2 .

N t < N/3, t , r, p v-, q w-. r , v = w.

o

13.38 , .

. v, v 2t , t ; 13.37 .

, p v; p 2t , t . , p, , , t . , , , , N-t > 2t .

o

13.39 , .

. , , . , , , , t . , , , t . , , , .

, , . , N-t > (N+t)/2 . , N-t > 2t . o

13.40 13.6 - t-- t < N/3.

. 13.39 13.38, - 13.38, - 13.39. o

13

13.1

13.1 13.3 (, , ) . , .

13.2 13.6 , N .

, 1- .

(1)     , ( , 1) .

(2)     () , .

(3)     , , .

13.2

13.3 , t--- .

13.3

13.4 , .

13.5

{ (S, r): and

[1, ..., K].

13.6 13.2 ?

13.7 13.15 , k .

13.8 [k, l]-, . , 0 ("") 1 (""), , 1 k l ().

(1)     [k, l]-?

(2)     , 1-- [k, k]- ( 0 < k < N).

(3)     t-- [k, k+2t]-a.

13.4

13.9 , ?

?

13.10 , , k - ( 13.3), k.

13.11

(1)     , (N+t)/2 - ( 13.3) v, v .

(2)     , (N-t)/2 v, v .

(3)     v , (N-t)/2 v?

(4)     ?

13.12

(1)     , , (N+t)/2 13.5 v, v-.

(2)     , (N+t)/2 13.5 v t < N/5, v- .

13.5

13.13 , t>N/3 t-- .

13.14 , 13.6 N (3N + 1) .

INCLUDETEXT "E:\DISTR\(14)Shabounin.doc" 14

, . , , . , , .

, ; , , , . , ; .

14.1 ; (t < N/3), . ; , , . ( 13.8), ( ), .

( "") , , (forwarding) . 14.2 , . , . , . , .

14.1 14.2 , (); . 11. 1-- . ( , , ; . 11.3).

, , ( 11.1.3), , . , . - , , 14.3.

14.1

- () ; , 11.1.1. , 1, 2, 3, ; , . (i- ( i, ,

- .

(1)    

(2)    

, (1) (2) . (. 11.1.3). 11, - . , . , . 11 , , . , 14.3.

, , . , , , , , .

- g, (general), (lieutenants). .

(1)     . p

(2)     . .

(3)     . ,

, , , , . , , ; . 14.2.6.

14.1.1

, ( 13.25), t < N/3. , [PSL80] N/3 . , 13.25, , , . , , , , .

14.1 t-- t>N/3 .

. , N/3 (S, T, U), . , , S. , 14.1, .


14.1 14.1.

0 0, U ; 1 1 T . i 0 U T , ( ) 1 . ( , , , i-1 1.) S , . S T, , . , U , , , T, 0.

1 , T , 0. U 1.

2, S . T 0 U 1. , , T U (, U T) - , 0 ( 1, ). , T 2 0 U 1. , T 0, U 1. . o

, 1-, 0-. , "" , , . , 14.2; N-1.

14.1.2

, , , . , , . , [PSL80], t t < N/3. - .

Broadcast(N, 0) 14.2; (t = 0), , 1 . , , ( ), , .

1:

.

1.

:

if g 1 c

then x

else udef

14.2 Broadcast (N, 0).

t>0 ( 14.3) t-1. 1, , , t-1. - , ( ) t , Broadcast. , , t f (. 14.3). t+1 , p N-1 . N-1 major, , , v W, ( , , major(W)=v.

1:

.

1.

p .

if g 1 c

then else

,

(t+1): t + 1.

p:

q .

:=

14.3 (N, t) ( t> 0).

14.2 () Broadcast(N, t) 1, t+1.

. , t.

Broadcast(N, 0) ( 14.2), 1.

Broadcast(N, t) , Broadcast(N-1, t-1), 2. 1, t ( - ), 2, t + 1. Broadcast(N, t). o

( ) , , t N-1 . t < (N - l) /3 , , , , f.

14.3 () , f , N > 2f+t, .

. Broadcast(N, 0) , , .

, Broadcast(N-1, t-1). , 1, q t (N - 1) > 2f + (t - 1), , f . , p q, p Broadcast(N-1, t-1) major p o

14.4 () .

. , , , . t-l , , !

, t < N/3 t - 1 < (N - 1) / 3, , . , q major . o

14.5 Broadcast(N, t) ( 14.2/14.3) - t-- t < N/3.

. 14.2, 14.3, 14.4. o

Broadcast (t + 1)- , ; . 14.2.6. , ; . 14.1.

14.1.3

[DFF+82], . , ; 2t+3 . , N = 3t + 1, N > 3t + 1.

, L = t + 1 H = 2t + 1. , (1) L , (2) H L , (3) H . , L H, .

, v 1, (bm broadcast message, .) p R, , p q. , , ( 14.4). , , , , . , , p, q, r :

Broadcast , 0 1. 0 - , . 1, , , , 1.

: , .

(1)     . p q i, p , q ; , p i. p q, p q. p q, p L .

(**)

(**)

, q, q . , , q, i - , . q , q - . , q.

(2)     . p q H , ,

, , p q, q . , , p q i. p H , ( ) L q. q , , i L q i + 1. , i + 1 , H, , q.

(3)     . p , , 1. , p . , (1) p - bm, 1> 1, (3) p . , , "" , . L , , 4 . , (3) , i, . , ,

r i, r i + 2. , r i + 1, () r i + 2, H .

2t + 3 ; p H ( ) , p 1, p 0. . 14.4.

var : boolean init false

: boolean init if then true else false;

i: (* *)

if then shout;

forall do shout;

i;

(* *)

if i = 1 and then

if then

if i = 2t + 3 then (* *)

if then else

14.4 .

, , ( ) . , , , , H 1. , " " , .

14.6 14.4 ( ) .

. , 2t + 3, . , , .

1, 1, q . , q 2, 2 p . , 3 p q, 3 , q. 3 H , , 1. ( .)

0, 1, . , 1 i-1; i. i , , , , . , i. , . , , t , - 0. o

, , . " " , 1-, L , .

14.7 L i, i < 2t, 1.

. i - , L , , i. A - , . i + 2 ; , .

i = 1: 3, ,

i, Th(i) ( 1). Th(i) i + l, r Th(i) , r i + 1. , r i + 2; Th(i) + 1 i + 2. , Th(i+2)= Th(i)+1, .

, i + 2, ( ) i + 4, H . , i < 2t, o

, 1, "", L . , 1- H , L , . , 1- , 14.7. , - , , , , 2t + 3, , . - ; , L , .

14.8 , L , i - , L . i < 2t.

. 2t , Th(2t) = L + (t-1) . , t-1 , L , , , , L , , . o

14.9 ( 14.4) - t-- .

. ( ) 14.6. , , , 1. , , L . 14.8, i < 2t. 14.7, 1. o

, , , . , , , . , N+1 , log N) .

3t + 1, 3t . ( , , 3t , g . , , t . -

14.2

, . , , 14.1 . , , , 1, 0.

. p, , p . , , . .

(1)     M.

(2)     S) M.

. , , . , .

14.2.2 14.2.5. , , p, , , msg> : p.

14.2.1

, t+1 , [DS83]. , , . , , N ( N), N , ; t < N. , , [LSP82], . .

1

2 t + l , ; , , i, i . : g : : ... : ( ) p, .

(1)    

(2)     i i .

(3)     p .

, p , , p; , .

, i - , . t + 1, p {v}, p v, p (, 0). , p : g : : ... : : p , g, ...,

14.10 , - t < N, t + 1 .

. t + 1, .

v, : g 1, v W. W, . , t + 1 W = {v} v, .

, , p q, t + 1. , t + 1, i - , p v Wp, : g : : ... :

1: q g, ...,

2: q g, ..., : g : : ... : : p q i + i, q ( ) v i + 1.

3: q g, ...,

t + 1, p q . o

t + 1 . t, , , , .

, , , ; [DS83], . , t + 1, (a) p - , (b) p

W. , , p , , p. .

14.11 , - -, t + 1 .

. , , t + 1. , . g v , v , ; , v. , () .

, , p q, t + 1 .

(1)    

(2)    

(1): , p v : g : : ... : i, 14.10:

1: q g, ...,

2: q g, ...,

3: q i = t + 1, , , r, . r v q, , v

(2): , , w - , p. , , p .)

(1) (2), , p q, , , {v}; - , (2). , q v. , , p , - . , q (1) (2); , q .

o

, - (Nt) .

14.2.2

p , p - , ,

(1)     p ();

(2)     p ().

, , , , , . , , , ( ) , . , - ; () , , , .

, , , , , , . (1) (2) , p "" ; - p, ( ) p. , , , () . , p , p

, , S, , S p. , p; - p. , , p .

, , . , , ( ). , ( , ), . , .

14.2.3

[EIG85] . P, P, . ,

, ïåðâîîáðàçíû êîðí P. ; . P g, i P-1 , ( i ( ) x. , . - - , , ; . [0dl84] .

[EIG85] . P ïåðâîîáðàçíû êîð g d, 1 P - 2, p -

- (r, s), p d. p a, P-1,

(

. p, d, , e, , P. , , .

[0dl84]. , , P. , P g, , , . Q P-1, Q; , P , P-1 . , , . , P g , , , P .

( ). [1] . , , , . ; p , a, p; . 14.6.

14.2.4 RSA

n - , P Q, n, . , n (. 14.7), , , .

, [RSA78], p - n, p , e. p - e- n, , . p ; p d , - e- . p d, , p n.

RSA, p n, () n ; , p . .

14.2.5 -

() [FS86]. RSA , , , . - n, . p ( p), p , , .

- RSA - . - , . , n, , . - f,

. p k n, p, p, . , , k - n. , n.

: . p , ; , . p r , (x, y), .

, . -, , : y, f y. , p .

(1)    

(2)    

(3)    

(

(

(1)    

(2)    

, z, x, k f (, z) ...

.

(1)     ...

(2)    

(3)     ... (

(3) .

k = 72 1,5 , . , k , k - , . , k , t. , kt f-, t

(1)     p

(2)     p f (,

(3)     p (

(

(1)    

(2)    

, , , k t .

14.2.6

, . - t < N/3, ( 14.1), , ( ). , , ( ) ; 14.3.

. , , , - , , , ( 1 ). , , , () . ( , ) (, , ). . , (), , . :

(1)     . , .

(2)     . , .

(3)     . , .

, , ; , , , . , - , , , , .

. , t + 1 2t + 3 , . [FL82] , t + 1 - t- , , , [DS83].

- , 1 t, - . , , , . . , [DRS82] f + 2 f . [BGP92].

, , . , , . (, , t + 1; t , t + 1 , .) , . [CD91], , , , , t + 1 , ( ) . , t + 1 .

. , , . , , . , :

(1)     . p .

(2)     . .

(3)     . q , p,

: , p q

(), ( ). , , , , . (; ).

14.3

, ( ) , . , . , . , (ABD (asynchronous bounded-delay) - ).

. (real-time frame), . , ; , . , , , . p ( ). , ;

(C, T) , (c, t) - . ,

when then send message

r

, , , ( , , C,

(14.1)

, , . t, T, - .

(14.2)

, (14.1) (14.2) , .

14.3.1

, p s. -

14.12

. , , . , , T +

, ;

T

T

D

T

T

D

s

1

p

s

2

p


14.5 .

, ; p s , p . , 14.5. , , s p .

, p s , ;

( o

p q ,

, [Cri89]. , - , ( ) x - F(x), . , , x>

; p , s , s . p I ;

14.13

. , p - - . o

, p . ,

14.3.2

t-- ( t < N/3) [MS85]. , [DHS84] ,

- , . . - , . , . , S, R, , , , .

: . , [MS85] , p

var : real; (*, , V *)

: multiset of real;

begin (* *)

forall do send to q

wait (* *)

while do insert (

(* *)

while do insert(

end

q:

send

q:

if q

then insert(

14.6 .

, 14.6. intvl(A)=[min(A), max(A)] width(A) = max(A) - min(A). . p ( ) . , p , . () , .

, , . N-t , N-t , ; .

- , estimator .

14.14

. - , r, p ( , - r, p ( - 0,

, , p r - , , r', , r p, ,

, p q, -t r, -t r, r ,

, p q,

=

=

=

o

; i , estimator; , r p

. , , . ,

(1)    

(2)    

, ( 14.12), . , , p ( p -

var : real; (*, , V *)

: multiset of real;

begin (* *)

forall do send to q

wait (* *)

while do insert (

(* *)

while do insert(

end

q:

send

q:

if q

then

14.7 .

, 14.7 , , p r p ( ).

14.15 p, q, r, p

. q p 14.12. p ,



[1] - ; -


PAGE # "': '#'
'"  [AK1]

TOC t "chap_number;1;chap_name;1;sc;2;ssc;3" 㠠 PAGEREF _Toc423280427 h 6 1 :

 

 

 

! , , , .
. , :