Example: marketing

5 CONSTRAINT SATISFACTION PROBLEMS

5 CONSTRAINTSATISFACTIONPROBLEMSI nwhich weseehowtreatingstatesasmore thanjustlittleblack boxesleadsto theinventionofa range ofpowerfulnew search methodsanda deeperunderstandingofproblemstructure and4 exploredtheideathatproblemscanbesolvedby searchinginaspaceofstates. Thesestatescanbeevaluatedbydomain-specif icheuristicsandtestedtoseewhetherthey ,however,eachstateis is representedbyanarbi-BLACKBOX trarydatastructurethatcanbeaccessedonlyb ytheproblem-specificroutines thesuccessorfunction,heuristicfunction, , whosestatesandgoaltestconformtoa standard,structured,andverysimplereprese ntation( ).Searchal-REPRESENTATION gorithmscanbedefinedthattake advantageofthestructureofstatesandusegen eral-purposeratherthanproblem-specifiche uristicsto enablethesolutionoflargeproblems( ).

5.3). Perhaps most importantly, the standard representation of the goal test reveals the struc-ture of the problem itself (Section 5.4). This leads to methods for problem decomposition and to an understanding of the intimate connection between the structure of a problem and the difficulty of solving it. 5.1 CONSTRAINT SATISFACTION PROBLEMS

Tags:

  Satisfaction, Structure, True, Constraints, Crust, Struc tures, Constraint satisfaction

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of 5 CONSTRAINT SATISFACTION PROBLEMS

1 5 CONSTRAINTSATISFACTIONPROBLEMSI nwhich weseehowtreatingstatesasmore thanjustlittleblack boxesleadsto theinventionofa range ofpowerfulnew search methodsanda deeperunderstandingofproblemstructure and4 exploredtheideathatproblemscanbesolvedby searchinginaspaceofstates. Thesestatescanbeevaluatedbydomain-specif icheuristicsandtestedtoseewhetherthey ,however,eachstateis is representedbyanarbi-BLACKBOX trarydatastructurethatcanbeaccessedonlyb ytheproblem-specificroutines thesuccessorfunction,heuristicfunction, , whosestatesandgoaltestconformtoa standard,structured,andverysimplereprese ntation( ).Searchal-REPRESENTATION gorithmscanbedefinedthattake advantageofthestructureofstatesandusegen eral-purposeratherthanproblem-specifiche uristicsto enablethesolutionoflargeproblems( ).

2 Perhapsmostimportantly, thestandardrepresentationofthegoaltestre vealsthestruc-tureoftheproblemitself( ).Thisleadstomethodsforproblemdecomposit ionandtoanunderstandingoftheintimateconn ectionbetweenthestructureofa ,aconstraintsatisfactionproblem(orCSP)is definedbya setofvari-CONSTRAINTSATISFACTIONPROBLEM ables,X1; X2; : : : ; Xn, anda setofconstraints,C1; C2; : : : ; Cm. EachvariableXihasaVARIABLESCONSTRAINTS nonemptydomainDiofpossiblevalues. definedbyanassignmentofvaluesto someorallofthevariables,fXi=vi; Xj=ASSIGNMENTvj; : : :g. Anassignmentthatdoesnotviolateany constraintsis oneinwhicheveryvariableis mentioned,andaso-lutiontoa CSPis a solutionthatmaximizesanobjective ,havingtiredofRomania,wearelookingata mapofAustraliashowingeachofitsstatesandt erritories, (a),andthatwearegiventhetaskofcoloringea chregioneitherred,green,orblueinsucha waythatnoneighboringregionshave thesamecolor.

3 To formulatethisasa CSP, wedefinethevariablestobetheregions:WA,NT ,Q,NSW,V,SA, andT. Thedomainofeachvariableis thesetfred;green;blueg. Theconstraintsrequireneighboringregionst ohave distinctcolors;forexample,theallowableco mbinationsforWAandNTarethepairsf(red;gre en);(red;blue);(green;red);(green;blue); (blue;red);(blue;green)g:(Theconstraintc analsoberepresentedmoresuccinctlyasthein equalityWA6=NT, pro-videdtheconstraintsatisfactionalgori thmhassomewayto evaluatesuchexpressions.)Therearemany possiblesolutions,suchasfWA=red;NT=green ; Q=red;NSW=green; V=red;SA=blue; T=redg:It is helpfultovisualizea CSPasaconstraintgraph, (b).

4 Problemasa a CSPconformsto astandardpattern thatis,a setofvariableswithassignedvalues thesuccessorfunctionandgoaltestcanwritte nina ,wecandevelopeffective,genericheuristics thatrequirenoadditional, , thestructureoftheconstraintgraphcanbeuse dtosim-plifythesolutionprocess,insomecas esgivinganexponentialreductionincomplexi ty. TheCSPrepresentationis thefirst,andsimplest,ina South WalesVictoriaTasmaniaWANTSAQNSWVT(a)(b)F igure (a) toassigncolorstoeachregionsothatnoneighb oringregionshave thesamecolor. (b)Themap-coloringproblemrepresentedasa is fairlyeasyto seethata CSPcanbegivenanincrementalformulationasa standardsearchproblemasfollows:}Initials tate: theemptyassignmentfg, inwhichallvariablesareunassigned.

