mywbut.com Two agent games : alpha beta pruning

Similar documents
Module 3. Problem Solving using Search- (Two agent) Version 2 CSE IIT, Kharagpur

Adversary Search. Ref: Chapter 5

ARTIFICIAL INTELLIGENCE (CS 370D)

Adversarial Search 1

game tree complete all possible moves

2 person perfect information

Adversarial Search and Game Playing. Russell and Norvig: Chapter 5

Games (adversarial search problems)

CMPUT 396 Tic-Tac-Toe Game

CS 771 Artificial Intelligence. Adversarial Search

Computer Science and Software Engineering University of Wisconsin - Platteville. 4. Game Play. CS 3030 Lecture Notes Yan Shi UW-Platteville

Announcements. Homework 1 solutions posted. Test in 2 weeks (27 th ) -Covers up to and including HW2 (informed search)

Playing Games. Henry Z. Lo. June 23, We consider writing AI to play games with the following properties:

Algorithms for Data Structures: Search for Games. Phillip Smith 27/11/13

Game-Playing & Adversarial Search

CS 2710 Foundations of AI. Lecture 9. Adversarial search. CS 2710 Foundations of AI. Game search

Adversarial Search and Game- Playing C H A P T E R 6 C M P T : S P R I N G H A S S A N K H O S R A V I

Game-playing AIs: Games and Adversarial Search FINAL SET (w/ pruning study examples) AIMA

CS 1571 Introduction to AI Lecture 12. Adversarial search. CS 1571 Intro to AI. Announcements

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

Adversarial Search (Game Playing)

Set 4: Game-Playing. ICS 271 Fall 2017 Kalev Kask

Game Playing. Why do AI researchers study game playing? 1. It s a good reasoning problem, formal and nontrivial.

CSE 473: Artificial Intelligence Fall Outline. Types of Games. Deterministic Games. Previously: Single-Agent Trees. Previously: Value of a State

CS188 Spring 2010 Section 3: Game Trees

Adversarial Search. Human-aware Robotics. 2018/01/25 Chapter 5 in R&N 3rd Ø Announcement: Slides for this lecture are here:

CS 440 / ECE 448 Introduction to Artificial Intelligence Spring 2010 Lecture #5

Artificial Intelligence 1: game playing

CSE 332: Data Structures and Parallelism Games, Minimax, and Alpha-Beta Pruning. Playing Games. X s Turn. O s Turn. X s Turn.

Programming Project 1: Pacman (Due )

Adversarial Search Aka Games

Project 1. Out of 20 points. Only 30% of final grade 5-6 projects in total. Extra day: 10%

2359 (i.e. 11:59:00 pm) on 4/16/18 via Blackboard

Artificial Intelligence. Minimax and alpha-beta pruning

Adversarial Search. Rob Platt Northeastern University. Some images and slides are used from: AIMA CS188 UC Berkeley

Game-Playing & Adversarial Search Alpha-Beta Pruning, etc.

CS188 Spring 2010 Section 3: Game Trees

CS885 Reinforcement Learning Lecture 13c: June 13, Adversarial Search [RusNor] Sec

CSC 380 Final Presentation. Connect 4 David Alligood, Scott Swiger, Jo Van Voorhis

V. Adamchik Data Structures. Game Trees. Lecture 1. Apr. 05, Plan: 1. Introduction. 2. Game of NIM. 3. Minimax

Game Playing State-of-the-Art

CS 4700: Foundations of Artificial Intelligence

2/5/17 ADVERSARIAL SEARCH. Today. Introduce adversarial games Minimax as an optimal strategy Alpha-beta pruning Real-time decision making

CSE : Python Programming

CS 5522: Artificial Intelligence II

16.410/413 Principles of Autonomy and Decision Making

CPS331 Lecture: Search in Games last revised 2/16/10

Adversarial Search. Read AIMA Chapter CIS 421/521 - Intro to AI 1

Artificial Intelligence

More on games (Ch )

CS 331: Artificial Intelligence Adversarial Search II. Outline

COMP9414: Artificial Intelligence Adversarial Search

More on games (Ch )

CS 188: Artificial Intelligence Spring Announcements

Foundations of Artificial Intelligence

Game Tree Search. CSC384: Introduction to Artificial Intelligence. Generalizing Search Problem. General Games. What makes something a game?

CPS 570: Artificial Intelligence Two-player, zero-sum, perfect-information Games

Game Playing State-of-the-Art CSE 473: Artificial Intelligence Fall Deterministic Games. Zero-Sum Games 10/13/17. Adversarial Search

Game-playing AIs: Games and Adversarial Search I AIMA

Adversarial Search. CS 486/686: Introduction to Artificial Intelligence

For slightly more detailed instructions on how to play, visit:

CS 188: Artificial Intelligence. Overview

ADVERSARIAL SEARCH. Chapter 5

Computer Game Programming Board Games

CS 188: Artificial Intelligence

Artificial Intelligence Lecture 3

Announcements. Homework 1. Project 1. Due tonight at 11:59pm. Due Friday 2/8 at 4:00pm. Electronic HW1 Written HW1

Game Playing AI Class 8 Ch , 5.4.1, 5.5

INF September 25, The deadline is postponed to Tuesday, October 3

CS 188: Artificial Intelligence

ADVERSARIAL SEARCH. Today. Reading. Goals. AIMA Chapter , 5.7,5.8

