1 / 52

INC 551 Artificial Intelligence

INC 551 Artificial Intelligence. Lecture 5 Adversarial Search (Game Playing). Game Playing. Environment ประกอบด้วย “enemies” หรือ “hostile agents”. Enemies are “unpredictable”. To deal with the problem: Consider every possibility of reply. Types of Games. Search Technique.

Download Presentation

INC 551 Artificial Intelligence

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. INC 551 Artificial Intelligence Lecture 5 Adversarial Search (Game Playing)

  2. Game Playing Environment ประกอบด้วย “enemies” หรือ “hostile agents” Enemies are “unpredictable” To deal with the problem: Consider every possibility of reply

  3. Types of Games

  4. Search Technique จะสามารถทำการ search เพื่อหาทางเดินที่ดีที่สุดได้โดยคิดตาเดินจาก enemies มาเป็น branching factor ด้วย หลังจากนั้นจะใช้ minimax algorithm ในการตัดสินใจ

  5. การแตก node ของ Game O-X ผู้เล่น 2 คน ชื่อ Max และ Min

  6. Minimax Algorithm สมมติว่าที่ depth = 2 เป็น terminal states ทั้งหมด

  7. Minimax Algorithm

  8. Property of Minimax Complete: ถ้า search tree มีขนาดจำกัด Optimal: yes ถ้า opponent optimal Time Complexity: Space Complexity: (แบบ Depth-first) For a normal chess game: b=35, m=100 Time??-> infeasible

  9. Real Problem with Minimax จะใช้การ cut-off คือกำหนด depth มากสุดที่จะ search ลงไป และ node ที่ลึกสุดนั้นจะใช้ evaluation function (heuristic) เพื่อประมาณคะแนนของ node นั้น

  10. Heuristics for Game Search ใน game ทั่วไปเราจะไม่สามารถแตก node ไปจนสิ้นสุดได้ (เวลาจำกัด) Heuristics จะถูกใช้ในการประมาณค่าของ state ของ game เมื่อ depth ลึกมากกว่าที่กำหนด

  11. Heuristic in chess – material value Pawn=1, knight=3, bishop=3, rook=5, queen=9

  12. Minimax ใน case ที่ opponentทำพลาดบ้าง

  13. Alpha-beta Pruning Use with minimax for eliminating the nodes that looks bad Each node will keep the lower limit and upper limit of possible score, called alpha and beta value [alpha,beta] Will follow the rules to stop expanding nodes

  14. Rules for Terminating searchon nodes • Stop below any MIN node have a beta value less than • or equal to alpha value of any of its MAX ancestors • Stop below any MAX node have an alpha value greater than • or equal to beta value of any of its MIN ancestors

  15. Alpha-beta Pruning จะไม่ expand node ต่อถ้าพบค่าต่ำๆที่ปลาย

  16. (3,∞) (3,3)

  17. (3,∞) (3,3) (-∞,2)

  18. (3,∞) (3,3) (-∞,14) (-∞,2)

  19. (3,∞) (3,3) (-∞,5) (-∞,2)

  20. (3,3) (2,2) (3,3) (-∞,2)

  21. Alpha-Beta Algorithm

  22. Property of Pruning • Final result ไม่เปลี่ยนแปลง • เรียงลำดับเอา Good move ขึ้นก่อน • จะทำให้ pruning ดี

  23. Deterministic Games in Practice

  24. Games with chance Backgammon

  25. Search Technique with Chance จะเอา chance มาเพิ่มเป็นการแตก node ด้วย เอาคะแนนคูณกับ probability เป็นคะแนนรวมทั้งหมด

  26. Coin-flipping Game เกมส์ที่ต้องมีการโยนเหรียญและเลือกเดินคนละครั้ง เราเดิน โยนเหรียญ เขาเดิน

  27. Alpha-Beta Pruning สามารถทำได้กับ non-deterministic problems โดยกำหนด ขอบเขตของคะแนนในแต่ละ node อย่างไรก็ตาม pruning จะได้น้อยกว่าแบบ deterministic problems

  28. ในกรณีที่เราสามารถกำหนด bound กำหนดคะแนนในช่วง [-2,2]

  29. Case Study (Othello)

  30. Standard Board Size: 8x8 = 64 squares Depth: about 60 moves Branching factor: varied 0-20 Estimated search time for depth 32 = 3 days Estimated search time for depth 60 = 2,100 years

  31. Game playing Tactic • Opening (around move 1-12) • Use opening book • Mid game (around move 13 – 35) • Use Evaluation function • End game (around move 36-end) • Use exhaustive search

  32. Opening There are 3 ways of opening in Othello. Use statistic records for 100,000+ games to determine which opening win the most.

  33. Mid Game • Evaluation function use heuristics to give score to board • position • Don’t play on certain square • Prefer corner • Want great mobility • Edge and corner patterns Evaluation function is the key to strong Othello program

  34. End Game Search to the end

  35. Breakthrough Event Year 1997 : 6 game match Takeshi Murakami (Othello world champion) vs Logistello (by Michael Buro)

More Related