5 }Successorfunction: a valuecanbeassignedtoany unassignedvariable,providedthatit doesnotconflictwithpreviouslyassignedvar iables.}Goaltest: thecurrentassignmentis complete.}Pathcost: a constantcost( ,1) completeassignmentandthereforeappearsatd epthnif ,thesearchtreeextendsonlytodepthn. Forthesereasons,depth-firstsearchalgorit hmsarepopularforCSPs.( )It is alsothecasethatthepathbywhich a solutionis reachedis ,wecanalsouseacomplete-stateformulation, inwhicheverystateis a ( ) canalsobeviewedasa finite-domainCSP, wherethevariablesQ1; : : : ; Q8arethepositionsofeachqueenincolumns1; : : : ;8andeachvariablehasthedomainf1;2;3;4;5; 6;7;8g.

6 If themaximumdomainsizeofany variableina CSPisd, thenthenumberofpossiblecompleteassignmen tsisO(dn) thatis, , whosevariablescanbeeithertrueorfalse. BooleanCSPsincludeBOOLEANCSPS asspecialcasessomeNP-completeproblems,su chas3 SAT. (SeeChapter7.)Intheworstcase,therefore,w ecannotexpecttosolve ,however, general-purposeCSPalgorithmscansolve problemsorders ofmagnitudelargerthanthosesolvableviathe general-purposesearchalgorithmsthatwesaw forexample, ,whenschedulingconstructionjobsontoa calendar, eachjob sstartdateis a ,it is , ,ifJob1, whichtakesfive days,mustprecedeJob3, thenwewouldneeda constraintlanguageofalgebraicinequalitie ssuchasStartJob1+ 5 StartJob3.

7 It is alsonolongerpossibletosolve suchconstraintsbyenumeratingallpossiblea ssignments,becausethereareinfinitelymany (whichwewillnotdiscusshere)existforlinea rconstraintsonintegervariables thatis, constraints ,suchastheonejustgiven , , ,ina schedulingproblem, , ;thestartandfinishofeachobservationandma neuverarecontinuous-valuedvariablesthatm ustobey a varietyofastronomical,precedence, thatoflinearprogrammingproblems, timepolynomialin functionshave alsobeenstudied quadraticprogramming,second-orderconicpr ogramming, ,it is usefultolookat theunaryconstraint, whichrestrictstheUNARY CONSTRAINT valueofa ,it couldbethecasethatSouthAustraliansactive lydislike thecolorgreen.

8 Everyunaryconstraintcanbeeliminatedsimpl ybypreprocessingthedomainofthecorrespond ingvariabletoremove any ,SA6=NSWis a CONSTRAINT binaryCSPis onewithonlybinaryconstraints;it canberepresentedasa constraintgraph, (b).Higher-orderconstraintsinvolve ( (a).)It is usualtoinsistthateachletterinCRYPTARITHM ETICa cryptarithmeticpuzzlerepresenta (a)),thiswouldberepresentedasthesix-vari ableconstraintAlldi (F; T; U; W; R; O). Alternatively, it canberepresentedbya collectionofbinaryconstraintssuchasF6=T. Theadditionconstraintsonthefourcolumnsof thepuzzlealsoinvolve severalvariablesandcanbewrittenasO+O=R+ 10 X1X1+W+W=U+ 10 X2X2+T+T=O+ 10 X3X3=FwhereX1,X2, andX3areauxiliaryvariablesrepresentingth edigit(0or1)carriedover , (b).

9 Thesharp-eyedreaderwillhave noticedthattheAlldi constraintcanbebrokendownintobinaryconst raints F6=T,F6=U, , , everyhigher-order, finite-domainconstraintcanbereducedto a setofbinaryconstraintsif , describedsofarhave allbeenabsoluteconstraints,violationofwh ichrulesouta ,ina universitytimetablingproblem, teachingat 2 solution( ), forexample, pointsagainsttheoverallobjective function, , (a)OWTFUR(b)+FTTOWWUOORX3X1X2 Figure (a)A distinctdigit;theaimistofinda substitutionofdigitsforletterssuchthatth eresultingsumis arithmeticallycorrect,withtheaddedrestri ctionthatnoleadingzeroesareallowed.(b)Th econstrainthypergraphforthecryptarithmet icproblem,showingtheAlldi a squareboxconnectedtothevariablesit , donotdiscusssuchCSPsfurtherinthischapter , a ,any ofthesearchalgorithmsfromChapters3 and4 cansolve quicklynoticesomethingterrible:thebranch ingfactorat thetoplevel isnd, becauseanyofdvaluescanbeassignedtoany ,thebranchingfactoris(n 1)d, generatea treewithn!

10 Dnleaves,eventhoughthereareonlydnpossibl ecompleteassignments!Ourseeminglyreasona blebut na ve problemformulationhasignoreda crucialpropertycommontoallCSPs:commutati vity. A problemis commutative if theorderofapplicationCOMMUTATIVITY ofany ,whenassigningvaluestovariables,wereacht hesamepartialassignment,regardlessoforde r. Therefore,allCSPsearch algorithmsgeneratesuccessors byconsideringpossibleassignmentsforonlya singlevariableateach nodeinthesearch ,attherootnodeofa searchtreeforcoloringthemapofAustralia,w emighthave a choicebetweenSA=red,SA=green, andSA=blue, butwewouldneverchoosebetweenSA=redandWA= blue. Withthisrestriction,thenumberofleavesisd n, usedfora depth-firstsearchthatchoosesvaluesforBAC KTRACKINGSEARCH onevariableat a timeandbacktrackswhena variablehasnolegal uses,ineffect, (csp)returnsa solution,orfailurereturnRECURSIVE-BACKTR ACKING(fg,csp)functionRECURSIVE-BACKTRAC KING(assignment,csp)returnsa solution,orfailureifassignmentis completethenreturnassignmentvar SELECT-UNASSIGNED-VARIABLE(VARIABLES[csp ],assignment,csp)foreachvalueinORDER-DOM AIN-VALUES(var,assignment,csp)


Related search queries