Open Lines Heuristic

Define an open line for player as a row/column/diagonal with no opponent mark. We use the heuristic:

Minimax Tic-Tac-Toe Example-1771352734798.webp

Minimax Tic-Tac-Toe Example-1771352758892.webp

Thus, for this board, we would have .

Evaluation Function

We can adapt the above heuristic to become , where

  • is the total number of my (MAX) possible winning lines
  • is the total number of opponent’s (MIN) possible winning lines
  • is the total evaluation for state

Minimax Tic-Tac-Toe Example-1771352974973.webp

Now, we use Minimax to solve the problem:

  • Generate the game tree
  • Apply the utility function to each terminal state to get its value
  • Use these values to determine the utility of nodes one level higher up in the search tree.
    • From bottom to top:
    • For a MAX level, select the maximum level of its successors
    • For a MIN level, select the minimum value of its successors

Decision rule: From the root node, select the move which leads to the highest value.

Minimax Tic-Tac-Toe Example-1771353053721.webp

Minimax Tic-Tac-Toe Example-1771353216792.webp

Minimax Tic-Tac-Toe Example-1771353222814.webp

Minimax Tic-Tac-Toe Example-1771353230257.webp