Min max algorithm in Artificial Intelligence

artificial intelligence

enter image description here

How to understand the meaning of the image in Artificial Intelligence book in chapter 5?

Best Answer

The minimax algorithm is a way to model an adversarial task between two agents, where one agent is trying to maximize a certain score and the other is trying to minimize it. A canonical example for this is chess, where if we have some measure of how good or bad a position is for white, then the player with white will want the position to be as good as possible and the player with black will want it to be as bad as possible.

The general idea is that if one player makes some move, then the other player will get a set of responses for each possible move the first player could make, and then the same goes for the first player, and so on. This is what the tree represents: each node is a position on a given player's turn, and each edge is a possible move. If it's my turn with the white pieces, I want to pick the move such that black will have the best possible worst outcome: that is to say, if we assume black always makes the move which makes the position as bad as possible, then I want to pick the one that will make that worst outcome as good as possible. It doesn't matter if there are better possible outcomes after different moves because black wouldn't let us go down those paths. Similarly, if I'm black, I want to make the move such that white has the worst possible best outcome.

So for this problem, we can start from the second row and look at the decisions each MIN node gets. B can choose between getting scores of $3, 12$, or $8$ so it will choose $3,$ C can choose between $2, 4,$ and $6$ so it will choose $2$, and D can choose between $2, 5$, and $14$ so it will also choose $2.$

Now, if we look at the MAX node A on top, it should see that it can choose between nodes B, C, and D, with worst outcomes $3, 2,$ and $2$. Because A wants to maximize its score, it will conclude that it should perform action $a_1$ with an expected score of $3.$

Hope this helps!

Related Question