Games with Chance Other Search Algorithms CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 3 Adapted from slides of Yoonsuck Choe.

Slides:



Advertisements
Similar presentations
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.
Advertisements

Problem Solving by Searching Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 3 Spring 2007.
Adversarial Search Reference: “Artificial Intelligence: A Modern Approach, 3 rd ed” (Russell and Norvig)
Games & Adversarial Search Chapter 5. Games vs. search problems "Unpredictable" opponent  specifying a move for every possible opponent’s reply. Time.
Games & Adversarial Search
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Artificial Intelligence (CS 461D)
Search by partial solutions. Where are we? Optimization methods Complete solutions Partial solutions Exhaustive search Hill climbing Random restart General.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Review: Search problem formulation
Game Playing CSC361 AI CSC361: Game Playing.
1 search CS 331/531 Dr M M Awais A* Examples:. 2 search CS 331/531 Dr M M Awais 8-Puzzle f(N) = g(N) + h(N)
Problem Solving and Search in AI Heuristic Search
CSC344: AI for Games Lecture 4: Informed search
5-Nov-2003 Heuristic Search Techniques What do you do when the search space is very large or infinite? We’ll study three more AI search algorithms: Backtracking.
Games & Adversarial Search Chapter 6 Section 1 – 4.
Optimization via Search CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 4 Adapted from slides of Yoonsuck Choe.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Dijkstra’s Algorithm and Heuristic Graph Search David Johnson.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
October 3, 2012Introduction to Artificial Intelligence Lecture 9: Two-Player Games 1 Iterative Deepening A* Algorithm A* has memory demands that increase.
Heuristic Search In addition to depth-first search, breadth-first search, bound depth-first search, and iterative deepening, we can also use informed or.
Introduction to Artificial Intelligence CS 438 Spring 2008 Today –AIMA, Ch. 6 –Adversarial Search Thursday –AIMA, Ch. 6 –More Adversarial Search The “Luke.
Informed search algorithms
Informed search algorithms Chapter 4. Outline Best-first search Greedy best-first search A * search Heuristics.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Game Playing. Introduction One of the earliest areas in artificial intelligence is game playing. Two-person zero-sum game. Games for which the state space.
For Friday Finish reading chapter 4 Homework: –Lisp handout 4.
For Monday Read chapter 4, section 1 No homework..
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
CSCI 4310 Lecture 6: Adversarial Tree Search. Book Winston Chapter 6.
For Friday Finish chapter 6 Program 1, Milestone 1 due.
Artificial Intelligence and Searching CPSC 315 – Programming Studio Spring 2013 Project 2, Lecture 1 Adapted from slides of Yoonsuck Choe.
For Wednesday Read chapter 6, sections 1-3 Homework: –Chapter 4, exercise 1.
For Wednesday Read chapter 5, sections 1-4 Homework: –Chapter 3, exercise 23. Then do the exercise again, but use greedy heuristic search instead of A*
Informed Search I (Beginning of AIMA Chapter 4.1)
Search (continued) CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Search CSC 358/ Outline Homework #6 Game search States and operators Issues Search techniques DFS, BFS Beam search A* search Alpha-beta.
For Monday Read chapter 4 exercise 1 No homework.
Romania. Romania Problem Initial state: Arad Goal state: Bucharest Operators: From any node, you can visit any connected node. Operator cost, the.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Chapter 3 Solving problems by searching. Search We will consider the problem of designing goal-based agents in observable, deterministic, discrete, known.
Chapter 3.5 Heuristic Search. Learning Objectives Heuristic search strategies –Best-first search –A* algorithm Heuristic functions.
Review: Tree search Initialize the frontier using the starting state
Last time: search strategies
Iterative Deepening A*
Adversarial Search and Game Playing (Where making good decisions requires respecting your opponent) R&N: Chap. 6.
For Monday Chapter 6 Homework: Chapter 3, exercise 7.
Artificial Intelligence Problem solving by searching CSC 361
Games with Chance Other Search Algorithms
Games with Chance Other Search Algorithms
Games & Adversarial Search
Announcements Homework 3 due today (grace period through Friday)
Games & Adversarial Search
Introduction to Artificial Intelligence Lecture 9: Two-Player Games I
More on Search: A* and Optimization
Search.
Search.
Games with Chance Other Search Algorithms
Games & Adversarial Search
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning
Presentation transcript:

Games with Chance Other Search Algorithms CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 3 Adapted from slides of Yoonsuck Choe

Game Playing with Chance Minimax trees work well when the game is deterministic, but many games have an element of chance. Include Chance nodes in tree Try to maximize/minimize the expected value Or, play pessimistic/optimistic approach

Tree with Chance Nodes For each die roll (red lines), evaluate each possible move (blue lines) … Max Min Chance

Expected Value For variable x, the Expected Value is: where Pr(x) is the probability of x occurring Example: rolling a pair of die:

Evaluating Tree Choosing a Maximum (same idea for Minimum): Evaluate same move from ALL chance nodes Find Expected Value for that move Choose largest expected value … Max Min Chance

More on Chance Rather than expected value, could use another approach Maximize worst case value Avoid catastrophe Give high weight if a very good position is possible “Knockout” move Form hybrid approach, weighting all of these options Note: time complexity increased to b m n m where n is the number of possible choices (m is depth)

More on Game Playing Rigorous approaches to imperfect information games still being studied. Assume random moves by opponent Assume some sort of model based on perfect information model Indications that often the behavior of the opponent is of more value than evaluating the board position

AI in Larger-Scale and Modern Computer Games The idealized situations described often don’t extend to extremely complex, and more continuous games. Even just listing possible moves can be difficult Larger situation can be broken down into subproblems Hierarchical approach Use of state diagrams Some subproblems are more easily solved e.g. path planning

AI in Larger-Scale and Modern Computer Games Use of simulation as opposed to deterministic solution Helps to explore large range of states Can create complex behavior wrapped up in autonomous agents Fun vs. Competent Goal of game is not necessarily for the computer to win Often a collection of ad-hoc rules Cheating allowed

General State Diagrams List of possible states one can reach in the game (nodes) Can be abstracted, general conditions Describe ways of moving from one state to another (edges) Not necessarily a set move, could be a general approach Forms a directed (and often cyclic) graph Our minimax tree is a state diagram, but we hide any cycles Sometimes want to avoid repeated states

State Diagram State A State D State E State B State F State G State C State K State J State I State H

Exploring the State Diagram Explore for solutions using BFS, DFS Depth limited search: DFS but to limited depth in tree Iterative Deepening search: DFS one level deep, then two levels (repeats first level), then three levels, etc. If a specific goal state, can use bidirectional search Search forward from start and backward from goal – try to meet in the middle. Think of maze puzzles

More informed search Traversing links, goal states not always equal Can have a heuristic function: h(x) = how close the state is to the “goal” state. Kind of like board evaluation function/utility function in game play Can use this to order other searches Can use this to create greedy approach

A* Algorithm Avoid expanding paths that are already expensive. f(n) = g(n) + h(n) g(n) = current path cost from start to node n h(n) = estimate of remaining distance to goal h(n) should never overestimate the actual cost of the best solution through that node. Then apply a best-first search Value of f will only increase as paths evaluate