D, w) Voi m6i lu~ tr mftta co th€ ap d1,lngtre nH de suy ra nhung thuQctinh
Truong hQpbai roan H~G la kh6ng giai duQcthl ta noi gia thie'tH thie'u.
Khi do co th§ di€u chinh bai roan b~ng nhi€u cach khac nhau d§ cho bai roan la giai duQc. Ch~ng h~n ta co th€ sa dl:lngmQt s6 phuong an sail day:
phu'dngan 1 : TIm mQtA' c M \ (A u B) t6i ti§u saG cho baa dong cua t~p
hQpA'u A chlia B.
phu'dngan 2 : Khi phuong an 1 kh6ng th§ tht;tchi~n duQc thl ta kh6ng th§ chI
di€u chinh gia thie't el§cho bai roan la giai duQc. Trang tint hu6ng n~y, ta phai bo bot ke't lu~n ho~c chuy€n bot mQt ph~n ke't lu~n sang gia thie't d§ xem xet l~i bai roan rhea phuong an 1.
Khai ni~m t~p hQp sinh va phuong phap Hm mQt t~p hQp sinh tren mQt m~ng suy
di~n la co sd cho vi~c phat tri§n cac thu~t roan giai quye't va'n d€ ki§m dint gia
thie't cua bai roan suy di~n. Hon lllIa vi~c khao sat v€ t~p hQp sinh cling Ia n1Qt va'n d€ duQc d~t ra mQt each tt;tnhien tren m~ng suy di~n nh~m tim fa mQt t~p hQp t6i thi§u cac thuQc tint va cac lu~t suy di~n sinh fa ta't ca cae thuQc tint khac.
'I
2.5.1 Khai ni~m t~p hQ'psinh
- Dinh nghla 2.7: Cho (A, D) la mQt m~ng suy di~n. MQt t~p thuQc tint SeA
duQc gQi la mQt tqp ht;Jpsinh cua m~ng suy di~n khi ta co baa dong cua S tren m~ng la A, nghia la S=A.
Vi du 2.13: Xet m~ng suy di~n (A, D) voi A ={a, b, c, A, B, C, R, p, S} g6m cac
bie'n s6tht;tc duong va D la t~p hQp cac lu~t suy di~n tuong ling cua cac quail
h~ suy di~n th§ hi~n bdi cac c6ng thlic sail day:
f1:A+B+C=n f2: a/sin(A) =2*R f4: c/sin(C) =2*R 0: b/sin(B) =2*R f5: a + b + c =2 *p f7: b2=a2 + C2 - 2*a*c*cos(B) f6: a2=b2 + C2- 2*b*c*cos(A) f8: C2=b2 + a2 - 2*b*a*cos(C) f9: S=sqrt(p*(p-a)*(p-b)*(p-c»
M(;mg suy di~n nfiy co mQt t~p hqp sinh la T= {a, A, B} va tu T ta suy ra duqc D
nho cac lu~t suy di~n sail:
A, a ::::>R; A, B ::::>C; R, C ::::>c; R, B ::::>b; a, b, c ::::>p; a, b, c, p ::::>S
Tli dinh nghla v~ t~p hqp sinh (j tren ta co cac tinh chit sail:
(1) Ne'u S Ia mQt t~p hqp sinh trong mQt m~ng suy di~n va SeT thi T cfing la mQtt~p hqp sinh.
(2) Ne'u S Ia mQt t~p h<;1psinh trong m~ng suy di~n (A, D) va D' la mQt t~p hqp mC1rQng cua D, nghla la D cD', thi ta cling co S la mQt t~p h<;1psinh cua m?ng suy di~n (A, D').
Hi6n nhien la m6i m~ng suy di~n d~u co t~p h<;1psinh.Vin d~ ma chung ta seo .khao sat Iii tim mQt t~p hqp sinh. khao sat Iii tim mQt t~p hqp sinh.
2.5.2 TIm t~ P hQ'p sinh
Trong mt,lc nfi¥ se trinh bay cach tim mQt ~p hqp sinh kh6ng tfim thuong voi s6 phfin tU cang it cang t6t cua m~ng suy di~n. Truoc he't, ta co th6 tim mQt t~p hqp sinh b~ng phuong phap thtl' dfin duqc th6 hi~n bC1ithu~t toan sail day:
Thudt tmin 2.6: TIm mQt t~p hqp sinh Strong m?ng suy di~n (A, D).
Buoc 1: S +- {} II B~t cho S ban d~u la r6ng
Bu'oc 2: Tinh baa dong Closure(S) cua ~p h<;1pS. Bu'oc 3: Ki6m ITa so sanh Closure(S) va A.
If Closure(S) =A then Ke't thuc
Else Begin
ChQn ffiQtphffn tiYx E A-S; S +- S u {x}; Quay I?i Bu'ac 2;
End
Thu?t tmin nffy se cho ta mQt t?P hejp sinh vOi dQ phuc t?P
O(1A12.IDl.min(lAI,IDI)),do dQ phuc t?P cua phep loan t?P hejp lIen cac t?P hejp
thuQctinh cua A la O(IAI)va dQ phuc t?P eua thu?t loan tim bao dong eua mQt t~phejptren m?ng suy di€n (A, D) la O(lAI.IDl.min(lAI,IDI)).
Ta co th€ xay d1;1'ngmQt thu?t loan t6t hon thu?t loan lIen b~ng each thie't I?p ffiQt "bi€u d6 (hay d6 thi) phan ea'p" eua mQt m?ng suy di~n. Kh6ng lam ma't tinh t6ng quat ta co th€ gia sll' cae lu?t suy di~n co phffn ke't lu?n g6m I phffn tit
- Dinh nghla 2.8: Cho mQtm~lllgsuy di€n (A, D) ma m6i lu?t suy di~n co phffn
ke't lu?n g6m I phffn tll'. Ta xay d1;1'ngmQt d6 thi dinh huang Graph(A, D) nhu'
sail:
(1) T?p hejp dlnh g6m ta't ea cae thuQe tinh va ta't ea cae lu?t suy di~n, tue la
AuD.
(2) Ung vai m6i lu?t r : hypothesis(r) -+ goal(r) ta thie't I?p mQt t?P hejp
~ '
edges(r) g6m ta't eel cae cling dinh huang (x, r) va (r, y) thoa x E
hypothesis(r) va y E goal(r) mQt each tudng ling. T?p hejp cae e?nh eua d6 thi Graph(A, D) la hejp ta't eel cae t?P hejp edges(r) vai r eh?y trong t?P D.
Trang tru'ong hejp lIen d6 thi Graph(A, D) ta co degin(x) :::;1 vai mQi x E A, thl ta co th€ hi€u ngffm cae dlnh thuQc D va xet mQt d6 thi thu gQn GraphD(A)
g6m:
(1) T?p hejp dlnh la t?P hejp cae thuQe tinh A.
(2) T~p hQp c~nh g6m ta"tca cac cling (x,y) thoa man di~u ki~n: Co (duy
nha"t) mQt lu~t r saG cho goal(r) =y va x E hypotheis(r).
Vi du 2.14: M~ng suy di~n (A, D) vai A ={a, b, c, A, B, C, R, p, S} va D la t?P cae lu~t suy di~n sail:
rl: A, a=> R; r2: A, B => C; r3: R, C => c; r4: R, B => b; r5: a, b, c => p; r6: a, b, c, p ~ S
se eo d6 thi Graph(A, D) co t~p hQp dlnh 13
Au D={a, b, c, A, B, C, R, p, S, rl, r2, r3, r4, r5, r6}
va t?P hQpcac cling la
{(A,rl), (a,rl), (rl,R), (A,r2), (B,r2), (r2,C), (R,r3), (C,r3), (r3,c), (R,r4), (B,r4), (r4,b),
(a,r5), (b,r5), (c,r5), (r5,p), (a,r6), (b,r6), (c,r6), (p,r6), (r6,S) }
Tren d6 thi Graph(A, D) m6i x E A co dung mOt cling huang tai, va d6 thi thu gQn GraphD(A)co t~p dlnh la
A ={a, b, c, A, B, C, R, p, S }
va t~ P hQp c~nh 13
{(A,R), (a,R), (A,C), (B,C), (R,e), (C,c), (R,b), (B,b), (a,p), (b,p), (c,p), (a,S), (b,S), (c,S), (p,S)}
~ .