CSCI 5582 Artificial Intelligence

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Games & Adversarial Search
Artificial Intelligence Adversarial search Fall 2008 professor: Luigi Ceccaroni.
CS 484 – Artificial Intelligence
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
1 DCP 1172 Introduction to Artificial Intelligence Lecture notes for Chap. 6 [AIMA] Chang-Sheng Chen.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Constraint Satisfaction Problems
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Game Playing Chapter 5. Game playing §Search applied to a problem against an adversary l some actions are not under the control of the problem-solver.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module 5 Adversarial Search (Thanks Meinolf Sellman!)
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Game Search & Constrained Search CMSC Artificial Intelligence January 18, 2005.
Search: Games & Adversarial Search Artificial Intelligence CMSC January 28, 2003.
Game playing Types of games Deterministic vs. chance
Game Playing Why do AI researchers study game playing?
Adversarial Search and Game-Playing
Announcements Homework 1 Full assignment posted..
Instructor: Vincent Conitzer
Last time: search strategies
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Iterative Deepening A*
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
Pengantar Kecerdasan Buatan
David Kauchak CS52 – Spring 2016
Lecture 7 Constraint Satisfaction Problems
Computer Science cpsc322, Lecture 14
Games & Adversarial Search
Games with Chance Other Search Algorithms
Games & Adversarial Search
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Computer Science cpsc322, Lecture 14
Alpha-Beta Search.
Games & Adversarial Search
Games & Adversarial Search
Constraint Satisfaction Problems
NIM - a two person game n objects are in one pile
Instructor: Vincent Conitzer
The Alpha-Beta Procedure
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
Minimax strategies, alpha beta pruning
Constraint satisfaction problems
Mini-Max search Alpha-Beta pruning General concerns on games
CS 8520: Artificial Intelligence
Games & Adversarial Search
Constraint Satisfaction Problems
Games & Adversarial Search
Minimax strategies, alpha beta pruning
CS51A David Kauchak Spring 2019
Constraint satisfaction problems
CS51A David Kauchak Spring 2019
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

CSCI 5582 Artificial Intelligence Lecture 7 Jim Martin 11/6/2018 CSCI 5582 Fall 2006

Today 9/19 Review (and finish) search Break Game Playing Search 11/6/2018 CSCI 5582 Fall 2006

Review Optimization/Local Search Constraint Satisfaction Search 11/6/2018 CSCI 5582 Fall 2006

Local Search Hillclimbing Random-Restart Hillclimbing Simulated Annealing 11/6/2018 CSCI 5582 Fall 2006

Constraint Satisfaction In CSP problems, states are represented as sets of variables, each with values chosen from some domain A goal test consists of satisfying constraints on sets of variable/value combinations A goal state is one that has no constraint violations 11/6/2018 CSCI 5582 Fall 2006

Approaches to CSPs As a kind of backtracking search As a kind of iterative improvement 11/6/2018 CSCI 5582 Fall 2006

Making Backtracking Work What it means to be a goal (or not) can be decomposed In CSPs a state is a goal state if all of the constraints are satisfied. A state fails as a goal state if any constraint is violated Therefore we can check for violations as variables are assigned values 11/6/2018 CSCI 5582 Fall 2006

Informed Backtracking CSP Search The previous discussion didn’t use any notion of heuristic. There are two places heuristics can help Which variable to assign next Which value to assign to a variable 11/6/2018 CSCI 5582 Fall 2006

Generic CSP Heuristics Variables Degree heuristic The one involved in the largest number of constraints Choose the most constrained variable The one with the minimum remaining values Values Choose the least constraining value 11/6/2018 CSCI 5582 Fall 2006

Graph Coloring Green Blue Blue Red Green 11/6/2018 CSCI 5582 Fall 2006

Iterative Improvement Sometimes it’s better to look at these problems as optimization problems. Where you want to optimize (minimize) the number of constraints violated (to zero would be good) 11/6/2018 CSCI 5582 Fall 2006

How? Randomly assign values to all the variables in the problem (from their domains) Iteratively fix the variables (reassign values) that are conflicted. Continue until there are no conflicts or no progress 11/6/2018 CSCI 5582 Fall 2006

Min Conflict Heuristic Randomly choose a variable from the problematic ones. Reassign its value to be the one that results in the fewest conflicts Continue until there are no conflicts 11/6/2018 CSCI 5582 Fall 2006

Min Conflict Example States: 4 Queens, 1 per column Operators: Move queen in its column Goal test: No attacks Evaluation metric: Total number of attacks 11/6/2018 CSCI 5582 Fall 2006

Min Conflict Performance Min Conflict seems to have astounding performance. For example, it’s been shown to solve arbitrary size (in the millions) N-Queens problems in constant time. This appears to hold for arbitrary CSPs with the caveat… 11/6/2018 CSCI 5582 Fall 2006

Min Conflict Performance Except in a certain critical range of the ratio constraints to variables. 11/6/2018 CSCI 5582 Fall 2006

