TwoPlayer Games A 4 B 33 ZUI LS
Two-Player Games A 4 B 33 ZUI, LS 2016 Branislav Bošanský, Ondřej Vaněk, Štěpán Kopřiva {name. surname}@agents. fel. cvut. cz Artificial Intelligence Center, Czech Technical University
Minimax function minimax(node, depth, Player) if (depth = 0 or node is a terminal node) return evaluation value of node if (Player = Max. Player) for each child of node v : = max(v, minimax(child, depth-1, switch(Player) )) return v else for each child of node v : = min(v, minimax(child, depth-1, switch(Player) )) return v
Alpha-Beta Pruning function alphabeta(node, depth, α, β, Player) if (depth = 0 or node is a terminal node) return evaluation value of node if (Player = Max. Player) for each child of node v : = max(v, alphabeta(child, depth-1, α, β, switch(Player) )) α : = max(α, v); if (β≤α) break return v else for each child of node v : = min(v, alphabeta(child, depth-1, α, β, switch(Player) )) β : = min(β, v); if (β≤α) break return v
Game
Negamax function negamax(node, depth, α, β, Player) if (depth = 0 or node is a terminal node) return evaluation value of node if (Player = Max. Player) for each child of node v : = max(v, -negamax(child, depth-1, -β, -α, switch(Player) )) α : = max(α, v); if (β≤α) break return v else for each child of node v : = min(v, alphabeta(child, depth-1, α, β, switch(Player) )) β : = min(β, v); if (β≤α) break return v
Nega. Scout – Main Idea enhancement of the alpha-beta algorithm assumes some heuristic that determines move ordering the algorithm assumes that the first action is the best one after evaluating the first action, the algorithm checks whether the remaining actions are worse the “test” is performed via null-window search [α, α+1] the algorithm needs to re-search, if the test fails (i. e. , there might be a better outcome for the player when following the tested action)
Alpha-Beta vs. Negascout [4, +∞] [-∞, +∞] MAX 4 4 [-∞, 4] +∞] [-∞, +∞] [4, [5, 4]4] [-∞, [0, 4 4 [4, +∞] 3] 7] 2 0 MIN 3 [7, [4, +∞] 7 5 5 7 3 [4, 7] 2 3 0 MAX
Alpha-Beta vs. Negascout [4, +∞] [-∞, +∞] MAX 4 [-∞, 4] +∞] [-∞, +∞] [4, 4 4 2 4 [4, 3] 5] [3, 4] [5, [7, [4, 5] 0 5 5 7 MIN 3 3 [4, 5] 7 2 X 3 0 MAX
Alpha-Beta vs. Negascout [4, +∞] [-∞, +∞] MAX re-search with [4, +∞] 7 [-∞, 4] +∞] [-∞, +∞] [4, 4 4 2 4 [4, 5] [3, 4] [5, [7, [4, 5] 0 5 5 7 MIN 7 [4, 5] 9 [9, 7 2 X 9 X 0 MAX
Nega. Scout also termed Principal Variation Search (PVS) dominates alpha-beta never evaluates more different nodes than alpha-beta can evaluate some nodes more than once depends on the move ordering can benefit from transposition tables generally 10 -20% faster compared to alpha-beta
MTD Memory-enhanced Test Driver Best-first fixed-depth minimax algorithms. Plaat et. al. , In Artificial Intelligence, Volume 87, Issues 1 -2, November 1996, Pages 255 -293
Further Topics more advanced algorithms Monte Carlo Tree Search (leading algorithm for many games) further enhanced with many heuristics and techniques more complex games with uncertainty chance (Nature player), calculating expected utilities imperfect information (players cannot distinguish certain states) search in games vs. game theory online vs. offline approach game theory – studied in Mgr. OI (A 4 M 36 MAS)
Other Games - Chance nodes
MCTS
Computational Game Theory in AIC application of game-theoretic approaches in security domains Maritime Security (Pirates), Patrolling, Border Protection, Computer Network Security, Fare Evasion more fundamental research general algorithms for solving sequential games with imperfect information implementation of domain independent algorithms general game playing BP/DP and further collaboration – Plug-in 6. 4. 2016 16: 15
- Slides: 15