210 likes | 374 Views
Distributed Database Management Systems. Lecture 18. In the previous lecture. Continue with VF Information Requirement Attribute affinities. In this Lecture. Continue with VF Global Affinity Measure Bond Energy Algorithm. n. n. aff(A i , A j ) [aff(A i , A j-1 ) + aff(A i , A j+1 )
E N D
Distributed Database Management Systems Lecture 18
In the previous lecture • Continue with VF • Information Requirement • Attribute affinities Virtual University of Pakistan
In this Lecture • Continue with VF • Global Affinity Measure • Bond Energy Algorithm Virtual University of Pakistan
n n aff(Ai, Aj) [aff(Ai, Aj-1) + aff(Ai, Aj+1) + aff(Ai-1, Aj) + aff(Ai+1, Aj) ] AM = ∑ ∑ i = 1 j = 1 Virtual University of Pakistan
The AA is symmetric so Virtual University of Pakistan
n n n aff(Ai, Aj) [aff(Ai, Aj-1) + aff(Ai, Aj+1) + aff(Ai-1, Aj) + aff(Ai+1, Aj) ] AM = ∑ ∑ AM = ∑ bond(Aj, Aj-1) +bond(Aj, Aj+1) i = 1 j = 1 j = 1 n n n n ∑ AM = ∑ bond(Ax, Ay) = ∑ ∑ aff(Az, Ax)aff(Az, Ay) aff(Ai, Aj) aff(Ai, Aj+1) aff(Ai, Aj) aff(Ai, Aj-1) + i = 1 j = 1 i = 1 z = 1 Let Rather than taking.. We take only.. Virtual University of Pakistan
n AM = ∑ bond(Aj, Aj-1) +bond(Aj, Aj+1) J = 1 j = 1 Virtual University of Pakistan
n AM = ∑ bond(Aj, Aj-1) +bond(Aj, Aj+1) J = 2 j = 1 Virtual University of Pakistan
n AM = ∑ bond(Aj, Aj-1) +bond(Aj, Aj+1) J = 4 j = 1 Virtual University of Pakistan
Approach for VF • Find the combination that has the maximum Affinity Measure • It will represent best grouping among attributes Virtual University of Pakistan
We can find all possible AMs or • We can use the BEA (Bond Energy Algorithm) Virtual University of Pakistan
Bond Energy Algorithm AM1 AM2 AM3 A1, A2, …, Ai-1, Ai, Aj, Aj+1, ……, An AMold = AM1 + AM2+ AM3 AM2 involves Bond(Ai, Aj) twice Virtual University of Pakistan
BEA A1, A2, …, Ai-1, Ai, Ak, Aj, Aj+1, ……, An AM1 AM2 AM3 AMnew = AM1 + AM2+ AM3 AM2 involves Bond(Ai, Ak) and Bond(Ak, Aj) twice Virtual University of Pakistan
BEA Contribution cont(Ai, Ak, Aj) is the contribution in AM when placing Ak between Ai and Aj Cont(Ai, Ak, Aj) = AMnew- AMold = 2Bond(Ai,Ak) + 2Bond(Aj, Ak) – 2Bond(Ai, Aj) Virtual University of Pakistan
Steps in BEA Virtual University of Pakistan
Input: The AA matrix • Output: The clustered affinity matrix CA which is a permutation of AA • Initialization: Place and fix one of the columns of AA in CA. • Iteration: Place the remaining n-i columns in the remaining i+1 positions in the CA matrix. For each column, choose the placement that makes the most contribution to the global affinity measure. • Row order: Order the rows according to the column ordering. Virtual University of Pakistan
Bond Energy Algorithm Virtual University of Pakistan
Input AA • Output CA • Begin CA (•, 1) ← AA (•, 1) CA (•, 2) ← AA (•, 2) Index ← 3 Virtual University of Pakistan
While index ≤ n do Begin For I from 1 to index –1 by 1 do calculate cont(Ai-1, Aindex, Ai) end-for Calculate cont(Aindex-1, Aindex, Aindex+1) Loc ← placement given by maximum cont value For j from index to loc by –1 do CA (•, j) ← AA (•, j-1) end-for CA (•, loc) ←AA (•, index) Index ← index + 1 End-while Order the rows according to relative order of columns End {BEA} Virtual University of Pakistan
Thanks Virtual University of Pakistan