Finish Adversarial Games, Constraint Satisfaction




CS156

Chris Pollett

Feb 23, 2015

Outline

Introduction

The Minimax Algorithm

The minimax algorithm below computes the minimax decision from the current state. So we could use it to actually make an agent that could play a game.

Here `argmax_(a in s) f(a)` returns the element `a` of set `S` that has the maximum value of `f(a)`.

function MINIMAX-DECISION(state) return an action //it is assume is MAX's turn
    return argmax_(a in ACTION(state)) MIN-VALUE(RESULT(state, a))

function MAX-VALUE(state) return a utility value
    if (TERMINAL_TEST(state) == true) then return UTILITY(state, MAX)
    v := -infty
    for each a in ACTION(state) do
      v := MAX(v, MIN-VALUE(RESULT(state, a))) 
    return v

function MIN-VALUE(state) return a utility value
    if (TERMINAL_TEST(state) == true) then return UTILITY(state,MAX)
    v := infty
    for each a in ACTION(state) do
      v := MIN(v, MAX-VALUE(RESULT(state, a))) 
    return v

Remarks on Minimax Algorithm

Quiz

Which of the following is true?

  1. An admissible heuristic for the `A^(star)`-algorithm never underestimates the cost to a solution.
  2. `k`- Local beam search is another name for hill-climbing with `k`-restarts.
  3. If the UTILITY to MAX of a winning tic-tac-toe board is 1, a losing board is -1, and a tie board is 0, then the MINIMAX value of an empty tic-tac-toe board is 0.

Alpha-beta Pruning

Imperfect Real-Time Decisions

Stochastic Games

Game tree with change nodes

Partial Observable Games

What is a Constraint Satisfaction Problem?

CSP Definition

Definition Example

A CSP Solution

Example: Map Coloring

Map of Australia

Remarks

Example: Job-shop Scheduling

More Job-shop scheduling

Variations on the CSP Formalism