COMP9414: Artificial Intelligence Adversarial Search

Similar documents
ARTIFICIAL INTELLIGENCE (CS 370D)

COMP9414: Artificial Intelligence Problem Solving and Search

Artificial Intelligence 1: game playing

Adversary Search. Ref: Chapter 5

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

Artificial Intelligence. Topic 5. Game playing

Game playing. Chapter 5, Sections 1 6

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

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 2 February, 2018

Adversarial Search (Game Playing)

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

Programming Project 1: Pacman (Due )

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

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

Game Playing. Dr. Richard J. Povinelli. Page 1. rev 1.1, 9/14/2003

mywbut.com Two agent games : alpha beta pruning

Artificial Intelligence. Minimax and alpha-beta pruning

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

Games (adversarial search problems)

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

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

Adversarial Search and Game Playing

Game-Playing & Adversarial Search

Adversarial Search 1

COMP219: Artificial Intelligence. Lecture 13: Game Playing

Foundations of Artificial Intelligence

CS 188: Artificial Intelligence Spring 2007

2 person perfect information

Games and Adversarial Search II

Adversarial search (game playing)

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

Game Playing AI Class 8 Ch , 5.4.1, 5.5

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

Today. Nondeterministic games: backgammon. Algorithm for nondeterministic games. Nondeterministic games in general. See Russell and Norvig, chapter 6

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

Foundations of AI. 5. Board Games. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard and Luc De Raedt SA-1

Adversarial Search. Soleymani. Artificial Intelligence: A Modern Approach, 3 rd Edition, Chapter 5

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

Artificial Intelligence Adversarial Search

Ar#ficial)Intelligence!!

Foundations of AI. 6. Board Games. Search Strategies for Games, Games with Chance, State of the Art

Outline. Game Playing. Game Problems. Game Problems. Types of games Playing a perfect game. Playing an imperfect game

CS 771 Artificial Intelligence. Adversarial Search

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

CS188 Spring 2010 Section 3: Game Trees

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

CS188 Spring 2010 Section 3: Game Trees

Game playing. Chapter 5. Chapter 5 1

Foundations of Artificial Intelligence

