Path Planning as Search

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

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

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

Adversarial Search and Game Playing

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

Game playing. Chapter 5, Sections 1 6

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

Artificial Intelligence 1: game playing

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

Games and Adversarial Search II

Programming Project 1: Pacman (Due )

Game playing. Chapter 5. Chapter 5 1

Adversarial Search 1

ARTIFICIAL INTELLIGENCE (CS 370D)

CS 331: Artificial Intelligence Adversarial Search II. Outline

Foundations of Artificial Intelligence

Game-Playing & 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, CS, Nanjing University Spring, 2018, Yang Yu. Lecture 4: Search 3.

Game Playing. Philipp Koehn. 29 September 2015

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

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

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

Game Playing: Adversarial Search. Chapter 5

Foundations of Artificial Intelligence

CS 771 Artificial Intelligence. Adversarial Search

Ar#ficial)Intelligence!!

Adversary Search. Ref: Chapter 5

Game Playing State-of-the-Art

School of EECS Washington State University. Artificial Intelligence

CS440/ECE448 Lecture 9: Minimax Search. Slides by Svetlana Lazebnik 9/2016 Modified by Mark Hasegawa-Johnson 9/2017

Game playing. Chapter 6. Chapter 6 1

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

Artificial Intelligence

CS 5522: Artificial Intelligence II

Games (adversarial search problems)

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

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

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

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

Lecture 5: Game Playing (Adversarial Search)

Game-playing AIs: Games and Adversarial Search I AIMA

CSE 473: Artificial Intelligence. Outline

Artificial Intelligence. Topic 5. Game playing

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

Game playing. Chapter 6. Chapter 6 1

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

CS 380: ARTIFICIAL INTELLIGENCE

ADVERSARIAL SEARCH. Chapter 5

Adversarial Search. CMPSCI 383 September 29, 2011

CS 188: Artificial Intelligence

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

Game playing. Outline

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

Solving Problems by Searching: Adversarial Search

Artificial Intelligence

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

Adversarial Search Lecture 7

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

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

Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning

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

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

Artificial Intelligence Adversarial Search

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

Games and Adversarial Search

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

CSE 40171: Artificial Intelligence. Adversarial Search: Games and Optimality

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

Adversarial search (game playing)

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

COMP9414: Artificial Intelligence Adversarial Search

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

Intuition Mini-Max 2

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

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

CS 4700: Foundations of Artificial Intelligence

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

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

Adversarial Search (a.k.a. Game Playing)

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

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

CSE 573: Artificial Intelligence

2 person perfect information

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

Adversarial Search Aka Games

Foundations of Artificial Intelligence

Adversarial Search (Game Playing)

More Adversarial Search

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

Adversarial Search: Game Playing. Reading: Chapter

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

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

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

Search the action space of 2 players Russell & Norvig Chapter 6 Bratko Chapter 24

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

Game Playing AI. Dr. Baldassano Yu s Elite Education

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

CSE 473: Ar+ficial Intelligence

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

Transcription:

Path Planning as Search Paul Robertson 16.410 16.413 Session 7 Slides adapted from: Brian C. Williams 6.034 Tomas Lozano Perez, Winston, and Russell and Norvig AIMA 1

Assignment Remember: Online problem set #3 due Session 8 Hand in written part in class. Reading: Adversarial Search: AIMA Ch. 6 From before: Path planning: AIMA Ch. 25.4 2

Roadmaps are an effective state space abstraction 3

Uniform cost search spreads evenly from the start x x A start B goal A* biases uniform cost towards the goal by using h A* finds an optimal solution if h never over estimates. Then h is called admissible f = g + h g = distance from start h = estimated distance to goal. 4

Path Planning through Obstacles Start position Goal position 5

1. Create Configuration Space Start position Vehicle translates, but no rotation Idea: Transform to equivalent Problem of navigating a point. Goal position 6

2. Map From Continuous Problem to Graph Search: Create Visibility Graph Start position Goal position 7

2. Map From Continuous Problem to Graph Search: Create Visibility Graph Start position Goal position 8

3. Find Shortest Path Start position Goal position 9

Resulting Solution Start position Goal position 10

A Visibility Graph is a Kind of Roadmap Start position What are some other types of roadmaps? Goal position 11

Voronoi Diagrams Lines equidistant from CSpace obstacles 12

Path Planning With an Adversary Start positions Goal position 13

Types of Competitive Games Two Player and Multi-Player Zero and non-zero sum games f(player1) = - f(player2) Perfect and imperfect information Stochastic games Two player, zero sum games with perfect info 14

