of 14/14
Hc Vin Công Ngh Bưu Chính Vin Thông Khoa Công Ngh Thông Tin Môn Cơ  Sở  Dữ  Liu Phân Tán PHÂN MNH DC Ging V iên Hướng Dn : TS. Phm Thế Quế  Nhóm Thc Hin : Nhóm 2 –  Lp D10CNPM2

# Slide Thuat Toan Tu Nhom

• View
221

0

Embed Size (px)

### Text of Slide Thuat Toan Tu Nhom

• 8/13/2019 Slide Thuat Toan Tu Nhom

1/14

HcVinCng NghBuChnh VinThngKhoa Cng NghThng Tin

Mn CSDLiuPhn Tn

PHN MNH DGing Vin Hng Dn: T

Nhm Thc Hin : Nhm 2

• 8/13/2019 Slide Thuat Toan Tu Nhom

2/14

3. Thut Ton TNhm

Sohpdnchung AM ( Global Affinity Meansure ):

AM = =1 =1 ff(Ai,A j )[aff(Ai,A j-1) + aff(Ai,A j+1 )]

Cuni(bond) 2 thuctnh Axv Ay nhnghanhsau:

Khi AM c thvitthnh

AM = =1 [bond(Aj,A j-1) + bond(Aj,A j+1)]

Songgp cathuctnh Akkhi tvo Ai v Aj : Cont(Ai, Ak, Aj) = AMnewAMold

= 2[cont (Ai, Ak) + cont (Ak, Aj)cont(Ai, Aj)]

Vysohpdnchung AM lnnhttngngvisonggp Cont lnnht.

• 8/13/2019 Slide Thuat Toan Tu Nhom

3/14

3. Thut Ton T Nhm

Thutton BEA - Bond Energy Algorithm (Thutton nnglngni):

Bond Energy Algorithm (BEA)Giithutnng lng lin kt: c s dncc thcth. BEA tm ra mttrnh tcc thc th (trong trng hp ny l sao cho lcht chung AM (global Affinity Measure ) l lnnht. KtquslhpdnCA (Cluster Affinity). Thutton gm3 bc:

Bc1: tct1 v 2 caAA vo ct1&2 trong CA.

Bc2: Gisc i ctctvo CA. Lylnltmttrong (n-i) c

tvo ctth(i+1) caCA, sao cho soAM tivtr l lnnht.Bc3: Spththng theo thtct

• 8/13/2019 Slide Thuat Toan Tu Nhom

4/14

3. Thut Ton TNhmThutton BEA - Bond Energy Algorithm

Input: AA:ma trn hp dn thuc tnhOutput: CA : Ma trn hp dn t nhmBegin

{Khi to , nh rng AA l ma trn n x n}

CA(.,1)AA(.,1)CA(.,2)AA(.,2)index 3While index

• 8/13/2019 Slide Thuat Toan Tu Nhom

5/14

3. Thut Ton T Nhm

Ch :

Trong bckhign, ct1 v 2 ctvo vtr 1&2 trong CA, v vyA2 c thocphicaA1.

NuAjl thuctnh tntri trong ma trnCA, kimtra nggp khi tthuctri caAj, khi bond (A0, Ak) = bond(A0, Aj) =0,

NuAjl thuctnh tnphicttrong ma trnCA v angkimtra thuctnh Akvo bn phicaAj, Khi bond (Aj, Ak+1) = bond(Ak, Ak+1) =0.

• 8/13/2019 Slide Thuat Toan Tu Nhom

6/14

• 8/13/2019 Slide Thuat Toan Tu Nhom

7/14

3. Thut Ton T Nhm

V d1 (2):

Gii:bond(A1,A3) = aff(A1,A1)*aff(A1,A3)+

aff(A2,A1)*aff(A2,A3)+

aff(A3,A1)*aff(A3,A3)+

aff(A4,A1)*aff(A4,A3)

= 45*45 + 0*5 + 45*53 + 0*3

= 4410

bond(A2,A4) = aff(A1,A2)*aff(A1,A4)+aff(A2,A2)*aff(A2,A4)+

aff(A3,A2)*aff(A3,A4)+

aff(A4,A2)*aff(A4,A4)

= 0*0 + 80*75 + 5*3 + 75*78

= 11865

• 8/13/2019 Slide Thuat Toan Tu Nhom

8/14

3. Thut Ton T Nhm

V d2 (1): cho ma trnlcht thuctnh AA sau:

Sdngthutton BEA tm ma trnthpdnCA.

AA =

• 8/13/2019 Slide Thuat Toan Tu Nhom

9/14

3. Thut Ton T Nhm

V d2 (2)

Gii:Chp ct1 v ct2 ma trnAA vo ma trnCA

(1) CA(*,1)AA(*,1)

(2) CA(*,2)AA(*,2)

CA = AA =

• 8/13/2019 Slide Thuat Toan Tu Nhom

10/14

3. Thut Ton T NhmV d2 (3).index=3

Whileindex n doindex 4 {thamn}For i from1 toindex1 by1 do

Tnh cont(Ai-1,Aindex,Ai)

i=1 tht( 0-3-1): cont(A0,A3,A1) = 8820i=2 tht(1-3-2): cont(A1,A3,A2) = 10150

Endforiukinbin, tht(2-3-4): cont(A2,A3,A4)= 1780loc =2 tht(1-3-2) c cont =10150 lnnhtForj fromindex toLoc by1 do {xo trnhai ma trn}CA(*, j) := AA(*,j-1)

index=index+1

• 8/13/2019 Slide Thuat Toan Tu Nhom

11/14

3. Thut Ton T NhmV d2 (4).

tA3 giaA1 v A2

AA =CA =

• 8/13/2019 Slide Thuat Toan Tu Nhom

12/14

3. Thut Ton T NhmV d2 (5).index=4

Whileindex n doindex 4 {thamn}

For i from1 toindex1 by1 do

Tnh cont(Ai-1,Aindex,Ai)

i=1 tht(0-4-1): cont(A0,A4,A1) = 270

i=2 tht(1-4-2): cont(A1,A4,A3) = - 5208

i=3 tht(2-4-3): cont(A3,A4,A2) = 23698

Endfor

iukinbin, tht(3-4-5): cont(A2,A4,A5)= 23730

loc =4 tht(1-3-2) c cont =10150 lnnht

index=index+1

• 8/13/2019 Slide Thuat Toan Tu Nhom

13/14

3. Thut Ton T NhmV d2 (6).

tA4 bn phiA2

AA =CA =

• 8/13/2019 Slide Thuat Toan Tu Nhom

14/14

3. Thut Ton T NhmV d2 (7).

index=5

Whileindex n do

index 4 {Khng thamn , ktthc vng while}

Spxplihng theo thtcc ct:

CA =

Documents
Documents
Documents
Documents
Documents
Technology
Documents
Documents
Documents
Education
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Documents
Technology
Documents
Documents
Documents
Documents
Documents
Documents
##### Nghe thuat lanh dao nhom 4
Economy & Finance
Documents