1 / 24

Adversarial Search جستجوی تخاصمی

Adversarial Search جستجوی تخاصمی. Chapter 6 Section 1 – 4 Modified by Vali Derhami. Outline. Optimal decisions α-β pruning Imperfect, real-time decisions. Games vs. search problems. "Unpredictable" opponent  specifying a move for every possible opponent reply

brede
Télécharger la présentation

Adversarial Search جستجوی تخاصمی

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. Adversarial Searchجستجوی تخاصمی Chapter 6 Section 1 – 4 Modified by Vali Derhami

  2. Outline • Optimal decisions • α-β pruning • Imperfect, real-time decisions

  3. Games vs. search problems • "Unpredictable" opponent  specifying a move for every possible opponent reply • در اکثر بازی ها زمان محدود است. • ممکن است بدست آوردن بهترین تصمیم Optimal Decision امکان پذیر نباشد.لذا راه حل معقول انتخاب می شود. • محدودیت های زمانی=> هدف باید تخمین زده شود.

  4. بازی به عنوان یک مسأله جستجو • حالت اولیه: موقعیت صفحه بازی و تعیین نوبت حرکت فرض: MAX شروع کننده • تابع پسین (عملگرها): حرکت های مجاز هر بازیکن • آزمون پایانی: تعیین اتمام بازی. • تابع سودمندی: اختصاص مقدار به حالات پایانی. • بالاترین مقدار: برنده شدن MAX • پایین ترین مقدار: برنده شدن MIN • مقدار میانی: تساوی • MAX باید یک راهبرد اقتضایی بیابد که با توجه به حرکات MIN منجر به برنده شدن آن بشود.

  5. Game tree (2-player, deterministic, turns)

  6. Minimax • Perfect play for deterministic games Idea: choose move to position with highest minimax value = best achievable payoff against best play بهترین امکان دست یافتنی در مقابل بهترین حرکت حریف در سطح حریف مینیمم و در سطح خودمان (MAX) می گیریم. • E.g., 2-ply game:

  7. Minimax algorithm

  8. Properties of minimax • Complete? Yes (if tree is finite) • Optimal? Yes (against an optimal opponent) اگر حریف حرکت بهینه کند، روش هم بهینه است! • Time complexity? O(bm) • کل درخت جستجو باید بررسی شود. • Space complexity? O(bm) (depth-first exploration) • For chess, b ≈ 35, m ≈100 for "reasonable" games exact solution completely infeasible

  9. α-β pruning example

  10. α-β pruning example

  11. α-β pruning example

  12. α-β pruning example

  13. α-β pruning example

  14. Properties of α-β • Pruning does not affect final result هرس شاخه هایی که در نتیجه نهایی تاثیری ندارند • Good move ordering improves effectiveness of pruning With "perfect ordering," time complexity = O(bm/2) • doubles depth of search α (بیشترین مقدار): بهترین مقدار یافت شده برای گره MAX β(کمترین مقدار): بهترین مقدار یافت شده برای گره MIN به محض آنکه مقدار گره جاری از مقدار α (برای سطح MAX) و β( برای سطح MIN) بدتر شود شاخه های باقی مانده از گره هرس می شوند.

  15. α is the value of the best (i.e., highest-value) choice found so far at any choice point along the path for MAX If v is worse than α, MAX will avoid it  prune that branch Define β similarly for MIN Why is it called α-β?

  16. The α-β algorithm

  17. The α-β algorithm

  18. Example

  19. Resource limitsمحدودیت های منابع در مسایل پیچیده امکان بررسی کامل درخت بازی بخاطر مشکل زمان و فضا وجود ندارد. نمونه واضح آن مساله شطرنج است. Standard approach: • cutoff test: (تست محل قطع به جای آزمون هدف) e.g., depth limit (perhaps add quiescence search) • evaluation function (تخمین ارزش بجای تابع سودمندی) = estimated desirability of position

  20. Evaluation functions • For chess, typically linear weighted sum of features Eval(s) = w1 f1(s) + w2 f2(s) + … + wn fn(s) • e.g., w1 = 9 with f1(s) = (number of white queens) – (number of black queens), etc. • ویژگی های یک تابع تخمین ارزش: • حالات انتهایی را همانند تابع سودمندی مرتب کند. • حجم محاسباتی کم • وابستگی مناسب به شانس برنده شدن

  21. Cutting off search MinimaxCutoff is identical to MinimaxValue except دو روش مانند هم است اگر جایگزینی ها در شکل 6-7 اسلایدهای 16و 17 داده شود. • Terminal? is replaced by Cutoff? • Utility is replaced by Eval Does it work in practice? اگر کامپیوتر ما توان ارزیابی یک میلیون نود در ثانیه داشته باشد bm = 106, b=35  m=4 4-ply lookahead is a hopeless chess player! • 4-ply ≈ human novice • 8-ply ≈ typical PC, human master • 12-ply ≈ Deep Blue, Kasparov

  22. Deterministic games in practice • Checkers: Chinook ended 40-year-reign of human world champion Marion Tinsley in 1994. Used a precomputed endgame database defining perfect play for all positions involving 8 or fewer pieces on the board, a total of 444 billion positions. • Chess: Deep Blue defeated human world champion Garry Kasparov in a six-game match in 1997. Deep Blue searches 200 million positions per second, uses very sophisticated evaluation, and undisclosed methods for extending some lines of search up to 40 ply. • Othello: human champions refuse to compete against computers, who are too good. • Go: human champions refuse to compete against computers, who are too bad. In go, b > 300, so most programs use pattern knowledge bases to suggest plausible moves.

  23. Summary • Games are fun to work on! • They illustrate several important points about AI • perfection is unattainable  must approximate • good idea to think about what to think about • بازیهای دارای عامل شانس را خودتان بخوانید

More Related