Min Max Example-For Students
Min Max Example-For Students
Min Max Example-For Students
Initial call:
minimax(node, 3, true)
Step 1: The method constructs the whole game-tree and applies the utility function to
obtain utility values for the terminal states in the first step. Let's assume A is the tree's
initial state in the diagram below. Assume that the maximizer takes the first turn with a
worst-case initial value of -infinity, and the minimizer takes the second turn with a worst-
case initial value of +infinity.
Step 2: Next, we'll locate the Maximizer's utilities value, which is -, and compare each
value in the terminal state to the Maximizer's initial value to determine the upper nodes'
values. It will select the best option from all of them.
For node D max(-1,- -∞) => max(-1,4)= 4
For Node E max(2, -∞) => max(2, 6)= 6
For Node F max(-3, -∞) => max(-3,-5) = -3
For node G max(0, -∞) = max(0, 7) = 7
Step 3: Now it's the minimizer's time, thus it'll compare all nodes' values with + and
determine the 3rd layer node values.
Step 4: Now it's Maximizer's turn, and it'll choose the maximum value of all nodes and
locate the root node's maximum value. There are only four layers in this game tree, so we
can go to the root node right away, but there will be more layers in real games.
For node A max(4, -3)= 4
That was the complete workflow of the minimax two player game.