Two Player Games With Perfect Information Initial State Empty board Successor Function Place X or 0 in empty square Terminal Test Three X s or O s in a line is a win Else no empty squares is a tie Utility Function 1 for win 0 for tie -1 for lose Tic Tac Toe X X O 15

Two Player Games With Perfect Information Initial State Empty board Successor Function Place X or 0 in empty square Terminal Test Three X s or O s in a line is a win Else no empty squares is a tie Utility Function 1 for win 0 for tie -1 for lose Tic Tac Toe X X O 16

Game Tree X turn X X X O turn X X X X X X X turn X O X O X O Tic-Tac-Toe: b ~ 9, d ~ 9 1/2 Move 1 Ply 1 Move X O X X O X O O turn X X Chess: b ~ 35, d ~ 100 X O X X O X X O X X turn O O X O O X O X O X X O X O O 1 0-1 Terminal Node Utilities 17

Optimal Strategies Strategy π: state move Optimal strategy π*: One that performs at least as well as any other strategy. 18

Optimal Strategies: What is an optimal strategy for informed search? An optimal strategy π*(n) selects the branch to the sub tree containing the path with minimum cost V*. V*(n) = Min [P(c,n) +V*(c)] c in children(n) V*(n) = 0 if n is a terminal node π*(n) = arg Min [P(c,n) +V*(c)] c in children(n) s0 3 2 2 4 s1 s2 3 2 4 6 0 0 0 s3 s4 s5 s6 For games we will use V*(n) to denote utility (reward) rather than cost. 5 19 0

Optimal Strategies for 2 Person Games Assume opponent j uses an optimal strategy π* j. Player i strategy π* pi selects branch to sub-tree containing the best state f pi (s) reachable using π* j. Assume zero sum game f p1 = - f p2. Player 1 maximizes, while player 2 minimizes. P1 move P2 move Start π* p1 R 0 π* p2 0 S -1 R S R S V* p1 = Select MAX V* p2 = Select MIN 1 0 1-1 20

Optimal Strategy: Min-Max Utilities: V* pi (n) = Utility(n) if n is a terminal node V * p1 (n) = Max V* p2 (s) if n is a p1 (max) node s in successors(n) V * p2 (n) = Min V* p1 (s) if n is a p2 (min) node s in successors(n) Strategies: π* p1 (n) = arg Max V* p2 (s) s in successors(n) R R 0 S 0 MAX S -1 MIN R S π* p2 (n) = arg Min V* p1 (s) s in successors(n) 1 0 1-1 Compute using depth first search O(b m+1 ) time O(b*m) space 21

MiniMax-Decision(state) returns an action inputs: state, current state in game v Max-Value(state) return the action in Successors(state) with value v Function Max-Value(state) returns a utility value if Terminal-Test(state) then return Utility(state) v - for a, s in Successors(state) do v Max(v, Min-Value(s)) return v Function Min-Value(state) returns a utility value if Terminal-Test(state) then return Utility(state) v - for a, s in Successors(state) do v Min(v, Max-Value(s)) return v 22

Compute Mini-Max Select MAX Select MIN L M R Select MAX L M R L M R L M R 8 7 2 9 1 6 2 4 1 1 3 5 3 9 2 6 5 2 1 2 3 9 7 2 16 6 4 23

Compute Mini-Max Select MAX 5 Select MIN 4 L M R 5 3 Select MAX L M R L M R L M R 8 9 4 5 9 6 3 9 16 8 7 2 9 1 6 2 4 1 1 3 5 3 9 2 6 5 2 1 2 3 9 7 2 16 6 4 24

Chess using 2Ghz PC Min/Max 5 ply, 2 ½ moves Expert 10 ply, 5 moves Average Game 100 ply 50 moves Terminal nodes are too far to reach. 25

Heuristic Evaluation Fn Trees are too large to explicitly enumerate all branches (Chess ~ 35 101 ). Evaluation estimates board quality (pawn = 1, knight/bishop = 3, rook = 5, queen 9). 2 Select MAX R S 2 1 R S R S Select MIN 2 7 1 8 Estimates from evaluation 26

Alpha-Beta Pruning Use depth-first to search for best option. Trim an option as soon as we show another is better. MAX MIN MAX R S R S R S 2 7 1 8 Start Your move Their move 27

Alpha-Beta Pruning Use depth-first to search for best option. Trim an option as soon as we show another is better. MAX MIN Maintain lower/upper bound on each node. [-inf, inf] Start R S Your move [-inf, inf] R S R S Their move MAX [2, 2] 2 7 1 8 28

