/5/20 ITEC220 Introdution to Dt Strutures Leture 0 Gme Trees Two-Plyer Gmes Rules for gme define the sttespe Nodes re gme sttes Links re possile moves Build serh tree y rute fore Exmple I Exmple II A Our moves A Our moves E B Their C D moves F Wht is our mximum pyoff 0 (stte E) G 0 0 5 Pyoffs H I J E B Their C D moves F G 0 0 5 Pyoffs How do we get there? Move to stte B H I J
/5/20 Exmple III E Wht will our opponent do? Move to stte F Pyoff = 0 A B Their C D moves F G 0 0 5 Pyoffs H Our moves I J Evluting Two-Plyer Gme Eh stte is stti ord position The evlution depends on the susequent moves e.g. Cpturing piee n look good, ut the overll exhnge my e negtive Minimx Serh Proedure I Depth-first, depth-limited serh proedure Depth-first opportunity for pruning Depth-limited hess level Minimx Serh Proedure II We wnt to mximize, our opponent wnts to minimize Alternting levels propgte mximum or minimum vlue Opponent s gol is to minimize our mximum (minimx) 2
/5/20 Minimx Serh Proedure III Minimx Serh Proedure IV A Mximize A Mximize B Minimize C D B Minimize C D E F G H I J 0 0 5 B pyoff = min (0,0) = 0 Pyoffs E F G H I J 0 0 5 C pyoff = min (,) = Pyoffs Minimx Serh Proedure V Minimx Serh Proedure VI A Mximize A Mximize B Minimize C D B Minimize C D E F G H I J 0 0 5 D pyoff = min (,5) = Pyoffs E F G H I J 0 0 5 A pyoff = mx (0,,) = Pyoffs
/5/20 Minimx Serh Proedure VII Optiml gme (ssume opponent will lwys mke est move) We hoose D, opponent hooses I Pyoff is Risky gme (tke hnes tht opponent n mke mistkes) Choose C Risk of ( less) for rewrd of (2 more) Alph-Bet Pruning I Pruning eliminte su-tree when it is no longer vile Two vlues: Alph lower ound on mximizing vlue Bet upper ound on minimizing vlue Prune su-tree when lph nd et rete onflit Alph-Bet Pruning II Alph-Bet Pruning III The full serh tree possile Whih nodes n e pruned? Depth-first Strt t the fr left
/5/20 Alph-Bet Pruning IV Alph-Bet Pruning V Nothing to propgte yet Continue with ll silings Determine vlue of node ove mx(,) = Alph-Bet Pruning VI Alph-Bet Pruning VII <= <= Clulte et for node ove et = Go to fr left of next su-tree 5
/5/20 Alph-Bet Pruning VIII Alph-Bet Pruning IX <= <= >= >= Clulte lph for node ove lph = Conflit! No vlues <= nd >= Prune remining silings Alph-Bet Pruning X >= Alph-Bet Pruning XI >= Propgte vlues up Set lph = t top node Depth-first Strt t the fr left
/5/20 Alph-Bet Pruning XII >= Alph-Bet Pruning XIII >= >= >= Clulte lph Two lphs nnot hve onflit Continue with siling Alph-Bet Pruning XIV >= Alph-Bet Pruning XV >= <= Determine vlue of node ove mx(,) = Clulte et for node ove et =
/5/20 Alph-Bet Pruning XVI >= Alph-Bet Pruning XVII >= <= Conflit! No vlues >= nd <= Prune remining silings Depth-first Strt t the fr left Alph-Bet Pruning XVIII >= Alph-Bet Pruning XIX >= >= >= Clulte lph Two lphs nnot hve onflit Continue with siling Continue to siling s hild
/5/20 Alph-Bet Pruning XX >= Alph-Bet Pruning XXI >= >= >= <= <= Clulte et for node ove et = Conflit! No vlues >= nd <= Prune remining silings Alph-Bet Pruning XXII >= Alph-Bet Pruning XXIV >= <= Propgte vlues Clulte et for node ove et =
/5/20 Alph-Bet Pruning XXV >= Alph-Bet Pruning XXVI >= <= <= No onflit Continue with serh Depth-first Strt t the fr left Alph-Bet Pruning XXVII >= Alph-Bet Pruning XXVIII >= <= <= >= >= Clulte lph for node ove lph = No onflit Continue with serh 0
/5/20 Alph-Bet Pruning XXIX >= Alph-Bet Pruning XXX >= <= Propgte Propgte Alph-Bet Pruning XXXI Alph-Bet Pruning XXXII Propgte We should pik move Rewrd will e
/5/20 Finl Exmple I Finl Exmple II 2 2 Vlues will e ll printed Minimx first Propgte minimum vlues Finl Exmple III Finl Exmple IV 2 2 Propgte mximum vlues Propgte minimum vlues 2
/5/20 Finl Exmple V Finl Exmple VI 2 2 Propgte mximum vlues Move is, rewrd is Vlues will e ll printed Pretend they ren t Finl Exmple VII Finl Exmple VIII <= <= >= 2 2 Strt t left No onflit Continue
/5/20 Finl Exmple IX Finl Exmple X >= <= >= <= 2 2 Conflit! Prune silings Propgte Finl Exmple XI >= Finl Exmple XII >= <= <= 2 2 Strt t left Conflit! Prune silings
/5/20 Finl Exmple XIII >= Finl Exmple XIV >= >= 2 2 Propgte Strt t left Finl Exmple XV >= Finl Exmple XVI >= <= >= <= 2 2 Continue Propgte 5
/5/20 Finl Exmple XVII >= Finl Exmple XVIII >= <= <= >= >= 2 2 Continue Conflit! Prune silings Finl Exmple XIX Finl Exmple XX 2 2 Propgte Sme nswer Move is, rewrd is
/5/20 Redings nd Assignments Suggested Redings from Shffer (third edition)