Game Playing AI. Dr. Baldassano Yu s Elite Education

Similar documents
CS 331: Artificial Intelligence Adversarial Search II. Outline

Artificial Intelligence Adversarial 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

Artificial Intelligence. Minimax and alpha-beta pruning

Adversarial Search (Game Playing)

Adversarial Search: Game Playing. Reading: Chapter

Game Playing AI Class 8 Ch , 5.4.1, 5.5

Adversary Search. Ref: Chapter 5

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

Adversarial Search and Game Playing

ARTIFICIAL INTELLIGENCE (CS 370D)

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

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

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

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

Programming Project 1: Pacman (Due )

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

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

CS 188: Artificial Intelligence Spring Announcements

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

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

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

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

CS 188: Artificial Intelligence

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

More Adversarial Search

CS 771 Artificial Intelligence. Adversarial Search

Ar#ficial)Intelligence!!

Adversarial Search 1

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

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

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

Artificial Intelligence Search III

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

Game-Playing & Adversarial Search

Lecture 33: How can computation Win games against you? Chess: Mechanical Turk

Game Playing State-of-the-Art

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

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

CSE 573: Artificial Intelligence Autumn 2010

Game Playing. Garry Kasparov and Deep Blue. 1997, GM Gabriel Schwartzman's Chess Camera, courtesy IBM.

CS 5522: Artificial Intelligence II

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

Artificial Intelligence

2 person perfect information

Adversarial Search. CMPSCI 383 September 29, 2011

Foundations of Artificial Intelligence

Game-playing: DeepBlue and AlphaGo

Adversarial Search Aka Games

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

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

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

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

Foundations of Artificial Intelligence

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

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

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

Game Playing State of the Art

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

CS 188: Artificial Intelligence. Overview

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

Artificial Intelligence. Topic 5. Game playing

Adversarial search (game playing)

Games CSE 473. Kasparov Vs. Deep Junior August 2, 2003 Match ends in a 3 / 3 tie!

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

CITS3001. Algorithms, Agents and Artificial Intelligence. Semester 2, 2016 Tim French

COMP219: Artificial Intelligence. Lecture 13: Game Playing

CS 188: Artificial Intelligence

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

Game Playing. Philipp Koehn. 29 September 2015

CS 188: Artificial Intelligence Spring Game Playing in Practice

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

game tree complete all possible moves

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

Adversarial Search Lecture 7

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

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

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

Local Search. Hill Climbing. Hill Climbing Diagram. Simulated Annealing. Simulated Annealing. Introduction to Artificial Intelligence

4. Games and search. Lecture Artificial Intelligence (4ov / 8op)

CSE 573: Artificial Intelligence

CMPUT 396 Tic-Tac-Toe Game

Artificial Intelligence

Chess Algorithms Theory and Practice. Rune Djurhuus Chess Grandmaster / September 23, 2013

Game-playing AIs: Games and Adversarial Search I AIMA

Artificial Intelligence

CS 4700: Foundations of Artificial Intelligence

Adversarial Search. Chapter 5. Mausam (Based on slides of Stuart Russell, Andrew Parks, Henry Kautz, Linda Shapiro) 1

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

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

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

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

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

Announcements. CS 188: Artificial Intelligence Fall Local Search. Hill Climbing. Simulated Annealing. Hill Climbing Diagram

Artificial Intelligence

CSE 473: Artificial Intelligence. Outline

Artificial Intelligence Lecture 3

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

Path Planning as Search

Transcription:

Game Playing AI Dr. Baldassano chrisb@princeton.edu Yu s Elite Education

Last 2 weeks recap: Graphs Graphs represent pairwise relationships Directed/undirected, weighted/unweights Common algorithms: Shortest path Importance/centrality (pagerank) Strongly connected components Spanning tree

Homework: Superbull http://usaco.org/index.php?page=viewproblem2&cpid=531

Planning with an adversary We ve talked about using graphs for planning Find best plan to goal state using shortest path But often we aren t the only ones trying to accomplish a goal! Playing games Sharing resources, e.g. internet congestion Game playing is a type of adversarial search

A simple game Player 1 picks the color Player 2 picks the shape P1 wins $20 P1 wins $10 P1 loses $20 P1 wins $5

Adversarial search We might not be able to get to the best outcome anymore Assume that other player will act optimally, and make the more that will allow them to cause the least damage to us

Our game as a tree P1 P2 P2 P1 wins $20 P1 loses $20 P1 wins $10 P1 wins $5

Our game as a tree P1 P2 P2 20-20 10 5

Our game as a tree P1:5 P2:-20 P2:5 20-20 10 5

Our game as a tree Max Min Min

Minimax https://www.youtube.com/watch?v=zdskcx8fsta

Minimax search NodeValue(node, depth) if node is a leaf return node.value if depth % 2 == 0 return max(nodevalue(child1),nodevalue(child2)) else return min(nodevalue(child1),nodevalue(child2))

Minimax for Tic-Tac-Toe

Problems with pure minimax Minimax guarantees that we ll choose the best move Assuming other player acts optimally, we can t lose any (fair) game! BUT number of possible states may explode Chess has ~35 moves, ~40 move game 10 62 states How to cut down on the number of states we need to explore?

Pruning

Alpha-beta pruning Can keep track at each node of a lower (alpha) and upper (beta) limit on when this node will be useful If beta > alpha, skip the rest of this node http://homepage.ufp.pt/jtorres/ensino/ia/al fabeta.html

Equivalent states There may be more than one way to get to a particular game state Also, many games have symmetric states Example: board rotations in Tic-Tac-Toe How to detect if we ve already evaluated a state? Use a hash function, check for collisions

Approximate methods Even with alpha-beta pruning and equivalent states, state space is still way too big for DFS for anything more complicated than checkers Now we ll talk about approximate methods no longer guarantee right answer

Evaluation functions Instead of DFSing all the way to goal states, use a stopping depth If we ve searched D levels and haven t hit an end state, use a heuristic (evaluation function) to guess state value This is how humans play chess we just plan a few moves ahead, to states that seem good Experts have a deeper stopping depth and a better evaluation function than beginners

Picking a heuristic Option 1: Use your knowledge about the game Chess: pieces remaining, square control, mobility, pawn structure Option 2: Use supervised machine learning Use a database of previous games to see which positions tended to lead to victory/defeat Have game play itself and learn over time

Approximate pruning Use another heuristic function to pick which moves to try Again, can be hand-coded or learned

Time limits Often there is a time limit for us to make a move (in the game, or based on the human s patience) Iterative deepening: Set stopping depth to 1, then 2, then 3, until we run out of time

Current state of the art: Connect Four Strongly solved in 1995 by John Tromp Strongly solved unbeatable regardless of opponent s actions

Current state of the art: Checkers Chinook became world champion in 1994 Weakly solved in 2007 after 18 years of computation Weakly solved assumes perfect opponent, may draw rather than win if opponent makes a risky move

Current state of the art: Chess Deep Blue defeated Kasparov in 1997 Deep Fritz defeated Kramnik (World Chess Champion) in 2006 (2 wins, 4 draws), last major matchup Now even chess programs on mobile phones play at grandmaster level

Current state of the art: Othello Programs generally much better than humans Relatively small search space, hard for humans to evaluate positions

Current state of the art: Backgammon Current machine learning models rank equal to humans Requires incorporating chance elements and large search space

Current state of the art: Go Humans far better than computers! ~360 possible moves per position Computers ok in last 10 years, better than amateurs but not competitive with experts

Homework: 2-move TTT Modify Tic-Tac-Toe program such that each player takes two turns at a time How do we change the minimax procedure? Does the game still end in a draw?