37
CS 460 Spring 2011 Lecture 4

CS 460 Spring 2011

  • Upload
    freya

  • View
    27

  • Download
    0

Embed Size (px)

DESCRIPTION

CS 460 Spring 2011. Lecture 4. Overview. Review Adversarial Search / Game Playing (chap 5 3 rd ed , chap 6 2 nd ed ). Review. Evaluation of strategies Completeness, time & space complexity, optimality Informed Search Best First Greedy Best First Heuristics: A* Admissible, Consistent - PowerPoint PPT Presentation

Citation preview

Page 1: CS 460 Spring 2011

CS 460Spring 2011

Lecture 4

Page 2: CS 460 Spring 2011

Overview

• Review• Adversarial Search / Game Playing– (chap 5 3rd ed, chap 6 2nd ed)

Page 3: CS 460 Spring 2011

Review• Evaluation of strategies

– Completeness, time & space complexity, optimality• Informed Search

– Best First– Greedy Best First– Heuristics: A*

• Admissible, Consistent• Relaxed problems• Dominance

• Local Search– Hill climbing / gradient ascent– Simulated annealing– K-beam– Genetic algorithms

Page 4: CS 460 Spring 2011

Game playing /Adversarial search

Page 5: CS 460 Spring 2011
Page 6: CS 460 Spring 2011
Page 7: CS 460 Spring 2011

Game tree (2-player, deterministic, turns)

Page 8: CS 460 Spring 2011
Page 9: CS 460 Spring 2011

Minimax

Page 10: CS 460 Spring 2011

Properties of minimaxComplete? Yes (if tree is finite)•• Optimal? Yes (against an optimal opponent)•• Time complexity? O(bm)•• Space complexity? O(bm) (depth-first exploration)•

• For chess, b ≈ 35, m ≈100 for "reasonable" games exact solution completely infeasible

• Do we need to explore every path?•

Page 11: CS 460 Spring 2011

α-β pruning example

Page 12: CS 460 Spring 2011

α-β pruning example

Page 13: CS 460 Spring 2011

α-β pruning example

Page 14: CS 460 Spring 2011

α-β pruning example

Page 15: CS 460 Spring 2011

α-β pruning example

Page 16: CS 460 Spring 2011

Properties of α-βPruning does not affect final result•

Good move ordering improves effectiveness of pruning•

• With "perfect ordering," time complexity = O(bm/2) doubles solvable depth of search

• A simple example of the value of reasoning about which computations are relevant (a form of metareasoning)

• Unfortunately, 35**50 is still an impossible number of searches•

Page 17: CS 460 Spring 2011

Why is it called α-β?

α is the value of the best (i.e., highest-value) choice found so far at any choice point along the path for max•• If v is worse than α, max will avoid it•• prune that branch

Define β similarly for min•

Page 18: CS 460 Spring 2011

Alpha-beta algorithm

Page 19: CS 460 Spring 2011
Page 20: CS 460 Spring 2011
Page 21: CS 460 Spring 2011
Page 22: CS 460 Spring 2011
Page 23: CS 460 Spring 2011
Page 24: CS 460 Spring 2011
Page 25: CS 460 Spring 2011
Page 26: CS 460 Spring 2011
Page 27: CS 460 Spring 2011
Page 28: CS 460 Spring 2011
Page 29: CS 460 Spring 2011
Page 30: CS 460 Spring 2011
Page 31: CS 460 Spring 2011
Page 32: CS 460 Spring 2011
Page 33: CS 460 Spring 2011
Page 34: CS 460 Spring 2011
Page 35: CS 460 Spring 2011
Page 36: CS 460 Spring 2011
Page 37: CS 460 Spring 2011