Game Playing State-of-the-Art. CS 188: Artificial Intelligence. Behavior from Computation. Video of Demo Mystery Pacman. Adversarial Search

CS 188: Artificial Intelligence Spring 2007

Five-In-Row with Local Evaluation and Beam Search

CS188 Spring 2014 Section 3: Games

Adversarial Search. CS 486/686: Introduction to Artificial Intelligence

Data Structures and Algorithms

Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am

Rules of the game. chess checkers tic-tac-toe...

More Adversarial Search

CSC 396 : Introduction to Artificial Intelligence

Adversarial Search. Robert Platt Northeastern University. Some images and slides are used from: 1. CS188 UC Berkeley 2. RN, AIMA

Adversarial Search and Game Playing

1 Introduction. 1.1 Game play. CSC 261 Lab 4: Adversarial Search Fall Assigned: Tuesday 24 September 2013

Lecture 14. Questions? Friday, February 10 CS 430 Artificial Intelligence - Lecture 14 1

Games and Adversarial Search II

Game Engineering CS F-24 Board / Strategy Games

Game Tree Search 1/6/17

Adversarial Search. Hal Daumé III. Computer Science University of Maryland CS 421: Introduction to Artificial Intelligence 9 Feb 2012

Game Playing State of the Art

Recherche Adversaire

CS61B Lecture #22. Today: Backtracking searches, game trees (DSIJ, Section 6.5) Last modified: Mon Oct 17 20:55: CS61B: Lecture #22 1

Last update: March 9, Game playing. CMSC 421, Chapter 6. CMSC 421, Chapter 6 1

Ar#ficial)Intelligence!!

Artificial Intelligence

Artificial Intelligence. Topic 5. Game playing

Announcements. CS 188: Artificial Intelligence Spring Game Playing State-of-the-Art. Overview. Game Playing. GamesCrafters

Adversarial Search: Game Playing. Reading: Chapter

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class

CSE 473: Artificial Intelligence. Outline

Transcription:

Two agent games : alpha beta pruning 1

3.5 Alpha-Beta Pruning ALPHA-BETA pruning is a method that reduces the number of nodes explored in Minimax strategy. It reduces the time required for the search and it must be restricted so that no time is to be wasted searching moves that are obviously bad for the current player. The exact implementation of alpha-beta keeps track of the best move for each side as it moves throughout the tree. We proceed in the same (preorder) way as for the minimax algorithm. For the MIN nodes, the score computed starts with +infinity and decreases with time. For MAX nodes, scores computed starts with -infinity and increase with time. The efficiency of the Alpha-Beta procedure depends on the order in which successors of a node are examined. If we were lucky, at a MIN node we would always consider the nodes in order from low to high score and at a MAX node the nodes in order from high to low score. In general it can be shown that in the most favorable circumstances the alpha-beta search opens as many leaves as minimax on a game tree with double its depth. Here is an example of Alpha-Beta search: 3.5.1 Alpha-Beta algorithm: The algorithm maintains two values, alpha and beta, which represent the minimum score that the maximizing player is assured of and the maximum score that the minimizing player is assured of respectively. Initially alpha is negative infinity and beta is positive infinity. As the recursion progresses the "window" becomes smaller. 2

When beta becomes less than alpha, it means that the current position cannot be the result of best play by both players and hence need not be explored further. Pseudocode for the alpha-beta algorithm is given below. Questions evaluate (node, alpha, beta) if node is a leaf return the heuristic value of node if node is a minimizing node for each child of node beta = min (beta, evaluate (child, alpha, beta)) if beta <= alpha return beta return beta if node is a maximizing node for each child of node alpha = max (alpha, evaluate (child, alpha, beta)) if beta <= alpha return alpha return alpha 1. Suppose you and a friend of yours are playing a board game. It is your turn to move, and the tree below represents your situation. The values of the evaluation function at the leaf nodes are shown in the tree. Note that in this tree not all leaf nodes are at the same level. Use the minimax procedure to select your next move. Show your work on the tree below. 3

2. In the above tree use the minimax procedure along with alpha-beta pruning to select the next move. Mark the nodes that don t need to be evaluated. 3. Consider the game of tic-tac-toe. Assume that X is the MAX player. Let the utility of a win for X be 10, a loss for X be -10, and a draw be 0. a) Given the game board board1 below where it is X s turn to play next, show the entire game tree. Mark the utilities of each terminal state and use the minimax algorithm to calculate the optimal move. b) Given the game board board2 below where it is X s turn to play next, show the game tree with a cut-off depth of two ply (i.e., stop after each player makes one move). Use the following evaluation function on all leaf nodes: Eval(s) = 10X3(s) + 3X2(s) + X1(s) (10O3(s) + 3O2(s) + O1(s)) where we define Xn(s) as the number of rows, columns, or diagonals in state s with exactly n X s and no O s, and similarly define On(s) as the number of rows, columns, or diagonals in state s with exactly n O s and no X s. Use the minimax algorithm to determine X s best move. Solution 1. The second child of the root node as your next move since that child produces the highest gain. 2. Nodes marked with an "X" are not evaluated when alpha-beta pruning is used. None of the nodes in the subtree rooted at the node marked with an "X" in the third level of the tree are evaluated. 4

3.a. The game tree is shown below 5

3.b. The values are shown below 6