Alpha-Beta Pruning Use depth-first to search for best option. Trim an option as soon as we show another is better. Maintain lower/upper bound on each node. MAX [-inf, inf] Start R S Your move MIN [-inf,2] R S R S Their move MAX [2, 2] [7,7] 2 7 1 8 29

Alpha-Beta Pruning Use depth-first to search for best option. Trim an option as soon as we show another is better. MAX MIN MAX [2, 2] [2, 2] [2, inf] R S R S R S [7,7] 2 7 [-inf, inf] [1,1] Maintain lower/upper bound on each node. Start 1 8 Your move Their move 30

Alpha-Beta Pruning Use depth-first to search for best option. Trim an option as soon as we show another is better. MAX Maintain lower/upper bound on each node. better Start [2, inf] R S Your move MIN [2, 2] [-inf, 1] trim R S R S Their move MAX [2, 2] [7,7] [1,1] 2 7 1 8 31

Alpha of Alpha-Beta Pruning The better option may be anywhere in the tree. MAX MIN MAX MIN MAX [2, inf] R S [2, 2] [-inf, 1] R S R S [2, 2] [7,7] 2 7 [-inf,inf] S [-inf, 1] R [1,1] 1 < α = Max {2,-inf} = 2 trim S 8 Let α be the highest value choice found so far for any choice point of Max (a greatest lower bound). α = Max [lower bounds of previous max nodes] If α is above the upper bound for a node n of Min, prune n. 32

Beta of Alpha-Beta Pruning The argument applies equally when the roles are reversed. MIN MAX MIN MAX MIN [-inf, 7] R S [7, 7] [1, inf] R S R S [2, 2] [7,7] 2 7 [-inf,inf] S [8, inf] R [8,8] 8 > β = Min {7, inf} = 7 trim S 1 Let β be the lowest value choice found so far for any choice point of Min (a least upper bound). β = Min [upper bounds of previous min nodes] If β is below the lower bound for a node n of Max, prune n. 33

Putting it Together: Alpha-Beta Pruning Select MAX Select MIN Select MAX 8 7 2 9 1 6 2 4 1 1 3 5 3 9 2 6 5 2 1 2 3 9 7 2 16 6 4 Cut a Min node if < α : Cut a max node if > β : α = Max [lower bounds of previous max nodes] β = Min [upper bounds of previous min nodes] 34

Select MAX Select MIN Select MAX Putting it Together: Alpha-Beta Pruning >8 = 8 < 8 = 4 >9 > 2 > 4 = 4 > 1 > 3 = 5 > 3 > 9 > 4 > 5 = 5 < 5 = 5 > 6 > 1 > 2 = 3 < 3 8 7 2 9 1 6 2 4 1 1 3 5 3 9 2 6 5 2 1 2 3 9 7 2 16 6 4 Cut a Min node if < α : 8 Cut a max node if > β : 8 9 4 α = Max [lower bounds of previous max nodes] β = Min [upper bounds of previous min nodes] 35

Function Alpha-Beta-Search(state) returns an action inputs: state, current state in game v Max-Value(state, -, + ) return the action in Successors(state) with value v Function Max-Value(state, α, β) returns a utility value inputs: state, current state in game α, the value of the best alternative for MAX along the path to state. β, the value of the best alternative for MIN along the path to state. if Terminal-Test(state) then return Utility(state) v - for a, s in Successors(state) do v Max(v, Min-Value(s, α, β)) if v βthen return v α Max(α, v) return v Function Min-Value(state, α, β) returns a utility value inputs: state, current state in game α, the value of the best alternative for MAX along the path to state. β, the value of the best alternative for MIN along the path to state. if Terminal-Test(state) then return Utility(state) v - for a, s in Successors(state) do v Min(v, Max-Value(s, α, β)) if v αthen return v β Min(β, v) return v From AIMA Figure 6.7 36

Chess using 2Ghz PC Min/Max 5 ply, 2 ½ moves Expert 10 ply, 5 moves Alpha/Beta 10 ply, 5 moves Grand Master Deep Blue 30 RS/6000 + 480 VLSI Chips 40 ply using supercomputer 4000 openings, 6 piece endgames 8,000 feature evaluation, 700,000 grandmaster games for consensus 37

Best n forward pruning At each level consider only the n most promising choices. At each level apply the heuristic evaluation function. Sort the positions according to the heuristic evaluation. Discard all but the best n. Puts an upper bound on the branching factor. Advantage: Can look ahead more ply this way. Disadvantage: Doesn t see good moves that initially look bad such as sacrifices. 38