Vous êtes sur la page 1sur 5

Constraint Satisfaction Problem1.

CONSTRAINT SATISFACTION:-
Many problems in AI can be consiere as problems of constraint satisfaction! in "#ic# t#e
$oal state satisfies a $i%en set of constraint. constraint satisfaction problems can be sol%e
by &sin$ any of t#e searc# strate$ies. T#e $eneral form of t#e constraint satisfaction
proce&re is as follo"s:
'ntil a complete sol&tion is fo&n or &ntil all pat#s #a%e le to lea ens! o
1. select an &ne(pane noe of t#e searc# $rap#.
). Apply t#e constraint inference r&les to t#e selecte noe to $enerate all possible ne"
constraints.
*. If t#e set of constraints contains a contraiction! t#en report t#at t#is pat# is a ea en.
+. If t#e set of constraints escribes a complete sol&tion t#en report s&ccess.
,. If neit#er a constraint nor a complete sol&tion #as been fo&n t#en apply t#e r&les to
$enerate ne" partial sol&tions. Insert t#ese partial sol&tions into t#e searc# $rap#.
-(ample: consier t#e crypt arit#metic problems.
S-N.
/ MOR-
----------
MON-0
----------
Assi$n ecimal i$it to eac# of t#e letters in s&c# a "ay t#at t#e ans"er to t#e problem is
correct to t#e same letter occ&rs more t#an once ! it m&st be assi$n t#e same i$it eac# time
. no t"o ifferent letters may be assi$ne t#e same i$it. Consier t#e crypt arit#metic
problem.
S-N.
/ MOR-
-----------
MON-0
-----------
CONSTRAINTS:-
1. no t"o i$it can be assi$ne to same letter.
). only sin$le i$it n&mber can be assi$n to a letter.
1. no t"o letters can be assi$ne same i$it.
). Ass&mption can be mae at %ario&s le%els s&c# t#at t#ey o not contraict eac# ot#er.
*. T#e problem can be ecompose into sec&re constraints. A constraint satisfaction
approac# may be &se.
+. Any of searc# tec#ni1&es may be &se.
,. 2ac3trac3in$ may be performe as applicable &s applie searc# tec#ni1&es.
4. R&le of arit#metic may be follo"e.
Initial state of problem.
.56
-56
056
N56
R56
O56
S56
M56
C156
C)56
C1 !C )! C* stans for t#e carry %ariables respecti%ely.
7oal State: t#e i$its to t#e letters m&st be assi$ne in s&c# a manner so t#at t#e s&m is
satisfie.
Solution Process:
8e are follo"in$ t#e ept#-first met#o to sol%e t#e problem.
1. initial $&ess m51 beca&se t#e s&m of t"o sin$le i$its can $enerate at most a carry 919.
). 8#en n51 o5: or 1 beca&se t#e lar$est sin$le i$it n&mber ae to m51 can $enerate
t#e s&m of eit#er : or 1 epen on t#e carry recei%e from t#e carry s&m. 2y t#is "e
concl&e t#at o5: beca&se m is alreay 1 #ence "e cannot assi$n same i$it anot#er
letter;r&le no.<
*. 8e #a%e m51 an o5: to $et o5: "e #a%e s5= or >! a$ain epenin$ on t#e carry
recei%e from t#e earlier s&m.
T#e same process can be repeate f&rt#er. T#e problem #as to be compose into %ario&s
constraints. An eac# constraints is to be satisfie by $&essin$ t#e possible i$its t#at t#e
letters can be ass&me t#at t#e initial $&ess #as been alreay mae . rest of t#e process is
bein$ s#o"n in t#e form of a tree! &sin$ ept#-first searc# for t#e clear &nerstanability
of t#e sol&tion process.
D>6(Controduction)

Vous aimerez peut-être aussi