Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Minimax
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Pseudocode === The [[pseudocode]] for the depth-limited minimax algorithm is given below. '''function''' minimax(node, depth, maximizingPlayer) '''is''' '''if''' depth = 0 '''or''' node is a terminal node '''then''' '''return''' the heuristic value of node '''if''' maximizingPlayer '''then''' value := ββ '''for each''' child of node '''do''' value := max(value, minimax(child, depth β 1, FALSE)) '''return''' value '''else''' ''(* minimizing player *)'' value := +β '''for each''' child of node '''do''' value := min(value, minimax(child, depth β 1, TRUE)) '''return''' value ''(* Initial call *)'' minimax(origin, depth, TRUE) The minimax function returns a heuristic value for [[leaf nodes]] (terminal nodes and nodes at the maximum search depth). Non-leaf nodes inherit their value from a descendant leaf node. The heuristic value is a score measuring the favorability of the node for the maximizing player. Hence nodes resulting in a favorable outcome, such as a win, for the maximizing player have higher scores than nodes more favorable for the minimizing player. The heuristic value for terminal (game ending) leaf nodes are scores corresponding to win, loss, or draw, for the maximizing player. For non terminal leaf nodes at the maximum search depth, an evaluation function estimates a heuristic value for the node. The quality of this estimate and the search depth determine the quality and accuracy of the final minimax result. Minimax treats the two players (the maximizing player and the minimizing player) separately in its code. Based on the observation that <math>\ \max(a,b) = -\min(-a,-b)\ ,</math> minimax may often be simplified into the [[negamax]] algorithm.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Minimax
(section)
Add topic