Presentation is loading. Please wait.

Presentation is loading. Please wait.

Atacan KULLABCI Kubilay BEKTAŞ

Similar presentations


Presentation on theme: "Atacan KULLABCI Kubilay BEKTAŞ"— Presentation transcript:

1 Atacan KULLABCI Kubilay BEKTAŞ
Minimax Algorithm Atacan KULLABCI Kubilay BEKTAŞ Ankara/2017

2 The initial state and the legal moves for each side define the game tree for the game.

3 • 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

4 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)

5 Utility value: 4 – 0 Utility value: 4 – 0 It is 4 It is 4
Check if MAX player’s armies can move up, down, right and left. If so, find the possible moves. There are 2 possible moves Option Option2 Utility value: 4 – 0 Utility value: 4 – 0 It is 4 It is 4

6 Check if MIN player’s armies can move up, down, right and left
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 Moves Moves2 Utility value: 4(from MAX) – 10 Utility value: 4(from MAX) – 10 It is -6 It is -6 Utility value: 4(from MAX) – 4 It is 0

7 Utility value: 4(from MAX) – 10 Utility value: 4(from MAX) – 10
For Option2 Moves Moves2 Utility value: 4(from MAX) – 10 Utility value: 4(from MAX) – 10 It is -6 It is -6

8 Let’s analyze Minimax algorithm by combining all the possible options(moves)
+4 +4 -10 -10 -10 -4 -10 It is -6 It is -6 It is 0 It is -6 It is -6

9 MAX MIN

10 Since the result is -6, the winner is MIN(white)
MAX -6 MIN -6 -6 -6 -6 -6 -6 Since the result is -6, the winner is MIN(white)

11 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.

12 References https://en.wikipedia.org/wiki/Minimax
tutorial.html

13 THANK YOU FOR LISTENING !
THE END THANK YOU FOR LISTENING !


Download ppt "Atacan KULLABCI Kubilay BEKTAŞ"

Similar presentations


Ads by Google