????? ????? (Design Theory) - PowerPoint PPT Presentation

About This Presentation
Title:

????? ????? (Design Theory)

Description:

for each subset X of R with i attributes. if closure(X,F)=R. Return X. ???? ?????? ???'? ... While there is an attribute A. such that F = K-{A} A K := K {A} ... – PowerPoint PPT presentation

Number of Views:15
Avg rating:3.0/5.0
Slides: 29
Provided by: csHu
Category:

less

Transcript and Presenter's Notes

Title: ????? ????? (Design Theory)


1
????? ????? (Design Theory)
  • ???? ??????

2
???? ?? ????? ??????????
  • ??? R ????? ??????????, F ????? ??????
    ????????????
  • ????? ?? X ????? X ????? ?? ?? ??????????? ?-R
    ??????? ?-X
  • X A F X?A

??? ???? ???? ???? ?? ????? ???????????
??? ???? ?????? ?- ? ?
3
?????
  • RABCDE
  • FAB?C, CE?B, D?A, BC?E
  • A
  • A,B
  • B,D

4
???????? ????? ?????? ????
  • Compute Closure(X,F)
  • Set C X
  • While there is a V?W in F such that V ? C and W ?
    C
  • C C ? W
  • Return C

5
???????? ??? ????
  • ???????? ??? ???? O( X2F )
  • ???? ????????? ??? ??? ????? ????? ??????????? ?-
    X
  • ??? ??????? ?????? ??? ????? F ??????
  • ?? ????? ??? ???? ?-C ??? ????? ???? ??????????
    ?-X

6
???????? ???? ????
  • ?????? ???? ??? ???? ??? ?"? ?? F ?????? ???
    ???????? ?? R
  • ??????? ????? ????? ?? ???? (size) ?????? ???
    (tail)
  • ???? ?? ???? X?Y, ????? ?? ??"? ??????
  • true ??? ??????? ??? ?????????? ?- X
  • ?? ???? ??????????? ?-X ?????? size
  • ?? Y ?????? tail

7
???? ?????
F A ? C, B ? D, AD ? E
A B C D E Size Tail
A ? C ? 1 C
B ? D ? 1 D
AD ? E ? ? 2 E
8
Compute Closure(X, F, T) / T is the table
/ C X Q X While Q is not empty A
Q.dequeue() for i1..F if Ti,Atrue then
Ti,size Ti,size1 if Ti,size0,
then Q Q ? (Ti,tail\C) C C ? Ti,tail
9
????? AB
Start X A,B, Q A, B
A B C D E Size Tail
A ? C ? 1 C
B ? D ? 1 D
AD ? E ? ? 2 E
10
????? AB
Iteration of A X A,B,C, Q B,C
A B C D E Size Tail
A ? C ? 0 C
B ? D ? 1 D
AD ? E ? ? 1 E
11
????? AB
Iteration of B X A,B,C,D, Q C,D
A B C D E Size Tail
A ? C ? 0 C
B ? D ? 0 D
AD ? E ? ? 1 E
12
????? AB
Iteration of C X A,B,C,D, Q D
A B C D E Size Tail
A ? C ? 0 C
B ? D ? 0 D
AD ? E ? ? 1 E
13
????? AB
Iteration of D X A,B,C,D,E, Q E
A B C D E Size Tail
A ? C ? 0 C
B ? D ? 0 D
AD ? E ? ? 0 E
14
????? AB
Iteration of E X A,B,C,D,E, Q
A B C D E Size Tail
A ? C ? 0 C
B ? D ? 0 D
AD ? E ? ? 0 E
15
????????
  • ???????, ???? ??? ????? ??? ?? ?????? true ?????
    ??? ??? ????? ????? ?????? true

A B C D E Size Tail
A ? C ? 1 C
B ? D ? 1 D
AD ? E ? ? 2 E
16
???????? ??? ????
  • ?????? ???? ?- O( F X )
  • ?????? ?? ?? ??????????? ?? X
  • ???? ???????? ?????? ????? ??? ??? ????? ?????
    ??????????? ???????? ??? ???? ?? ???? ?-F
  • ??? ????????? ?????

17
????? ????
  • ????? ????? R ?????? ?????? ???????????? F
  • ????? ????? ???? (?????) ???? R
  • ???????? ?????
  • ?????? ?? ?? ?? ??????? ?? ?????????? ?-R ???
    ???????? ?????? ????? ??????? ?????? ??????
  • ??????? ???? ?????? ????? ?????? ??? ??? R
  • ??? ????????? ?????

18
?????????
  • Compute Key(R, F)
  • for i1 to R
  • for each subset X of R with i attributes
  • if closure(X,F)R
  • Return X

19
???????? ???????
  • ?? ?-R ?? n ?????????? ?? ?? n!/(n-i)!i!
    ???????? ?????? ?????? ????? i ?-R ????? ??
    ?????? ????? ????
  • ????? ???????? ???? ????
  • ?????? ?????? "??????"

20
????? ????
Compute Key(R, F) Set K R While there is an
attribute A such that F ? K-A?A K K
\A Return K
21
?????
  • RABCDE
  • FAB?C, CE?B, D?A, BC?E
  • ?????? KABCDE
  • ???? D?A ?????? KBCDE
  • ???? CE?B ?????? KCDE
  • ?? ???? ?????? ??? ?????????? ???? ??? ????

22
??? ????
  • ?????? ???? ??? ????? R ????? ???? ??? ?????
    O(RF)
  • ???? ????????? ?????

23
????? ?????? ?????
  • RABCDE
  • FABC?D, D?B, B?C, AD?BC
  • ????? ????? ???? ??????, ???? ???? ?????? ???????
    ????? ??? ?????

24
????? ??????
  • ????? ????? ??? ????????
  • ????? ?? ???????
  • ????? ???? ???????
  • ????? ?????
  • ????? ????? ???????? ?? ??????

25
?????? ?????? ????? ??? ????????
????? ???? ?- ???? ??? ?????
????? ?????? ??????? ???? ?????? ????? ???? ????
???? ?????? ??????? ???? ?????? ????? ???? ???? ????? ??? ????
26
?????
  • ????? ??? ????????
  • FCAB?D, D?B, B?C
  • ?????? ABE, ADE
  • ???? ??????? ???? ?-3NF
  • ????? ABD, BC, ABE
  • ????? ???? ????
  • ????? ???? ??????
  • ????? ??????? ????? ??????? 3NF (?????)

27
????? ?????
  • RABCDE
  • FBC?CD, A?CD, D?AB, E?BC
  • ????? ????? ???? ??????, ???? ???? ?????? ???????
    ????? ??? ?????

28
?????
  • ????? ??? ????????
  • FC BC?D, D?A, D?B,
  • A?C, A?D,E ?B, E ?B
  • ?????? E ???? ????
  • ???? ??????? ???? ?-3NF
  • ????? ABCD, BCE
  • ????? ???? ????
  • ????? ???? ??????
  • ????? ??????? ????? ??????? BCNF (?????)
Write a Comment
User Comments (0)
About PowerShow.com