3 ms·
The AI is based on the minimax algorithm [1]. Because of the way Minimax works, the only way for a possible next move to be designated a "win" is if it is a gu
by colanderman 11y ago
The AI is based on the minimax algorithm [1]. Because of the way Minimax works, the only way for a possible next move to be designated a "win" is if it is a guaranteed win. (The tree is (effectively) fully explored, and the opponent is given the benefit of the doubt in the face of incomplete information.) So, if there are multiple such winning moves, and care is not taken to distinguish the "magnitude" of the win, the AI will choose one arbitrarily.
I suppose that, in Hive, it is more likely that a path to a win is longer rather than shorter. Hence, when my AI was arbitrarily choosing "winning" moves, it statistically chose those that drew the game out.
[1] https://en.wikipedia.org/wiki/Minimax https://en.wikipedia.org/wiki/Minimax
- ant6n 11y agoBut once you have guaranteed winning moves, why not pick the shortest one available (in terms of turns)?
- colanderman 11y agoYes, that's what I did after I found the design flaw which effectively threw that information away.