Game playing. Chapter 5, Sections 1{5. AIMA Slides cstuart Russell and Peter Norvig, 1998 Chapter 5, Sections 1{5 1

ADVERSARIAL SEARCH. Today. Reading. Goals. AIMA Chapter Read , Skim 5.7

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

Foundations of Artificial Intelligence

CS 380: ARTIFICIAL INTELLIGENCE ADVERSARIAL SEARCH. Santiago Ontañón

Game Playing Beyond Minimax. Game Playing Summary So Far. Game Playing Improving Efficiency. Game Playing Minimax using DFS.

Adversarial Search Aka Games

Adversarial Search. CMPSCI 383 September 29, 2011

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

COMP219: COMP219: Artificial Intelligence Artificial Intelligence Dr. Annabel Latham Lecture 12: Game Playing Overview Games and Search

game tree complete all possible moves

Path Planning as Search

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

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

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

Adversarial Search: Game Playing. Reading: Chapter

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

CS188 Spring 2014 Section 3: Games

CS 331: Artificial Intelligence Adversarial Search II. Outline

Artificial Intelligence

ADVERSARIAL SEARCH. Chapter 5

CSE 40171: Artificial Intelligence. Adversarial Search: Game Trees, Alpha-Beta Pruning; Imperfect Decisions

CSE 573: Artificial Intelligence Autumn 2010

Foundations of AI. 6. Adversarial Search. Search Strategies for Games, Games with Chance, State of the Art. Wolfram Burgard & Bernhard Nebel

Lecture 5: Game Playing (Adversarial Search)

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

CS 380: ARTIFICIAL INTELLIGENCE

CS 188: Artificial Intelligence

Adverserial Search Chapter 5 minmax algorithm alpha-beta pruning TDDC17. Problems. Why Board Games?

Today. Types of Game. Games and Search 1/18/2010. COMP210: Artificial Intelligence. Lecture 10. Game playing

Artificial Intelligence

CSC384: Introduction to Artificial Intelligence. Game Tree Search

Artificial Intelligence. 4. Game Playing. Prof. Bojana Dalbelo Bašić Assoc. Prof. Jan Šnajder

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

Contents. Foundations of Artificial Intelligence. Problems. Why Board Games?

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

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

Artificial Intelligence, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 4: Search 3.

Game Playing: Adversarial Search. Chapter 5

Ch.4 AI and Games. Hantao Zhang. The University of Iowa Department of Computer Science. hzhang/c145

Game playing. Outline

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

Game-playing AIs: Games and Adversarial Search I AIMA

Outline. Game playing. Types of games. Games vs. search problems. Minimax. Game tree (2-player, deterministic, turns) Games

Artificial Intelligence Search III

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

Game Engineering CS F-24 Board / Strategy Games

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

Games vs. search problems. Adversarial Search. Types of games. Outline

Game Tree Search. Generalizing Search Problems. Two-person Zero-Sum Games. Generalizing Search Problems. CSC384: Intro to Artificial Intelligence

Game Playing. Philipp Koehn. 29 September 2015

Transcription:

CMP9414, Wednesday 4 March, 004 CMP9414: Artificial Intelligence In many problems especially game playing you re are pitted against an opponent This means that certain operators are beyond your control Wayne Wobcke Room J17-433 wobcke@cse.unsw.edu.au Based on slides by Maurice Pagnucco That is, you cannot control your opponent s moves You cannot search the entire space from the outset looking for a solution since your opponent may make a move which makes any path you find obsolete What you need is a strategy that leads to a winning position regardless of how your opponent plays CMP9414 c UNSW, 004 CMP9414, Wednesday 4 March, 004 1 CMP9414, Wednesday 4 March, 004 3 Shall investigate two uses of search where we can apply other strategies to search the state space In particular we shall investigate adversarial search in which we search through a space where not all operators (choices) are under our control We shall also briefly discuss constraint satisfaction problems verview Minimax Constraint Satisfaction as Search Conclusion Reference: Ivan Bratko, Prolog Programming for Artificial Intelligence, Addison-Wesley, 001. (Chapter ) Stuart J. Russell and Peter Norvig, Artificial Intelligence: A Modern Approach, Second Edition, Pearson Education, 003. (Chapter 6)

CMP9414, Wednesday 4 March, 004 4 Games as Search Problems Require the following components: initial state board position plus which player has first move operators legal moves terminal test determines if game is completed utility function numeric value for outcome of game CMP9414, Wednesday 4 March, 004 6 Minimax Criterion Assume game tree of uniform depth (to simplify matters) Generate entire game tree Apply utility function to each terminal state To determine utility of nodes at any level, if Min s turn to play it will choose child with minimum utility, otherwise Max will choose child with maximum utility Continue backing up values from leaf to root, one level at a time Maximizes utility under assumption that opponent will play perfectly to minimize it (assuming also opponent has same evaluation function) CMP9414, Wednesday 4 March, 004 Example Tic-Tac-Toe CMP9414, Wednesday 4 March, 004 7 Minimax Example Max () Max Min () Max () Min Min () Terminal 10 7 8 1 3 Utility +1 0-1

CMP9414, Wednesday 4 March, 004 8 Minimax Algorithm CMP9414, Wednesday 4 March, 004 10 function MinimaxValue(state, game) returns utility value if TerminalTest[game](state) then return Utility[game](state) else if Max is to move in state then return highest MinimaxValue of successors(state) else return lowest MinimaxValue of successors(state) Idea: Consider node n in search tree such that certain player has a choice of moving to that node If the player has a better choice m either at the parent node of n, or at any choice point further up, then n will never be reached in actual play nce we have ascertained enough information about n by looking at some of its successors to reach this decision, we can prune it CMP9414, Wednesday 4 March, 004 9 CMP9414, Wednesday 4 March, 004 11 In most games it will be impossible to try and calculate minimax as described the game tree will be just too big There is however a way of pruning the amount of work to be done and still make the correct minimax decision Pruning elimination of branches from the search without examination Alpha-beta pruning returns a pruned minimax tree m n

CMP9414, Wednesday 4 March, 004 1 CMP9414, Wednesday 4 March, 004 14 Algorithm Minimax is depth-first At any point we only have to consider the nodes on a single path in the search tree Suppose α is the value of the best choice for Max on the path and β the value of the best choice for Min on the path Alpha-beta updates the values of α and β and prunes any subtree as soon as it can determine whether it is worse than the current α or β function MaxValue(state, game, α, β) returns minimax value of state if CutoffTest(state) then return Eval(state) for each s in Successors(state) do α Max(α,MinValue(s, game, α,β)) if α β then return β return α function MinValue(state, game, α, β) returns minimax value of state if CutoffTest(state) then return Eval(state) for each s in Successors(state) do β Min(β,MaxValue(s, game, α,β)) if β α then return α return β CMP9414, Wednesday 4 March, 004 13 Example CMP9414, Wednesday 4 March, 004 1 Games of Chance Max Min <= <=3 Many problems and many games include an element of chance For example, the roll of dice (backgammon) The game tree must now include chance nodes representing the element of chance and labelled with the likelihood that the given chance event will occur We must now work with expected values expectimax(c) = i P(d i )max s S(C, di )(utility(s)) 10 7 1 3

CMP9414, Wednesday 4 March, 004 16 Constraint Satisfaction Problems CMP9414, Wednesday 4 March, 004 18 Conclusion Constraint Satisfaction Problems (CSPs) are problems in which states are defined by the values taken by a set of variables and the goal test specifies a set of constraints the values must satisfy Problems that can be expressed as CSPs: N-queens, VLSI layout, scheduling, cryptarithmetic Can use search to look for an assignment of values to variables such that the constraints are satisfied CSP has become a powerful and commonly used technique in AI with its own algorithms for determining variable assignments (e.g. arc consistency, hill climbing, simulated annealing, etc.) Search is a common technique in problem solving especially when our knowledge of the problem or domain is limited It is important to spend some time thinking about the problem in order to decide how the problem states will be represented and which search strategy to apply We have only investigated a small number of search techniques We have examined some uninformed (blind) and informed (heuristic) strategies plus some techniques for adversarial search and constraint satisfaction problems CMP9414, Wednesday 4 March, 004 17 Constraint Satisfaction Problems S E N D M R E + M N E Y