Preferences and Constraints In practice, applications can get fairly messy Sometimes you want the lowest cost zero conflict solution Sometimes constraints are preferences not true constraints Sometimes some constraints are more important than other constraints. That is, the cost of violating some constraints is more than the cost of violating others. 11/6/2018 CSCI 5582 Fall 2006

Admin/Break Questions? Quiz will be on Thursday for the first 30 minutes or so. Focus is on search Chapters 3,4,5 and 6 (today) 11/6/2018 CSCI 5582 Fall 2006

Game Playing Search Why study games? Why is search a good idea? 11/6/2018 CSCI 5582 Fall 2006

Typical Assumptions Some majors assumptions we’ve been making: Only an agent’s actions change the world World is deterministic and accessible Pretty much true in lots of games 11/6/2018 CSCI 5582 Fall 2006

Why Search? Ignoring computational complexity, games are a perfect application for a complete search. Of course, ignoring complexity is a bad idea, so games are a good place to study resource bounded searches. 11/6/2018 CSCI 5582 Fall 2006

MiniMax From among the moves available to you, take the best one Where the best one is determined by a search using the MiniMax strategy 11/6/2018 CSCI 5582 Fall 2006

MiniMax I’ll choose the best move for me (max) You’ll choose the best move for you (min) 11/6/2018 CSCI 5582 Fall 2006

MiniMax I’ll choose the best move for me (max) You’ll choose the best move for you (min) 11/6/2018 CSCI 5582 Fall 2006

MiniMax I’ll choose the best move for me (max) You’ll choose the best move for you (min) 11/6/2018 CSCI 5582 Fall 2006

MiniMax I’ll choose the best move for me (max) You’ll choose the best move for you (min) 11/6/2018 CSCI 5582 Fall 2006

Ideal Case Search all the way to the leaves (end game positions) Return the leaf (leaves) that leads to a win (for me) Anything wrong with that? 11/6/2018 CSCI 5582 Fall 2006

More Realistic Search ahead to a non-leaf (non-goal) state and evaluate it somehow Chess 4 ply is a novice 8 ply is a master 12 ply can compete at the highest level In no sense can 12 ply be likened to a search of the whole space 11/6/2018 CSCI 5582 Fall 2006

Evaluation Functions Need a numerical function that assigns a value to a non-goal state Has to capture the notion of a position being good for one player Has to be fast Typically a linear combination of simple metrics 11/6/2018 CSCI 5582 Fall 2006

MiniMax Implemented Depth-first, left to right, recursive, depth-limited search Only the leaves are evaluated Return values represent the best value found below that point in the tree (not the specific moves taken) 11/6/2018 CSCI 5582 Fall 2006

Once More 11/6/2018 CSCI 5582 Fall 2006

Extensions Pruning Openings and Closings Managing Time 11/6/2018 CSCI 5582 Fall 2006

Alpha-Beta Pruning Often you can ignore entire sections of the search space and come up with the same answer Specifically, if you’re exploring a line of play that leads to a worse position for you than another one you’ve already discovered, then don’t explore that line anymore. 11/6/2018 CSCI 5582 Fall 2006

Alpha-Beta Pruning 11/6/2018 CSCI 5582 Fall 2006

Alpha Beta Pruning 11/6/2018 CSCI 5582 Fall 2006

Alpha-Beta Pruning 11/6/2018 CSCI 5582 Fall 2006

Alpha-Beta Pruning 11/6/2018 CSCI 5582 Fall 2006

Alpha-Beta Pruning 11/6/2018 CSCI 5582 Fall 2006

How does AB Help? After all, all it does is return the same answer you would have gotten otherwise. So what's the big deal? 11/6/2018 CSCI 5582 Fall 2006

How does AB Help It helps if you can use the time saved to look deeper into the tree. Moving from bd to b d/2 means that that you can go to 8 ply in the same time it took to go to 4 Or going from novice to master with the same smarts This assumes that you have some way to manage the clock 11/6/2018 CSCI 5582 Fall 2006

Improving AB Recall that MiniMax is normally a depth-first, left to right, procedure. AB works better if the most informative nodes are evaluated first (on the left, as opposed to the right). 11/6/2018 CSCI 5582 Fall 2006

Improving AB 11/6/2018 CSCI 5582 Fall 2006

Dealing with Time In tournament play, you have a time constraint. Need some effective way to manage the clock. I.e. you need to be sure that you have a move to make when the bell goes off. 11/6/2018 CSCI 5582 Fall 2006

Iterative Deepening (again) Run MiniMax inside an ID wrapper. Remember the best move from previous rounds Keep iterating until some time limit is reached Key point: You always have an answer available 11/6/2018 CSCI 5582 Fall 2006

Openings and Closings Do we really need a search right from the start? Or at the end? 11/6/2018 CSCI 5582 Fall 2006

Game Trivia Chinook had closing book with 400 Billion positions Deep Blue examined ~100 Billion boards per move Often reached 14 ply Better pruning/move ordering beats faster better hardware 11/6/2018 CSCI 5582 Fall 2006

Next Time Quiz (30 min) Start on Chapter 7 11/6/2018 CSCI 5582 Fall 2006