game playing introduc3on
play

Game Playing Introduc3on One of the earliest areas in - PowerPoint PPT Presentation

Game Playing Introduc3on One of the earliest areas in ar3ficial intelligence is game playing. Two-person zero-sum game. Games for which


  1. Game ¡Playing ¡

  2. Introduc3on ¡ • One ¡of ¡the ¡earliest ¡areas ¡in ¡ar3ficial ¡ intelligence ¡is ¡game ¡playing. ¡ ¡ • Two-­‑person ¡zero-­‑sum ¡game. ¡ • Games ¡for ¡which ¡the ¡state ¡space ¡is ¡ small ¡enough ¡– ¡generate ¡the ¡en3re ¡ space. ¡ • Games ¡for ¡which ¡the ¡en3re ¡space ¡ cannot ¡be ¡generated. ¡

  3. The ¡Game ¡NIM ¡ 7 ¡ 6-­‑1 ¡ 5-­‑2 ¡ 4-­‑3 ¡ 5-­‑1-­‑1 ¡ 4-­‑2-­‑1 ¡ 3-­‑2-­‑2 ¡ 3-­‑3-­‑1 ¡ 4-­‑1-­‑1-­‑1 ¡ 3-­‑2-­‑1-­‑1 ¡ 2-­‑2-­‑2-­‑1 ¡ 3-­‑1-­‑1-­‑1 ¡ 2-­‑2-­‑1-­‑1 ¡ 2-­‑1-­‑1-­‑1-­‑1-­‑1 ¡

  4. NIM-­‑ ¡MAX ¡Plays ¡First ¡ ¡ MAX ¡ 7 ¡ MIN ¡ 6-­‑1 ¡ 5-­‑2 ¡ 4-­‑3 ¡ MAX ¡ 5-­‑1-­‑1 ¡ 4-­‑2-­‑1 ¡ 3-­‑2-­‑2 ¡ 3-­‑3-­‑1 ¡ MIN ¡ 4-­‑1-­‑1-­‑1 ¡ 3-­‑2-­‑1-­‑1 ¡ 2-­‑2-­‑2-­‑1 ¡ 1 ¡ . ¡ MAX ¡ 3-­‑1-­‑1-­‑1 ¡ 2-­‑2-­‑1-­‑1 ¡ 0 ¡ 2-­‑1-­‑1-­‑1-­‑1-­‑1 ¡ 1 ¡ MIN ¡

  5. NIM-­‑ ¡MIN ¡Plays ¡First ¡ ¡ MIN ¡ 7 ¡ MAX ¡ 6-­‑1 ¡ 5-­‑2 ¡ 4-­‑3 ¡ MIN ¡ 5-­‑1-­‑1 ¡ 4-­‑2-­‑1 ¡ 3-­‑2-­‑2 ¡ 3-­‑3-­‑1 ¡ MAX ¡ 4-­‑1-­‑1-­‑1 ¡ 3-­‑2-­‑1-­‑1 ¡ 2-­‑2-­‑2-­‑1 ¡ 0 ¡ . ¡ MIN ¡ 3-­‑1-­‑1-­‑1 ¡ 2-­‑2-­‑1-­‑1 ¡ 1 ¡ MAX ¡ 2-­‑1-­‑1-­‑1-­‑1-­‑1 ¡ 0 ¡

  6. Minimax ¡Algorithm ¡ Repeat ¡ • If ¡the ¡limit ¡of ¡search ¡has ¡been ¡reached, ¡compute ¡the ¡ sta3c ¡value ¡of ¡the ¡current ¡posi3on ¡rela3ve ¡to ¡the ¡ appropriate ¡player. ¡ ¡Report ¡the ¡result. ¡ • Otherwise, ¡if ¡the ¡level ¡is ¡a ¡minimizing ¡level, ¡use ¡the ¡ minimax ¡on ¡the ¡children ¡of ¡the ¡current ¡posi3on. ¡ ¡ Report ¡the ¡minimum ¡value ¡of ¡the ¡results. ¡ • Otherwise, ¡if ¡the ¡level ¡is ¡a ¡maximizing ¡level, ¡use ¡the ¡ minimax ¡on ¡the ¡children ¡of ¡the ¡current ¡posi3on. ¡ ¡ Report ¡the ¡maximum ¡of ¡the ¡results. ¡ . ¡ Un3l ¡the ¡en3re ¡tree ¡is ¡traversed ¡

  7. Minimax ¡Applied ¡to ¡NIM ¡ MIN ¡ 1 ¡ 7 ¡ MAX ¡ 1 ¡ 6-­‑1 ¡ 1 ¡ 5-­‑2 ¡ 1 ¡ 4-­‑3 ¡ 0 ¡ MIN ¡ 5-­‑1-­‑1 ¡ 0 ¡ 4-­‑2-­‑1 ¡ 1 ¡ 3-­‑2-­‑2 ¡ 3-­‑3-­‑1 ¡ 1 ¡ MAX ¡ 4-­‑1-­‑1-­‑1 ¡ 0 ¡ 3-­‑2-­‑1-­‑1 ¡ 1 ¡ 2-­‑2-­‑2-­‑1 ¡ 0 ¡ . ¡ 1 ¡ MIN ¡ 3-­‑1-­‑1-­‑1 ¡ 0 ¡ 2-­‑2-­‑1-­‑1 ¡ MAX ¡ 2-­‑1-­‑1-­‑1-­‑1-­‑1 ¡ 0 ¡

  8. Genera3ng ¡the ¡Game ¡Tree ¡to ¡a ¡ Depth ¡ • In ¡some ¡cases ¡the ¡game ¡tree ¡will ¡be ¡ too ¡large ¡to ¡generate. ¡ • In ¡this ¡case ¡the ¡tree ¡is ¡generated ¡to ¡ a ¡certain ¡depth ¡or ¡ply. ¡ • Heuris3c ¡values ¡are ¡used ¡to ¡es3mate ¡ how ¡promising ¡a ¡node ¡is. ¡ . ¡ • Horizon ¡effect ¡ ¡

  9. Example ¡ MAX 3 MIN 3 0 2 MAX 3 0 2 6 7 9 MIN 6 5 2 1 3 2 5 9 0 4 7

  10. Heuris3c ¡for ¡Tic-­‑Tac-­‑Toe ¡ • h(n) ¡= ¡x(n) ¡-­‑ ¡o(n) ¡where ¡ ¡ – x(n) ¡is ¡the ¡total ¡of ¡MAX’s ¡possible ¡ winning ¡lines ¡(we ¡assume ¡MAX ¡is ¡ playing ¡x) ¡ ¡ ¡ – o(n) ¡is ¡the ¡total ¡of ¡MIN’s ¡possible ¡ winning ¡lines ¡ ¡ • h(n) ¡is ¡the ¡total ¡evalua3on ¡for ¡a ¡state ¡ n. ¡ ¡ ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend