Minimax Algorithm Atacan KULLABCI 140144035 Kubilay BEKTAŞ 130144010 Ankara/2017 • The initial state and the legal moves for each side define the game tree for the game. • First player (MAX) • Second player (MIN) • The number on each leaf node indicates the utility value of the terminal state from the point of view of MAX Example: Strategy Game Solved by Minimax Algorithm • Let’s assume this strategic game with two players: MAX (black area) and MIN (white area). • The army can move up, down, right and left. • The utility function is given as: (points of first move of MAX) - (points of first move of MIN) Check if MAX player’s armies can move up, down, right and left. If so, find the possible moves. There are 2 possible moves Option1 Option2 Check if MIN player’s armies can move up, down, right and left. If so, find the possible moves. There are 3 possible moves for Option1 and 2 possible moves for Option2 For Option1 Moves1 Moves2 For Option2 Moves1 Moves2 Let’s analyze Minimax algorithm by combining all the possible options(moves) +4 -10 -10 +4 -4 -10 -10 MAX MIN MAX -6 MIN -6 -6 -6 -6 0 -6 -6 Minimax Algorithm Analysis • The minimax algorithm performs a complete depth-first exploration of the game tree. • If the maximum depth of the tree is m and there are b legal moves at each point, The time complexity of the minimax algorithm is O(b m). The space complexity is O(bm) for an algorithm that generates all actions at once, or O(m) for an algorithm that generates actions one at a time. • For real games, of course, the time cost is totally impractical, but this algorithm serves as the basis for the mathematical analysis of games and for more practical algorithms. References • https://en.wikipedia.org/wiki/Minimax • http://www.code2learn.com/2012/01/minimax-algorithmtutorial.html • http://neverstopbuilding.com THE END THANK YOU FOR LISTENING !
© Copyright 2026 Paperzz