algorithm - Minimax: what to do with equal scores in endgame? -


as far understood, minimax algorithm in simplest form works following way: traverse game tree bottom-up , if it's player's turn, assign maximum score of child nodes current node, else minimum score. leaves scored according game output, let's +1 win, 0 draw, -1 loss. choose move leads node highest score.

of course impractical traverse whole game tree, heuristic used. assume near end of game. have found problems simple approach.

for example, playing chess , player (playing white) has reached position: chess position, mate in one

it players turn. there mate in 1 qg7, node qg7 gets score of 1. instance, ke1 legal move. reply c5, qg7# still available. , because qg7 gets score of 1, c5, ke1.

so have @ least 2 moves score of 1 (ke1 , qg7). let's algorithm considers king moves first , chooses first move highest score. mean, in position, player not checkmate opponent, random king moves until opponent prevent checkmate (with queening pawn).

the fundamental problem is, checkmate in 1 (qg7) has same score checkmate in 2 (ke1), there no reason player, go checkmate in one.

this can prevented simple modification minimax algorithm: in case of equal score, choose shorter path position score. checkmate in 1 prefered.

my question is: have not found mention of in minimax-related source, there misunderstanding of minimax on part? if not, usual way solve or there superior ways?

i'm pretty sure understand minimax correctly.

the thing pass down current distance in minimax function, , weight wins / losses according that. faster win (to reduce possibility of unseen situations) , slower loss (to allow mistakes opponent) should preferred. whether win 1, or positive value, doesn't matter - still picked better 0 or -1.

if have win largest possible value in heuristic - can still similar - weight increasing or decreasing little, still have larger other non-win values.

for example, doesn't matter, as, when pawn gets close promoting, you'd detect draw coming , you'd make winning move. can problem if:

  • there's sequence of inevitable moves beyond search depth results in worst outcome (which pretty common problem minimax, if it's avoidable, it's better so)
  • there's time constraint on side
  • you don't cater draw conditions (e.g. 3 repeated positions)

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -