Minimax - Alpha-Beta Pruning




CS156

Chris Pollett

Sep 26, 2022

Outline

Adversarial search

Games defined More Formally

We consider games with two players MAX and MIN. A game consists of:

Games Trees

Optimal Strategies

Minimax

Minimax Example

Two Move Game

Quiz

Which of the following is true?

  1. Local Beam search is an evolutionary hill-climbing algorithm where we breed possible solutions with each other to make new solutions.
  2. The sum of Manhattan distances of misplaced pieces is the cost of a relaxed solution to the 8-puzzle problem.
  3. The Hill-climbing algorithm is always complete and optimal.

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

Alpha-beta Pruning

Imperfect Real-Time Decisions

Stochastic Games

Game tree with change nodes

Partial Observable Games