’<br />
Tap ch´ Tin hoc v` Diˆu khiˆn hoc, T.23, S.2 (2007), 184–200<br />
ı<br />
e<br />
e<br />
.<br />
. a `<br />
.<br />
<br />
’<br />
’<br />
´<br />
ˆ<br />
´<br />
ˆ<br />
PHAT TRIEN CAC GIAI THUAT SONG SONG<br />
.<br />
.<br />
´<br />
´<br />
ˆ<br />
ˆ<br />
TRONG KHAI PHA LUAT KET HO P<br />
.<br />
.<br />
˜<br />
ˆ<br />
NGUYEN LONG GIANG<br />
<br />
Viˆn Cˆng nghˆ thˆng tin, Viˆn Khoa hoc v` Cˆng nghˆ Viˆt Nam<br />
e<br />
o<br />
e o<br />
e<br />
e e<br />
.<br />
.<br />
.<br />
. a o<br />
.<br />
.<br />
Abstract. In this paper we present two parallel algorithms for mining association rules that are well<br />
suited for distributed memory parallel computers. The algorithms are developed based on FP-growth<br />
method. The first algorithm is a task parallel formulation using a static load balancing technique.<br />
The second algorithm improves upon the first algorithm by dynamically balancing the load when the<br />
static task assignment leads to load imbalance. We use the count matrix technique to compute the<br />
weight of tasks and to distribute tasks to processors. This technique also helps to reduce the time<br />
needed to scan the trees and to reduce communication cost. We also use the hash tree technique<br />
to group similar prefix-paths extracted from the tree, and thus can greatly reduce the amount of<br />
information exchanged among processors. Our experiments show that the algorithms are capable of<br />
achieving very good speedups, and of substantially reducing the amount of time when finding frequent<br />
patterns in very large databases.<br />
´<br />
´ .<br />
’<br />
’ .<br />
e<br />
a<br />
a<br />
a e<br />
e<br />
T´m t˘t. B`i b´o n`y gi´.i thiˆu hai giai thuˆt song song khai th´c luˆt kˆt ho.p su. dung trˆn<br />
o<br />
a<br />
a a a<br />
o<br />
.<br />
.<br />
.<br />
’<br />
’<br />
c´c m´y t´ song song c´ bˆ nh´. phˆn t´n. C´c giai thuˆt du.o.c ph´t triˆn trˆn phu.o.ng ph´p<br />
a<br />
a ınh<br />
o o<br />
o<br />
a a<br />
a<br />
a<br />
a<br />
e<br />
e<br />
a<br />
.<br />
.<br />
.<br />
´<br />
’ .<br />
’ ınh.<br />
’<br />
e ınh a<br />
a<br />
y<br />
a a `<br />
a<br />
FP-growth. Giai thuˆt th´. nhˆt thu.c hiˆn t´ to´n song song su. dung k˜ thuˆt cˆn b˘ ng tai t˜<br />
a<br />
u<br />
.<br />
.<br />
.<br />
.<br />
. hai du.o.c ph´t triˆn du.a trˆn giai thuˆt th´. nhˆt su. dung k˜ thuˆt cˆn b˘ ng tai dˆng<br />
’<br />
`<br />
´<br />
’<br />
’<br />
’ o<br />
Giai thuˆt th´<br />
a<br />
u<br />
a<br />
e<br />
e<br />
a<br />
u a ’ .<br />
y<br />
a a a<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
’<br />
´<br />
´<br />
´<br />
’ ’<br />
e ınh a<br />
o ’ a<br />
y<br />
a<br />
a e<br />
khi mˆt cˆn b˘ ng tai xay ra. B`i b´o su. dung k˜ thuˆt ma trˆn dˆm dˆ t´ to´n trong sˆ cua c´c<br />
a a `<br />
a<br />
a a ’ .<br />
.<br />
.<br />
.<br />
’<br />
´<br />
’<br />
u<br />
o ’ y<br />
y<br />
a a<br />
e<br />
o<br />
e a<br />
t´c vu v` phˆn phˆi c´c t´c vu t´.i nh˜.ng bˆ xu. l´ . K˜ thuˆt n`y giam thiˆu th`.i gian duyˆt cˆy<br />
a . a a<br />
o a a<br />
.<br />
.<br />
.<br />
. o<br />
’<br />
`<br />
’ .<br />
v` giam b´.t chi ph´ truyˆn thˆng gi˜.a c´c bˆ xu. l´ . B`i b´o c˜ ng su. dung k˜ thuˆt cˆy b˘m dˆ<br />
a ’<br />
o<br />
e<br />
a a u<br />
y<br />
a a a<br />
ı<br />
e<br />
o<br />
u a o ’ y<br />
.<br />
.<br />
’<br />
` n tˆ du.`.ng di giˆng nhau tr´ loc t`. cˆy, v` nhu. vˆy giam thiˆu lu.o.ng thˆng tin trao<br />
´ o<br />
´<br />
’<br />
a<br />
a<br />
e<br />
o<br />
nh´m c´c tiˆ o<br />
o<br />
a e<br />
o<br />
ıch . u a<br />
.<br />
.<br />
’<br />
´ ´ ´ a<br />
´<br />
´<br />
’<br />
’<br />
’<br />
dˆ i gi˜.a c´c bˆ xu. l´ . Kˆt qua thu. nghiˆm cho thˆ y c´c giai thuˆt dat du.o.c dˆ t˘ng tˆc rˆ t tˆt, v`<br />
o u a o ’ y e<br />
o a<br />
o a o<br />
e<br />
a a<br />
a .<br />
.<br />
.<br />
.<br />
.<br />
.<br />
’ ´<br />
’ a<br />
’<br />
˜<br />
´<br />
’<br />
ım e<br />
a<br />
a<br />
o e<br />
a<br />
o<br />
giam thiˆu d´ng kˆ th`.i gian t` kiˆm c´c mˆ u phˆ biˆn trong c´c CSDL l´.n.<br />
e<br />
e o<br />
<br />
´.<br />
ˆ<br />
1. GIO I THIEU<br />
.<br />
B`i to´n khai th´c luˆt kˆt ho.p (Association Rule Mining - ARM) du.o.c Agrawal, Imielinski<br />
a a<br />
a a e .<br />
.<br />
. ´<br />
.i thiˆu lˆn dˆu tiˆn. B`i to´n n`y tˆp trung t` kiˆm nh˜.ng mˆi quan hˆ c´ ´<br />
´<br />
´<br />
e ` `<br />
a a<br />
o<br />
e o ıch<br />
v` [1] gi´<br />
a<br />
o<br />
e<br />
a<br />
a a a<br />
ım e<br />
u<br />
.<br />
.<br />
.<br />
’<br />
˜ u e<br />
´ .<br />
` m ˆ n gi˜.a c´c mˆu d˜. liˆu trong mˆt CSDL. C´c luˆt kˆt ho.p d˜ v` dang du.o.c su. dung<br />
a<br />
o<br />
a<br />
a e<br />
tiˆ a<br />
e<br />
u a<br />
a a<br />
.<br />
.<br />
.<br />
. ’ .<br />
˜<br />
´<br />
´ ´<br />
´ e<br />
’<br />
u o .<br />
e .<br />
e e<br />
rˆ t hiˆu qua trong mˆt loat c´c u.ng dung t`. hˆ tro. ra quyˆt dinh, du. b´o, y tˆ, tiˆp thi v`<br />
a<br />
o<br />
.<br />
. a<br />
. a<br />
.<br />
.<br />
. a ´<br />
’<br />
quan tri kinh doanh. . .<br />
.<br />
Cho I l` mˆt tˆp c´c muc trong CSDL giao dich. Mˆt giao dich T ⊆ I du.o.c dinh ngh˜<br />
a o a a<br />
o<br />
ıa<br />
. .<br />
.<br />
.<br />
.<br />
.<br />
. .<br />
`<br />
´<br />
o<br />
o<br />
a e .<br />
u a<br />
o<br />
o<br />
l` mˆt tˆp c´c muc du.o.c sinh ra dˆ ng th`.i trong mˆt giao dich. Mˆt luˆt kˆt ho.p gi˜.a tˆp<br />
a o a a<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
. .<br />
.<br />
˜<br />
`<br />
’<br />
’ a<br />
’ a<br />
muc X ⊆ I v` tˆp muc Y ⊆ I , biˆ u diˆn X → Y , chı ra r˘ ng kha n˘ng hiˆn diˆn cua c´c<br />
a a<br />
e’<br />
e<br />
a<br />
e<br />
e<br />
.<br />
.<br />
.<br />
.<br />
.<br />
`<br />
`<br />
’ a<br />
phˆn tu. X trong giao dich c˜ng k´o theo kha n˘ng hiˆn diˆn cua phˆn tu. Y . Dˆ do du.o.c su.<br />
a ’<br />
o<br />
u<br />
e<br />
e<br />
e ’<br />
a ’<br />
.<br />
.<br />
.<br />
.<br />
. ’<br />
<br />
.<br />
’<br />
’<br />
´<br />
´<br />
ˆ<br />
´<br />
ˆ<br />
´<br />
ˆ<br />
ˆ<br />
PHAT TRIEN CAC GIAI THUA T SONG SONG TRONG KHAI PHA LUAT KET HO P<br />
.<br />
.<br />
.<br />
<br />
185<br />
<br />
’<br />
dung dˆ d´nh gi´ m´.c dˆ kˆt ho.p cua luˆt l` dˆ hˆ tro. (support ) v` dˆ tin cˆy (confidence ).<br />
a a o o .<br />
a o<br />
e’ a<br />
a u o e .<br />
a<br />
.<br />
.<br />
. ´<br />
. ˜<br />
.<br />
.<br />
. cua luˆt X → Y l` ty lˆ gi˜.a sˆ giao dich ch´.a ca X v` Y v´.i tˆ ng sˆ giao dich<br />
’<br />
˜<br />
´<br />
´<br />
a<br />
a ’ e u o<br />
u ’<br />
a<br />
o o<br />
o<br />
Dˆ hˆ tro ’<br />
o o .<br />
.<br />
.<br />
.<br />
.<br />
.<br />
. so. d˜. liˆu. Dˆ tin cˆy cua luˆt X → Y l` ty lˆ gi˜.a sˆ giao dich ch´.a ca X v` Y<br />
´<br />
u ’<br />
a<br />
o<br />
a ’<br />
a<br />
a ’ e u o<br />
trong co ’ u e<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
`<br />
´<br />
u<br />
o a<br />
o<br />
a<br />
v´.i sˆ giao dich ch´.a X . Mˆt tˆp ho.p gˆ m c´c muc (item) trong CSDL goi l` mˆt tˆp muc<br />
o o<br />
.<br />
. .<br />
.<br />
.<br />
. a o a<br />
. .<br />
.<br />
.i k muc goi l` mˆt tˆp k muc (k-itemset). B`i to´n khai th´c d˜.<br />
(itemset). Mˆt tˆp muc v´<br />
o a<br />
o<br />
a a<br />
a u<br />
. .<br />
.<br />
.<br />
. a o a<br />
. .<br />
.<br />
´<br />
´ a ’ a a<br />
´<br />
a e .<br />
a<br />
o<br />
o<br />
u a ım e<br />
liˆu su. dung luˆt kˆt ho.p du.o.c chia th`nh hai bu.´.c. Bu.´.c th´. nhˆ t t` kiˆm tˆ t ca c´c tˆp<br />
e ’ .<br />
. ´<br />
.<br />
.<br />
.<br />
˜ . o<br />
˜ . o<br />
’ biˆn, l` tˆp muc xuˆ t hiˆn trong CSDL v´.i dˆ hˆ tro. l´.n ho.n dˆ hˆ tro. tˆi thiˆ u.<br />
´<br />
´ e<br />
o o<br />
e’<br />
muc phˆ e a a<br />
o ´<br />
a<br />
o o o<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.<br />
’ ´<br />
o<br />
u<br />
a<br />
a ` a<br />
a a<br />
o e<br />
Bu.´.c th´. hai du.ng c´c luˆt tiˆm ˆ n trong c´c tˆp muc phˆ biˆn.<br />
.<br />
. e ’<br />
.<br />
.<br />
.p du.o.c du.a ra, tuy nhiˆn ch´ng dˆu g˘p<br />
´<br />
`<br />
`<br />
’<br />
D˜ c´ rˆ t nhiˆu giai thuˆt khai th´c luˆt kˆt ho<br />
a o a<br />
e<br />
a<br />
a<br />
a e .<br />
e a<br />
e<br />
u<br />
.<br />
. ´<br />
.<br />
.<br />
. l´ nh˜.ng CSDL l´.n, v` viˆc t` kiˆm c´c giai ph´p<br />
´ e .<br />
´<br />
’ a ` e a<br />
’<br />
’<br />
phai vˆ n dˆ hiˆu n˘ng t´ to´n khi xu y u<br />
o<br />
a e ım e<br />
a<br />
a<br />
ınh a<br />
.<br />
˜<br />
´<br />
´<br />
´ .<br />
`<br />
’ e a<br />
’<br />
e<br />
a<br />
e a<br />
e<br />
e’<br />
e<br />
m´.i vˆn tro. nˆn cˆ p thiˆt. C´ch tiˆp cˆn song song mang lai nhiˆu triˆ n vong cho viˆc giai<br />
o a<br />
.<br />
.<br />
.<br />
`<br />
´ ´ e<br />
’<br />
’<br />
quyˆt vˆ n dˆ n`y. Muc tiˆu cua b`i b´o l` ph´t triˆ n c´c giai thuˆt song song nh˘ m t˘ng<br />
e a ` a<br />
e<br />
a a a a<br />
e’ a<br />
a<br />
a<br />
a<br />
.<br />
.<br />
.c hiˆn cua c´c giai thuˆt v` giam thiˆ u th`.i gian t´ to´n.<br />
’<br />
’ a<br />
’<br />
’<br />
hiˆu n˘ng thu<br />
e a<br />
o<br />
a a<br />
e<br />
e<br />
ınh a<br />
.<br />
.<br />
.<br />
.<br />
`<br />
` o . ’ a a o a<br />
´ u<br />
a<br />
o<br />
e<br />
a<br />
Phˆn c`n lai cua b`i b´o c´ cˆ u tr´c nhu. sau. Phˆn 2 gi´.i thiˆu phu.o.ng ph´p FP-Growth.<br />
a<br />
.<br />
. CSDL giao dich.<br />
’ ´<br />
`<br />
’<br />
Phˆn 3 ph´t triˆ n hai giai thuˆt song song khai th´c c´c tˆp phˆ biˆn t`<br />
a<br />
a<br />
e’<br />
a<br />
a a a<br />
o e u<br />
.<br />
.<br />
.<br />
`<br />
´ a a o<br />
` n 4 tr` b`y nghiˆn c´.u hiˆu n˘ng cua giai thuˆt. Phˆn 5 tr` b`y kˆt luˆn v` hu.´.ng<br />
’<br />
’<br />
e a<br />
a<br />
a<br />
ınh a e<br />
Phˆ<br />
a<br />
ınh a<br />
e u<br />
.<br />
.<br />
.<br />
´<br />
nghiˆn c´.u tiˆp theo.<br />
e u<br />
e<br />
. .<br />
´<br />
2. PHU O NG PHAP FP-GROWTH<br />
´ u u e<br />
’ .<br />
a<br />
a<br />
a<br />
Phu.o.ng ph´p FP-Growth su. dung cˆ u tr´c d˜. liˆu FP-Tree (Frequent Pattern Tree - cˆy<br />
.<br />
’ e<br />
’<br />
˜u phˆ biˆn)[5]. FP-Tree biˆ u diˆn c´c thˆng tin vˆ tˆn suˆ t cua c´c muc trong CSDL.<br />
˜ a<br />
` `<br />
´<br />
mˆ<br />
a<br />
o ´<br />
e<br />
e<br />
o<br />
e a<br />
a ’ a<br />
.<br />
˜<br />
’ ´<br />
˜<br />
’<br />
Mˆi nh´nh cua FP-Tree biˆ u diˆn mˆt tˆp muc phˆ biˆn, c´c n´t doc theo nh´nh du.o.c lu.u<br />
o<br />
a<br />
e’<br />
e<br />
o a<br />
o e<br />
a u .<br />
a<br />
. .<br />
.<br />
.<br />
. theo th´. tu. giam dˆn cua tˆn suˆ t c´c muc, n´t l´ biˆ u diˆn c´c muc c´ tˆn suˆ t nho<br />
’<br />
˜ a<br />
`<br />
´<br />
´<br />
’ `<br />
’<br />
u . ’<br />
a<br />
a<br />
a a<br />
u a e<br />
e<br />
a<br />
a<br />
tr˜<br />
u<br />
.<br />
. o `<br />
’ ´<br />
´<br />
´<br />
´<br />
e `<br />
nhˆ t (muc phˆ biˆn ´ nhˆ t). FP -Tree g˘n v´.i mˆt bang tiˆu dˆ (header table). C´c muc v`<br />
a<br />
o e ıt a<br />
a o o ’<br />
e<br />
a<br />
a<br />
.<br />
.<br />
.<br />
`<br />
´<br />
`<br />
´ ´<br />
’<br />
’<br />
u<br />
e `<br />
a ’ `<br />
a<br />
a<br />
u<br />
e<br />
u . ’<br />
a<br />
sˆ dˆm cua ch´ng du.o.c lu.u tr˜. trong bang tiˆu dˆ theo th´. tu. giam dˆn cua tˆn suˆ t. Dˆu<br />
o e<br />
.<br />
´<br />
`<br />
´ o a ’ a u<br />
’<br />
’ a mˆt muc ch´.a n´t dˆu danh s´ch liˆn kˆt v´.i tˆ t ca c´c n´t tu.o.ng u.ng cua FP-Tree.<br />
´<br />
a<br />
e e<br />
v`o cu<br />
a<br />
o<br />
u u a<br />
.<br />
.<br />
`<br />
Phu.o.ng ph´p FP-Growth bao gˆ m hai nhiˆm vu ch´<br />
a<br />
o<br />
e<br />
ınh: 1) xˆy du.ng FP-Tree, v` 2) khai th´c<br />
a<br />
a<br />
a<br />
.<br />
.<br />
.<br />
’ e ’ .<br />
˜u phˆ biˆn su. dung FP-Tree.<br />
´<br />
c´c mˆ<br />
a<br />
a<br />
o<br />
.ng FP-Tree<br />
Xˆy du<br />
a<br />
.<br />
`<br />
`<br />
`<br />
´<br />
´<br />
’<br />
a<br />
e<br />
a<br />
a<br />
e<br />
u<br />
a ım a ’<br />
Dˆ xˆy du.ng FP-Tree cˆn phai qu´t CSDL hai lˆn. Lˆn qu´t th´. nhˆ t t` tˆ t ca 1e’ a<br />
.<br />
’ biˆn. Sau d´ c´c muc n`y du.o.c ch`n v`o bang tiˆu dˆ, theo th´. tu. giam dˆn<br />
`<br />
’<br />
itemsets phˆ e<br />
o ´<br />
o a<br />
a<br />
e<br />
u . ’<br />
e a<br />
e `<br />
a<br />
.<br />
.<br />
’ ´<br />
´<br />
´<br />
`<br />
’ `<br />
a<br />
a ’ a<br />
o<br />
o e<br />
cua tˆn suˆ t. Lˆn qu´t th´. hai xˆy du.ng FP-Tree. Tˆ t ca c´c muc khˆng phˆ biˆn trong<br />
a<br />
a<br />
a<br />
e<br />
u<br />
.<br />
.<br />
´ ´<br />
`<br />
´<br />
’<br />
a<br />
u . ’<br />
a ’ `<br />
a<br />
a<br />
giao dich du.o.c lu.o.c bo. C´c muc c`n lai s˘p xˆp theo th´. tu. giam dˆn cua tˆn suˆ t, sau d´<br />
o<br />
.<br />
.<br />
. o . a e<br />
.<br />
´<br />
` o o o a<br />
e a<br />
a<br />
o<br />
a<br />
e<br />
o a<br />
u<br />
e ´<br />
du.o.c ch`n v`o FP-Tree th`nh mˆt nh´nh. Nˆu mˆt tˆp muc d`ng chung tiˆn tˆ v´.i mˆt tˆp<br />
.<br />
.<br />
. .<br />
.<br />
. .<br />
˜ a<br />
`<br />
` o ’<br />
e ´<br />
a<br />
a<br />
e’<br />
e .<br />
muc d˜ tˆ n tai trong cˆy, tˆp muc m´.i s˜ d`ng chung tiˆn tˆ cua nh´nh cˆy biˆ u diˆn tˆp<br />
a o .<br />
a a<br />
o e u<br />
.<br />
.<br />
.<br />
˜<br />
´<br />
´<br />
u<br />
o o e<br />
o e<br />
u o<br />
muc d´. Ho.n n˜.a, mˆt bˆ dˆm du.o.c g˘n v´.i mˆi n´t trˆn cˆy. Bˆ dˆm lu.u tr˜. sˆ giao dich<br />
. . ´<br />
. a o o u e a<br />
. ´<br />
.<br />
. o<br />
.a tˆp muc biˆ u diˆn bo.i du.`.ng dˆn t`. gˆc t´.i n´t. Bˆ dˆm n`y du.o.c cˆp nhˆt trong suˆt<br />
˜<br />
˜<br />
´<br />
´<br />
´<br />
’<br />
a<br />
ch´ a<br />
u .<br />
e’<br />
e<br />
o<br />
a u o o u<br />
o e<br />
a<br />
a<br />
o<br />
.<br />
.<br />
. .<br />
.<br />
` n qu´t th´. hai, khi mˆt nh´nh m´.i du.o.c ch`n thˆm.<br />
o<br />
a<br />
o<br />
e<br />
e<br />
lˆ<br />
a<br />
e<br />
u<br />
.<br />
.<br />
. dung FP-Tree<br />
’ ´<br />
’<br />
Khai th´c c´c tˆp phˆ biˆn su .<br />
a a a<br />
o e<br />
.<br />
’<br />
Cho muc i trong bang tiˆu dˆ cua FP-Tree Tα (α l` mˆt tˆp muc, v` Ti biˆ u thi FP-Tree<br />
e ` ’<br />
e<br />
a o a<br />
a<br />
e’<br />
.<br />
. .<br />
.<br />
.<br />
.o.c xˆy du.ng t`. CSDL ban dˆu), theo danh s´ch kiˆn kˆt b˘t dˆu tai muc i trong bang<br />
´ `<br />
`<br />
´<br />
’<br />
du .<br />
a<br />
a<br />
e e a a .<br />
a<br />
u<br />
.<br />
.<br />
˜<br />
´<br />
`<br />
tiˆu dˆ cua Tα , tˆ t ca c´c nh´nh ch´.a muc i du.o.c th˘m. C´c nh´nh d´ tao th`nh mˆu diˆu<br />
e ` ’<br />
e<br />
a ’ a<br />
a<br />
u<br />
o .<br />
a<br />
a<br />
e<br />
a<br />
a<br />
a<br />
.<br />
.<br />
<br />
˜<br />
ˆ<br />
NGUYEN LONG GIANG<br />
<br />
186<br />
<br />
’ ´<br />
˜<br />
´<br />
`<br />
’ ’<br />
kiˆn co. so. cua α ∪ i, v` vˆy h`ng ngang thu du.o.c tˆ t ca c´c muc phˆ biˆn trong mˆu diˆu<br />
e<br />
ı a a<br />
o e<br />
a<br />
e<br />
.<br />
.<br />
. a ’ a<br />
.<br />
. so. n`y. Tiˆp theo phu.o.ng ph´p FP-Growth xˆy du.ng FP-Tree diˆu kiˆn T , b˘ ng<br />
´<br />
`<br />
e<br />
a<br />
a<br />
e<br />
e α∪i `<br />
a<br />
kiˆn co ’ a<br />
e<br />
.<br />
.<br />
.<br />
’ ´<br />
´<br />
’ . ` `<br />
’<br />
a a<br />
a a<br />
o e<br />
e ` ’ o .<br />
e<br />
o<br />
viˆc kho.i tao lˆn dˆu bang tiˆu dˆ cua n´ du.a v`o c´c muc phˆ biˆn du.o.c t` thˆ y, sau d´<br />
e<br />
.<br />
. ım a<br />
.<br />
´<br />
´<br />
` `<br />
’<br />
tiˆn h`nh th˘m c´c nh´nh cua Tα theo danh s´ch liˆn kˆt cua i mˆt ho˘c nhiˆu lˆn v` ch`n<br />
e a<br />
a<br />
a<br />
a<br />
a<br />
e e ’<br />
o<br />
a<br />
e a a e<br />
.<br />
.<br />
c´c tˆp muc tu.o.ng u.ng v`o Tα∪i. Ch´ y r˘ ng th´. tu. cua c´c muc c´ thˆ kh´c nhau trong<br />
a a<br />
´<br />
a<br />
u´ `<br />
a<br />
u . ’ a<br />
.<br />
.<br />
. o e’ a<br />
´<br />
’ u<br />
’ . ’ e<br />
e<br />
a u<br />
e<br />
o<br />
Tα v` Tα∪i. Thu tuc o. trˆn du.o.c su. dung dˆ quy, v` d`.ng lai khi FP-Tree kˆt qua ch´.a mˆt<br />
a<br />
.<br />
. ’ .<br />
.<br />
.<br />
.`.ng di do.n duy nhˆ t. Tˆp dˆy du c´c tˆp muc phˆ biˆn du.o.c sinh ra t`. tˆ t ca c´c du.`.ng<br />
’ e<br />
´<br />
´<br />
’ a a<br />
du o<br />
a<br />
o ´<br />
a<br />
a `<br />
u a ’ a<br />
o<br />
.<br />
.<br />
.<br />
.<br />
’<br />
di do.n cua FP-Tree.<br />
.<br />
’<br />
´<br />
´<br />
´<br />
ˆ<br />
ˆ<br />
ˆ `<br />
3. CAC GIAI THUAT SONG SONG, THIET KE VA THU C THI<br />
.<br />
.<br />
´<br />
`<br />
’<br />
Phˆn chia CSDL ban dˆu v` t´<br />
a<br />
a<br />
a ınh d´ ng d˘ n cua phu.o.ng ph´p<br />
u<br />
a<br />
a<br />
’<br />
`<br />
`<br />
´<br />
`<br />
a<br />
o<br />
Nˆu N l` tˆ ng c´c bˆ xu. l´, CSDL ban dˆu du.o.c chia th`nh N phˆn b˘ ng nhau, sau d´<br />
e<br />
a o<br />
a o ’ y<br />
a<br />
a a<br />
.<br />
.<br />
.o.c g˘n v`o c´c bˆ xu. l´ kh´c nhau, v` du.o.c lu.u tr˜. trong bˆ nh´. cuc bˆ cua<br />
˜<br />
´<br />
`<br />
mˆi phˆn du . a a a o ’ y a<br />
o<br />
a<br />
a<br />
u<br />
o o .<br />
o ’<br />
.<br />
.<br />
.<br />
.<br />
˜ .<br />
´<br />
n´. Mˆi bˆ xu. l´ s˜ qu´t CSDL giao dich cuc bˆ mˆt lˆn v` liˆt kˆ nh˜.ng su. cˆ cuc bˆ. Sau<br />
o<br />
o o ’ y e e<br />
.<br />
. o o `<br />
. . a a e e u<br />
.<br />
. o . o<br />
.<br />
’ ´ a<br />
’<br />
´<br />
´ ´<br />
o e `<br />
e<br />
d´ tˆ t ca c´c bˆ xu. l´ s˜ thu du.o.c c´c muc phˆ biˆn b˘ ng viˆc trao dˆ i c´c sˆ dˆm cuc bˆ<br />
o a ’ a o ’ y e<br />
o a o e<br />
. a<br />
.<br />
.<br />
.<br />
. o<br />
.<br />
.i tˆ t ca c´c bˆ xu. l´ kh´c su. dung ph´p r´t gon tˆ ng to`n cuc (global sum-reduction). C´c<br />
’<br />
´ ’ a o ’ y a ’ .<br />
e u . o<br />
a .<br />
a<br />
v´ a<br />
o<br />
.<br />
’ ´<br />
´ ´<br />
`<br />
u . ’<br />
a<br />
muc phˆ biˆn n`y du.o.c s˘p xˆp theo th´. tu. giam dˆn theo dˆ hˆ tro. dˆ xˆy du.ng L, danh<br />
o e a<br />
o o . e’ a<br />
. a e<br />
.<br />
.<br />
. ˜<br />
˜ .<br />
’ biˆn. Ch´ y r˘ ng L giˆng nhau v´.i tˆ t ca c´c bˆ xu. l´. Mˆi bˆ xu. l´ qu´t<br />
`<br />
´<br />
´<br />
o o ’ y e<br />
s´ch c´c muc phˆ e<br />
a<br />
a<br />
o ´<br />
u´ a<br />
o<br />
o a ’ a o ’ y<br />
.<br />
.<br />
´<br />
´<br />
’<br />
e’ a<br />
d˜. liˆu cuc bˆ dˆ xˆy du.ng FP-Tree cuc bˆ, giˆng nhu. giai thuˆt xˆy du.ng FP-Tree. Dˆ n˘m<br />
u e . o e’ a<br />
a a<br />
.<br />
.<br />
.<br />
. o o<br />
.<br />
.<br />
.<br />
´<br />
r˜ tiˆn tr` n`y, x´t v´ du sau.<br />
o e<br />
ınh a<br />
e ı .<br />
´<br />
’<br />
V´ du 1. Cho CSDL giao dich, DB , l` hai cˆt dˆu tiˆn trong Bang 1, sˆ lu.o.ng bˆ xu. l´ l` 3<br />
ı .<br />
a<br />
o `<br />
o ’ y a<br />
o .<br />
.<br />
. a e<br />
.<br />
.˜.ng hˆ tro. tˆi thiˆ u l` 5. V´ du n`y minh hoa qu´ tr` xˆy du.ng FP-Tree cuc bˆ.<br />
˜<br />
´<br />
o . o<br />
e’ a<br />
ı . a<br />
a ınh a<br />
v` ngu o<br />
a<br />
.<br />
.<br />
. o<br />
.<br />
’<br />
Bang 1. V´ du vˆ viˆc phˆn chia CSDL giao dich<br />
ı . ` e<br />
e .<br />
a<br />
.<br />
ID<br />
1<br />
2<br />
3<br />
4<br />
5<br />
6<br />
7<br />
8<br />
9<br />
<br />
C´c muc trong giao dich<br />
a<br />
.<br />
.<br />
A, B, C, D, E<br />
F, B, D, E, G<br />
B, D, A, E, G<br />
A, B, F, G, D<br />
B, F, D, G, K<br />
A, B, F, G, D<br />
A, R, M, K, O<br />
B, F, G, A, D<br />
A, B, F, M, O<br />
<br />
’ ´<br />
C´c muc du.o.c phˆ biˆn<br />
a<br />
o e<br />
.<br />
.<br />
BAD<br />
BDFG<br />
BADG<br />
BADFG<br />
BDFG<br />
BADFG<br />
A<br />
BADFG<br />
BAF<br />
<br />
Bˆ xu. l´<br />
o ’ y<br />
.<br />
P0<br />
<br />
P1<br />
<br />
P2<br />
<br />
˜ .<br />
´<br />
a a<br />
o<br />
o ’ y<br />
o o ’ y e<br />
CSDL du.o.c phˆn t´n nhu. nhau t´.i 3 bˆ xu. l´. Mˆi bˆ xu. l´ dˆm dˆ hˆ tro. cua c´c muc<br />
o o . ’ a<br />
.<br />
.<br />
.<br />
. ˜<br />
. liˆu cuc bˆ. Sau ph´p r´t gon tˆ ng to`n cuc, tˆ t ca c´c bˆ xu. l´ lˆ y sˆ<br />
’<br />
´ ’ a o ’ y a o<br />
´ ´<br />
o<br />
e u . o<br />
a<br />
a<br />
c´ m˘t trong d˜ e<br />
o a<br />
u .<br />
.<br />
.<br />
.<br />
.<br />
.<br />
`<br />
´<br />
´ ´<br />
´<br />
´<br />
a<br />
e<br />
a<br />
o e<br />
dˆm to`n cuc dˆi v´.i tˆ t ca c´c muc trong CSDL. B˘ ng viˆc so s´nh sˆ dˆm dˆ hˆ tro. v´.i<br />
e<br />
a<br />
o o . o<br />
.<br />
.<br />
. o o a ’ a<br />
. ˜<br />
’<br />
˜ o ’ y a<br />
’ e<br />
˜ tro. tˆi thiˆ u, mˆi bˆ xu. l´ lˆ y danh s´ch L, danh s´ch c´c muc phˆ biˆn{(B:8), (A:7),<br />
´<br />
´<br />
´<br />
e<br />
o .<br />
a<br />
a<br />
a<br />
o<br />
dˆ hˆ . o<br />
o o<br />
.<br />
.<br />
’ ´<br />
˜<br />
´ ´<br />
a e<br />
u . ’<br />
(D:7), (F:6), (G:6)}. C´c muc phˆ biˆn trong mˆi giao dich du.o.c s˘p xˆp theo th´. tu. cua L<br />
a<br />
o e<br />
o<br />
.<br />
.<br />
.<br />
. ba cua Bang 1). Mˆi bˆ xu. l´ xˆy du.ng FP-Tree cuc bˆ mˆt c´ch dˆc lˆp. Tˆ t ca<br />
˜ o ’ y a<br />
´<br />
’<br />
’<br />
(cˆt th´<br />
o<br />
u<br />
o a<br />
a ’<br />
o .<br />
.<br />
. .<br />
.<br />
. o o a<br />
. .<br />
FP-Tree cuc bˆ du.o.c minh hoa trong H` 1.<br />
o<br />
ınh<br />
.<br />
.<br />
.<br />
.<br />
<br />
.<br />
’<br />
’<br />
´<br />
´<br />
ˆ<br />
´<br />
ˆ<br />
´<br />
ˆ<br />
ˆ<br />
PHAT TRIEN CAC GIAI THUA T SONG SONG TRONG KHAI PHA LUAT KET HO P<br />
.<br />
.<br />
.<br />
<br />
187<br />
<br />
H` 1. C´c FP-Tree cuc bˆ<br />
ınh<br />
a<br />
. o<br />
.<br />
´<br />
’ a o<br />
Viˆc xˆy du.ng FP-Tree cuc bˆ khˆng phai l` bu.´.c cuˆi c`ng nhu.ng c´ y ngh˜ kh´m ph´<br />
e a<br />
o u<br />
o´<br />
ıa a<br />
a<br />
.<br />
.<br />
. o o<br />
.<br />
’ ´<br />
˜<br />
´<br />
`<br />
’<br />
a<br />
tˆ t ca c´c mˆu phˆ biˆn m` khˆng phai qu´t thˆm CSDL lˆn n`o n˜.a. Theo phu.o.ng ph´p<br />
a ’ a<br />
a<br />
o e<br />
a o<br />
e<br />
e<br />
a a u<br />
’ ´<br />
˜<br />
´<br />
´<br />
’<br />
e’<br />
a a ’ a<br />
a<br />
o e e<br />
e<br />
o<br />
e<br />
FP-growth, dˆ khai th´c tˆ t ca c´c mˆu phˆ biˆn liˆn quan dˆn mˆt muc i (trong bang tiˆu<br />
.<br />
.<br />
.ng mˆu diˆu kiˆn co. so. cua i v` sau d´ xˆy du.ng FP-Tree diˆu kiˆn cua i l`<br />
˜<br />
` `<br />
`<br />
`<br />
’ ’<br />
dˆ), cˆn xˆy du<br />
e a a<br />
e<br />
e<br />
o a<br />
e<br />
e ’<br />
a<br />
a<br />
a<br />
.<br />
.<br />
.<br />
.<br />
.ng nh´nh ch´.a muc i thu.`.ng hiˆn diˆn trong nhiˆu FP-Tree cuc bˆ v` cˆn thu thˆp<br />
`<br />
Ti . Nh˜<br />
u<br />
a<br />
u<br />
o<br />
e<br />
e<br />
e<br />
a<br />
a<br />
.<br />
.<br />
.<br />
. o a `<br />
.<br />
.<br />
´<br />
`<br />
`<br />
’ ’<br />
’ ’<br />
o<br />
e<br />
e<br />
e<br />
e<br />
ch´ng t`. tˆ t ca c´c bˆ xu. l´ dˆ xˆy du.ng diˆu kiˆn co. so. cua i. Diˆu kiˆn co. so. cua mˆt<br />
u<br />
u a ’ a o ’ y e’ a<br />
.<br />
.<br />
.<br />
.<br />
.<br />
.o.c<br />
’<br />
`<br />
`<br />
muc thay dˆ i theo c´ch phˆn chia CSDL ban dˆu. Tuy nhiˆn, FP-Tree diˆu kiˆn m` du .<br />
o<br />
a<br />
a<br />
a<br />
e<br />
e<br />
e<br />
a<br />
.<br />
.<br />
’<br />
’ ´<br />
`<br />
’ o o<br />
e<br />
a u a<br />
xˆy du.ng trˆn diˆu kiˆn co. so. d´ khˆng thay dˆ i v` c´c tˆp phˆ biˆn du.o.c khai th´c t`. cˆy<br />
a<br />
e<br />
e<br />
o a a a<br />
o e<br />
.<br />
.<br />
.<br />
.<br />
.o.ng. Dˆ ch´.ng minh t´ ch´ x´c cua c´ch tiˆp cˆn n`y, x´t hai bˆ<br />
’<br />
´ .<br />
c˜ng khˆng bi anh hu ’<br />
u<br />
o<br />
e’ u<br />
ınh ınh a ’ a<br />
e a a<br />
e<br />
o<br />
. ’<br />
` sau.<br />
dˆ<br />
e<br />
’ e<br />
`<br />
´<br />
`<br />
’<br />
’<br />
Bˆ dˆ 1. C´ch phˆn chia CSDL ban dˆu khˆng anh hu.o.ng dˆn FP-Tree diˆu kiˆn cua mˆt<br />
o `<br />
a<br />
a<br />
a<br />
o ’<br />
e<br />
e<br />
e<br />
o<br />
.<br />
.<br />
muc.<br />
.<br />
˜<br />
´<br />
a e<br />
ınh a<br />
o<br />
a<br />
Ch´.ng minh. Du.a v`o tiˆn tr` xˆy du.ng FP-Tree, mˆi giao dich trong CSDL ´nh xa t´.i<br />
u<br />
.<br />
.<br />
.<br />
. o<br />
.`.ng di trong FP-Tree. Mˆt du.`.ng di do.n i → i → · · · → i trong du.`.ng di c´ tiˆn<br />
o<br />
o<br />
o<br />
o `<br />
e<br />
mˆt du o<br />
o<br />
1<br />
2<br />
n<br />
.<br />
.<br />
.n nhˆ t theo mˆu i1 → i2 → · · · → ik<br />
’ ´<br />
˜<br />
´<br />
´<br />
´<br />
a<br />
y a ’ a<br />
o a<br />
o e o<br />
tˆ i1 d˘ng k´ tˆ t ca c´c giao dich c´ tˆp phˆ biˆn l´<br />
o<br />
a<br />
a<br />
.<br />
.<br />
´ ´<br />
`<br />
’ a e<br />
a<br />
a o e<br />
v´.i 1 k n. Khi xˆy du.ng FP-Tree diˆu kiˆn, mˆt c´ch do.n gian l` thˆm c´c sˆ dˆm v`o<br />
o<br />
e<br />
e<br />
o a<br />
a<br />
.<br />
.<br />
.<br />
.`.ng di i1 → i2 → · · · → in . V` thˆ su. phˆn t´n c´c giao dich khˆng anh hu.o.ng t´.i du.`.ng<br />
´<br />
’<br />
a a a<br />
o ’<br />
o<br />
o<br />
du o<br />
ı e .<br />
.<br />
´<br />
´ ´<br />
`<br />
’ o ´<br />
’ a<br />
o<br />
di i1 → i2 → · · · → in v` sˆ dˆm cua n´. Ap dung diˆu n`y t´.i tˆ t ca c´c du.`.ng di cua cˆy<br />
a o e<br />
e a o a ’ a<br />
.<br />
’ e<br />
`<br />
diˆu kiˆn ta c´ bˆ dˆ.<br />
e<br />
e<br />
o o `<br />
.<br />
’ ´ a ’<br />
’ e<br />
˜<br />
a<br />
o e `<br />
Bˆ dˆ 2. Khai th´c FP-Tree cuc bˆ thu du.o.c c´c mˆu phˆ biˆn dˆy du.<br />
o `<br />
a<br />
. a<br />
. o<br />
.<br />
`<br />
´<br />
’<br />
u ´ a<br />
a<br />
e ` ’ a ’ a o ’ y a<br />
Ch´.ng minh. Ch´ y r˘ ng c´c muc trong bang tiˆu dˆ cua tˆ t ca c´c bˆ xu. l´ l` nhu. nhau<br />
u<br />
e<br />
.<br />
.<br />
˜<br />
’ o a o ’ y<br />
`<br />
´t kˆ sˆ c´c bˆ xu. l´ N v` c´ch phˆn t´n giao dich. C˜ng ch´ y r˘ ng ph´p xu. l´ mˆi muc<br />
´<br />
’ y o<br />
a a<br />
a a<br />
u<br />
u´ a<br />
e<br />
bˆ e<br />
a<br />
.<br />
.<br />
.<br />
. so. cua n´) du.o.c<br />
˜<br />
˜ `<br />
’<br />
e<br />
ıa a o<br />
a a<br />
e<br />
e<br />
trong bang tiˆu dˆ l` t´c vu dˆc lˆp. Ngh˜ l` mˆi muc (v` mˆu diˆu kiˆn co ’ ’ o<br />
e ` a a . o a<br />
.<br />
. .<br />
.<br />
.<br />
’ ´<br />
˜<br />
´<br />
`<br />
’ y o a e’ ’<br />
a ’ a<br />
a<br />
o e o e<br />
a o<br />
a<br />
e<br />
o<br />
xu. l´ dˆc lˆp dˆ san sinh tˆ t ca c´c mˆu phˆ biˆn c´ liˆn quan m` khˆng cˆn thˆm thˆng<br />
. .<br />
’ e<br />
`<br />
´ e<br />
´<br />
´<br />
e<br />
e ’<br />
o<br />
o a<br />
tin n`o n˜.a. Cuˆi c`ng, theo Bˆ dˆ 1, FP-tree diˆu kiˆn cua mˆt muc l` bˆ t biˆn, n´i c´ch<br />
a u<br />
o u<br />
o `<br />
.<br />
.<br />
. a a<br />
’<br />
’ e<br />
˜u phˆ biˆn du.o.c san sinh t`. FP-tree diˆu kiˆn d´ khˆng thay dˆ i. V` vˆy ta c´<br />
`<br />
e<br />
e o o<br />
o<br />
ı a<br />
o<br />
kh´c, c´c mˆ<br />
a a<br />
a<br />
o ´<br />
u<br />
.<br />
.<br />
. ’<br />
’ e<br />
bˆ dˆ.<br />
o `<br />
’ e<br />
˜<br />
´<br />
´ .<br />
`<br />
Bˆ dˆ 2 cho thˆ y t´ ch´ x´c cua c´ch tiˆp cˆn. Do viˆc t´ to´n tai mˆi phˆn tu.<br />
o `<br />
a ınh ınh a ’ a<br />
e a<br />
e ınh a .<br />
o<br />
a ’<br />
.<br />
<br />
188<br />
<br />
˜<br />
ˆ<br />
NGUYEN LONG GIANG<br />
<br />
´<br />
’<br />
trong bang tiˆu dˆ l` t´c vu dˆc lˆp nˆn ta c´ thˆ khai th´c song song tˆ t ca c´c FP-Tree<br />
e ` a a . o a e<br />
e<br />
o e’<br />
a<br />
a ’ a<br />
. .<br />
. l´. Tuy nhiˆn, tai trong cˆng viˆc<br />
´<br />
’<br />
e<br />
o<br />
e<br />
a o ’<br />
cuc bˆ b˘ ng c´ch phˆn phˆi c´c t´c vu d´ cho c´c bˆ xu y<br />
a<br />
a<br />
o a a . o<br />
.<br />
.<br />
.<br />
. o `<br />
. a<br />
.`.ng khˆng b˘ ng nhau, diˆu d´ dˆn t´.i su. mˆ t cˆn b˘ ng tai trong cˆng<br />
`<br />
˜ o . a a `<br />
´<br />
`<br />
’<br />
’ a a . o<br />
o<br />
a<br />
a<br />
o<br />
e o a<br />
cua c´c t´c vu d´ thu o<br />
.<br />
’<br />
a<br />
e<br />
viˆc, v` v` vˆy giam thiˆ u hiˆu n˘ng t´ to´n. Muc tiˆu b`i b´o l` t` ra phu.o.ng ph´p hiˆu<br />
e<br />
a ı a<br />
e’<br />
e a<br />
ınh a<br />
e a a a ım<br />
.<br />
.<br />
.<br />
.<br />
.<br />
’ phˆn phˆi c´c t´c vu d´ dˆu nhau cho c´c bˆ xu. l´ v` giam thiˆ u su. mˆ t cˆn b˘ ng<br />
’ . a a `<br />
´<br />
´<br />
’ e<br />
o a a . o `<br />
e<br />
a o ’ y a ’<br />
qua dˆ a<br />
e<br />
a<br />
.<br />
’<br />
tai trong cˆng viˆc.<br />
o<br />
e<br />
.<br />
.<br />
`<br />
´<br />
’ ınh ( SLB Static<br />
y<br />
a a<br />
a<br />
Thuˆt to´n phˆn phˆi t´c vu su. dung k˜ thuˆt cˆn b˘ ng tai t˜<br />
a<br />
a<br />
a<br />
o a<br />
.<br />
.<br />
. ’ .<br />
Load Balancing)<br />
´<br />
´<br />
´<br />
’<br />
’<br />
Y tu.o.ng thuˆt to´n l` x´c dinh khˆi lu.o.ng t´ to´n cho tˆ t ca c´c muc trong bang tiˆu<br />
a<br />
a a a .<br />
ınh a<br />
a ’ a<br />
e<br />
o<br />
.<br />
.<br />
.<br />
.o.c xˆy du.ng t`. co. so. d˜. liˆu ban dˆu) v` sau d´ chia nh˜.ng<br />
` ’<br />
`<br />
`<br />
’ u e<br />
u<br />
dˆ cua FP-Tree ban dˆu (cˆy du . a<br />
e<br />
a<br />
a<br />
a<br />
a<br />
o<br />
u<br />
.<br />
.<br />
`<br />
` n c´ k´ thu.´.c b˘ ng nhau v` g´n ch´ng cho c´c bˆ xu. l´.<br />
’ y<br />
o a<br />
a a<br />
u<br />
a o<br />
a<br />
a<br />
muc d´ th`nh c´c phˆ o ıch<br />
.<br />
. o a<br />
’ y `<br />
’<br />
Cho T = {t1 , t2 , . . ., tn } l` tˆp t´c vu, v´.i t´c vu ti dang xu. l´ phˆn tu. i trong bang tiˆu<br />
a a a . o a .<br />
a ’<br />
e<br />
.<br />
. so. cua n´ dˆ san sinh tˆ t ca c´c mˆu phˆ biˆn liˆn quan, v´.i n l` sˆ t´c<br />
’ ’<br />
’ e e<br />
˜<br />
` a `<br />
´<br />
´<br />
dˆ, v` diˆu kiˆn co ’ ’ o e<br />
e<br />
e<br />
e<br />
a ’ a<br />
a<br />
o ´<br />
o<br />
a o a<br />
.<br />
vu.<br />
.<br />
´<br />
´<br />
a o<br />
o<br />
e<br />
Cho W = {w1, w2, . . . , wn} l` tˆp trong sˆ v´.i wi = weight(ti) l` khˆi lu.o.ng cˆng viˆc<br />
a a<br />
o o<br />
.<br />
.<br />
.<br />
.<br />
’ xu. l´ t´c vu ti cho dˆn khi kˆt th´c. Trong sˆ n`y c´ thˆ l` mˆt dˆ do th`.i gian t´ to´n<br />
’ a o o<br />
´<br />
´ u<br />
´<br />
ınh a<br />
dˆ ’ y a .<br />
e<br />
e<br />
e<br />
o a o e<br />
o<br />
.<br />
. .<br />
˜<br />
´<br />
a o<br />
o<br />
a<br />
e’<br />
e<br />
o<br />
o<br />
o e<br />
o<br />
thu.c, ho˘c dˆ do biˆ u diˆn mˆt th`.i gian tu.o.ng dˆi, liˆn quan t´.i th`.i gian du.o.c yˆu cˆu<br />
.<br />
.<br />
. e `<br />
.<br />
.<br />
’ xu. l´ c´c t´c vu kh´c. Trong tru.`.ng ho.p n`y, viˆc u.´.c lu.o.ng th`.i gian t´ to´n thu.c l`<br />
dˆ ’ y a a .<br />
e<br />
a<br />
o<br />
a<br />
e o<br />
o<br />
ınh a<br />
.<br />
.<br />
.<br />
. a<br />
´<br />
´ .<br />
o<br />
o<br />
khˆng thˆ . Ta s˜ theo c´ch tiˆp cˆn u.´.c lu.o.ng th`.i gian tu.o.ng dˆi.<br />
o<br />
e’<br />
e<br />
a<br />
e a o<br />
.<br />
`<br />
´<br />
’<br />
o e a<br />
a `<br />
a ’<br />
Dˆ xu. l´ phˆn tu. i , tru.´.c hˆt xˆy du.ng cˆy diˆu kiˆn cua i, b˘ ng c´ch dˆ quy san sinh ra<br />
e’ ’ y `<br />
e<br />
e ’<br />
a<br />
a<br />
e<br />
.<br />
.<br />
.<br />
˜u diˆu kiˆn co. so. v` FP-Tree kˆ tiˆp cho dˆn khi tˆ t ca FP-Tree tro. th`nh du.`.ng di<br />
´ e<br />
´<br />
`<br />
´<br />
´ ’<br />
’ a<br />
’ a<br />
o<br />
e<br />
e<br />
e<br />
e<br />
a<br />
c´c mˆ<br />
a<br />
a<br />
.<br />
´ o a o a<br />
´<br />
`<br />
`<br />
o<br />
o u o<br />
e<br />
do.n. Sˆ bu.´.c l˘p c˜. h`m sˆ m˜ v´.i chiˆu cao FP-Tree diˆu kiˆn cua i. R˜ r`ng l` chiˆu cao<br />
e<br />
e ’<br />
o a<br />
a `<br />
e<br />
.<br />
.<br />
.`.ng d`i nhˆ t gi´.i han bo.i sˆ tˆi da c´c muc phˆ biˆn trong<br />
’ e<br />
´<br />
´ ´<br />
’ o o<br />
’<br />
a<br />
a o .<br />
a<br />
o ´<br />
cua FP-Tree l` chiˆu d`i cua du o<br />
a `<br />
e a ’<br />
.<br />
´<br />
´<br />
´<br />
’<br />
e<br />
o .<br />
o<br />
bˆ t k` giao dich n`o thuˆc CSDL, ho˘c sˆ muc trong bang tiˆu dˆ cua n´. Do d´, trong sˆ<br />
a y<br />
a<br />
o<br />
a o .<br />
e ` ’ o<br />
.<br />
.<br />
.<br />
’ u.´.c lu.o.ng b˘ ng cˆng th´.c sau<br />
`<br />
’ a .<br />
cua t´c vu ti c´ thˆ o<br />
o e<br />
a<br />
o<br />
u<br />
.<br />
´<br />
’<br />
wi = f (sˆ muc trong bang tiˆu dˆ).<br />
o .<br />
e `<br />
e<br />
.c hiˆn, ta su. dung cˆng th´.c<br />
’ .<br />
e<br />
o<br />
u<br />
Dˆ thu<br />
e’ .<br />
.<br />
´<br />
’<br />
e<br />
wi = sˆ muc trong bang tiˆu dˆ<br />
o .<br />
e `<br />
n<br />
.i c´c bˆ xu. l´ su. dung giai thuˆt d´ng g´i nhi<br />
’ y ’ .<br />
’<br />
o<br />
Cho W = i=1 wi . Ta phˆn t´n t´c vu t´ a o<br />
a a a . o<br />
a o<br />
.<br />
.<br />
.<br />
. l´, trong sˆ cua mˆi khˆi l` W ,<br />
˜ .<br />
˜<br />
´<br />
´<br />
´<br />
´<br />
phˆn (bin-packing). Cˆ p ph´t mˆt ”khˆi” cho mˆi bˆ xu y .<br />
a<br />
a<br />
a<br />
o<br />
o<br />
o o ’<br />
o ’<br />
o<br />
o a N<br />
.<br />
´<br />
v´.i N l` sˆ lu.o.ng bˆ xu. l´. Dˆ t˘ng hiˆu n˘ng song song, phˆn t´n dˆu c´c t´c vu c`ng trong<br />
o<br />
a o .<br />
o ’ y e’ a<br />
e a<br />
a a ` a a . u<br />
e<br />
.<br />
.<br />
.<br />
.i c`ng nhiˆu khˆi c`ng tˆt, tr´nh tru.`.ng ho.p c´c t´c vu v´.i trong sˆ l´.n du.o.c phˆn t´n<br />
`<br />
´<br />
´<br />
´<br />
´<br />
e<br />
o a<br />
o<br />
a<br />
o<br />
a a . o<br />
o o<br />
a a<br />
sˆ t´ a<br />
o o<br />
.<br />
.<br />
.<br />
´ ´<br />
´<br />
`<br />
`<br />
o a<br />
o<br />
e<br />
u . ’<br />
a ’<br />
e’ .<br />
e a a a .<br />
t´.i mˆt v`i khˆi. Dˆ thu.c hiˆn diˆu n`y, c´c t´c vu du.o.c s˘p xˆp theo th´. tu. giam dˆn cua<br />
o<br />
.<br />
.<br />
. a e<br />
. tu. s˘p xˆp t´.i khˆi b´ nhˆ t. Tiˆn tr` n`y du.o.c thu.c<br />
˜<br />
´ ´<br />
´<br />
´<br />
´<br />
´<br />
o e a<br />
e<br />
ınh a<br />
trong sˆ, v` g´n mˆi t´c vu theo th´ . a e o<br />
o a a<br />
o a .<br />
u<br />
.<br />
.<br />
.<br />
`<br />
´<br />
o e a ’ a o ’ y<br />
hiˆn dˆ ng th`.i trˆn tˆ t ca c´c bˆ xu. l´.<br />
e o<br />
.<br />
.<br />
´<br />
´<br />
Du.´.i dˆy tr` b`y viˆc su. dung k˜ thuˆt ma trˆn dˆm dˆ d´nh gi´ trong sˆ t´c vu.<br />
ınh a<br />
e ’ .<br />
e’ a<br />
a .<br />
o a .<br />
o a<br />
y<br />
a<br />
a e<br />
.<br />
.<br />
.<br />
´<br />
K˜ thuˆt Ma trˆn Dˆm<br />
y<br />
a<br />
a<br />
e<br />
.<br />
.<br />
˜<br />
’<br />
a<br />
o<br />
o<br />
e ` ’<br />
e<br />
Trong phu.o.ng ph´p FP-growth, v´.i mˆi muc i trong bang tiˆu dˆ cua FP-Tree Ti, hai<br />
.<br />
.`.ng ngang cua T du.o.c su. dung dˆ xˆy du.ng FP-Tree diˆu kiˆn T . Du.`.ng ngang th´. nhˆ t<br />
’ a<br />
´<br />
`<br />
’ i<br />
o<br />
u a<br />
du o<br />
e<br />
e<br />
e i<br />
. ’ .<br />
.<br />
.<br />
.ng bang tiˆu dˆ cua cˆy m´.i b˘ ng viˆc t` tˆ t ca c´c muc phˆ biˆn trong mˆu diˆu<br />
’ ´<br />
˜<br />
´<br />
`<br />
’<br />
e ` ’ a<br />
a<br />
e ım a ’ a<br />
o e<br />
a<br />
e<br />
o `<br />
e<br />
xˆy du<br />
a<br />
.<br />
.<br />
.<br />
. so. cua i. Du.`.ng ngang th´. hai xˆy du.ng cˆy m´.i T . Trong mˆi tru.`.ng song song,<br />
kiˆn co ’ ’<br />
e<br />
o<br />
u<br />
a<br />
a<br />
o i<br />
o<br />
o<br />
.<br />
.<br />
´<br />
e’ ınh a<br />
o<br />
a .<br />
sau khi duyˆt cˆy, tˆ t ca c´c bˆ xu. l´ cˆn liˆn lac v´.i nhau dˆ h` th`nh thˆng tin to`n cuc.<br />
e a a ’ a o ’ y ` e . o<br />
a<br />
.<br />
.<br />
<br />