Question

J'ai une question sur l'algorithme minimax.

permet de dire que j'ai l'arbre de jeu suivant et j'ai ajouté des valeurs heuristiques aléatoires.

Entrez la description de l'image ici

Comme j'ai compris l'algorithme minimax, il choisira le chemin vert.Cependant, cela pourrait ne pas être la meilleure chose à choisir dans la situation.Étant donné que le bon enfant du nœud supérieur a la valeur la plus élevée qu'il puisse obtenir, ce n'est pas le meilleur geste ...

Étant donné que si l'autre joueur fait l'autre bouge, ma chance de gagner est beaucoup moins ...

Je suis désolé, j'ai du mal à exprimer ce que je veux dire sur cette question.Mais comment je pense mal ici?

Était-ce utile?

La solution

The usual way to solve this is to proceed backwards from the lower layers of the tree. Let's check the lowermost four leaves first (the 10-20-15-20 part). Player 2 gets to choose from these if the game ever gets there, so P2 will choose the smaller ones, i.e. 10 and 15. We can then prune the 10-20-15-20 branches of the tree and replace them with 10 (for the leftmost two leaves) and 15 (for the rightmost two). Similarly, we can prune the -100 - 50 pair at the middle and replace them with -100 (not 50 as you did, because at this level it is player 2's turn and he will choose the smaller outcome), the -200 - -100 pair with -200 and so on. So, for me, it seems to be the case that you are taking the maximum at each branching point instead of alternating between the maximum and the minimum.

Autres conseils

You should alternate between taking the minimum and maximum. If you want to take 50, which is the maximum of 30 and 50, then you should have chosen -100 one level lower on the right side instead, etc.. That's why the algorithm is called minimax.

the algorithm assumes both you and the 2nd player wants to win, and will always choose the best move. thus, in the question's tree - as I said in the comment, the last move (2nd player makes) is left and not right. this results in making the whole right subtree - unworthy for the first player, and the minmax algorithm will choose the following path (and not as described in the question): left->left->right->left

this is true the algorithm "gives you less chance to win" this is because of the fact that there is a 2nd player, who wants to win as well!

have a look at his example.
in here, the x player wants to avoid defeat so he persues the '0' in the first step. note that if (in the example) he would take first left, the 2nd player then takes left again and wins! the algorithm assures best possibility - asuuming the 2nd player acts the same as well (and assuming it knows the whole game tree)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top