Talk:Alpha–beta pruning

message: According to the StackOverflow question "Alpha-beta pruning: Fail-hard VS. Fail-soft" and first answer the pseudocode here is incorrect inasmuch as both versions (allegedly) demonstrate fail-soft.  This should be confirmed and the psuedocode corrected if necessary. JoshuaGreen1981 (talk) 00:55, 7 February 2022 (UTC)
replies: text: It is not correct indeed. Both versions shown on wikipedia are the fail soft variant. 81.164.156.146 (talk) 20:55, 3 October 2023 (UTC)
thread_title:  Pseudocode for Fail-Hard/Fail-Soft Incorrect?

message: Does this really deserve its own page? Alpha-beta pruning isn't a search algorithm at all, it's an optimization for the minimax algorithm. 193.130.71.68 (talk) 11:53, 25 May 2011 (UTC)
thread_title:  Merge with minimax? 

message: In the description for this article, this appears: "If the move ordering for the search is optimal (meaning the best moves always searched first)"
As far as I can tell, the optimal search order for AB pruning is worst-first.  The algorithm is looking to eliminate a subtree as early as possible, and the way to do this is to find a move in it that's worse than the current Alpha value; worst-first gives the best chance of doing this.  Am I missing something?  I'll update the description if I don't hear otherwise. --=== Jez === 11:48, 28 May 2007 (UTC)
replies: text: No, it's best-first.  Though it's best-first for the player whose move is under consideration *at that level of the tree*, which obviously alternates each move.  The way it works is this:  when trying to decide on a move for player A, consider the first move (ideally this is the best move, but not always -- if the move ordering was perfect there wouldn't be a need for the search).  Arrive at a score for the first move.  Then go the second move.  The idea is to determine as quickly as possible that this move is worse for A than the first move.  The quickest way to do this is to consider B's best response to that move.  Now consider trying it in the reverse order.  Suppose the first move tried is worse than the second.  Then, when searching the second, we never encounter a move by B that proves it worse than the first move, so we have to consider all of B's possible responses instead of just one.  HTH, let me know if it doesn't make sense. Evand 23:36, 28 May 2007 (UTC)
replies: text:  Ahh, I understand now.  You're calling it B's best move, I was thinking of it as A's worst scenario, as it's usually A that's doing the search.  At least my diagram is still correct.  I think I'm right in thinking that AB pruning can only happen on a minimizer's move? --=== Jez === 10:15, 29 May 2007 (UTC)
replies: text:  When it extends more than two plies deep it gets a little harder to follow :)  For example, when A is considering the first move, there are no established bounds, so the algorithm ends up the same as if B was searching for their best possible move from a position one ply deeper.  (This is part of why it makes sense to consider the algorithm as symmetric, with the player doing the searching switching each ply.)  The effect is actually the same it the alpha-beta window isn't tight enough to cause a cutoff on later moves A tries -- that is, if those moves are actually better than the first move, or if B hasn't yet found a good enough response to prove they aren't.  BTW, for your diagram, it might make it clearer what's happening if some of the moves that got cut off were better than the alternatives that were searched.  Evand 20:02, 29 May 2007 (UTC)
thread_title:  Query about AB pruning description 

message: The pseudo code is *WRONG* in the same way as negamax (which is identical, clearly something is wrong): the heurestic evaluation must be negated whenever player 2 is to play. Also, if the root call was for player 2, the final result must be negated again. —The preceding unsigned comment was added by 208.65.183.75 (talk) 07:39, 4 March 2007 (UTC)
replies: text: Could someone provide a working line-by-line real code implementation of the pseudocode? I have done so, and the current code on this page is wrong. JSB73 (talk) 22:43, 28 April 2009 (UTC)

text: I think the code is wrong indeed. Consider the following case: two nodes with values of 10 and 20 at depth of 1 (that is just after the current state). Running the code with depth of 1 (examing only one move forward), would return the state with value of 10, while it should be 20. In my opinion the evalution function has to be negated. Jqer (talk) 11:14, 9 January 2009 (UTC)

text: I added another variable to the function that should fix the psudo code. An ugly fix is much better than leaving it broken. 79.179.3.108 (talk) 19:53, 13 November 2010 (UTC)
thread_title:  Pseudo code is broken 

message: The tree image at the top is quite helpful (especially compared with earlier versions), but would it be possible to show the values of Alpha and Beta somewhere?  In the MiniMax page there is a description to go along with the image that describes the processing at each step.  Something similar would help quite a lot on the Alpha-beta page.
:I agree.  There should be something like an algorithm walkthrough.
::I edited it to include the values of alpha and beta at each step. It has too much visual clutter to be used tho. Plus I used vertical text.  Xjcl (talk) 17:03, 1 April 2016 (UTC)
thread_title:  Improvement to image 

message: it was quite beutyful and short ;) ---- ca1 84.16.123.194 (talk) 16:05, 3 April 2008 (UTC)
thread_title:  pseudocode - added from negamax 

message: The link below for the correct pseudocode from alpha-beta.  It was taken from page 218 of "Algorithms in a Nutshell", http://oreilly.com/catalog/9780596516246
Pseudocode - http://cardforge.googlecode.com/files/alpha-beta%20pseudocode.gif
Mtgrares (talk) 20:28, 19 November 2009 (UTC)
thread_title:  Correct Pseudocode 

message: Could be make some mention of the use of alpha-beta pruning in games involving luck (such as dice)?  Can alpha-beta pruning be used on such games?  --Doradus (talk) 14:02, 18 January 2010 (UTC)
replies: text: It can't usually be used much, because you have no control over outcome of the dice. It can be used for the players moves though, once you have calculated a probabilistic average score for a particular ply.- Wolfkeeper 17:15, 18 January 2010 (UTC)
thread_title:  Luck? 

message: Hi,
The example code fragment says "return the heuristic value of node".
It is somewhat ambiguous if the value must be calculated seen from the player-at-that-depth point of view or the the player at the root-level of the search tree.  — Preceding unsigned comment added by Flok (talk • contribs) 12:37, 19 July 2013 (UTC)
thread_title:  heuristic value of node 

message: Since O\left(b^{3d/4}\right) is a set, the function "average number of nodes evaluated" would be either be in the set or not in it, not "roughly" contained. The link to "Human Level AI Is Harder Than It Seemed in 1955" seems dead (at least for me, now), so I can't investigate the exact language McCarthy uses and am reluctant to make a call one way or the other. Can somebody with access to the original slides clarify this? 192.160.117.141 (talk) 22:24, 23 January 2014 (UTC)
thread_title:  Roughly <math>O\left(b^{3d/4}\right)</math> ? 

message: Hello fellow Wikipedians,
I have just added archive links to  on Alpha–beta pruning. Please take a moment to review my edit. If necessary, add  after the link to keep me from modifying it. Alternatively, you can add  to keep me off the page altogether. I made the following changes:
*Added archive http://web.archive.org/web/20080820030859/http://www.theinformationist.com/pdf/constrat.pdf/ to http://www.theinformationist.com/pdf/constrat.pdf/
When you have finished reviewing my changes, please set the checked parameter below to true to let others know.
Cheers.—cyberbot IITalk to my owner:Online 23:59, 27 February 2016 (UTC)
thread_title:  External links modified 

message: Hello fellow Wikipedians,
I have just added archive links to  on Alpha–beta pruning. Please take a moment to review my edit. If necessary, add  after the link to keep me from modifying it. Alternatively, you can add  to keep me off the page altogether. I made the following changes:
*Added archive http://web.archive.org/web/20081030023047/http://www.cs.ualberta.ca/~tony/OldPapers/encyc.mac.pdf to http://www.cs.ualberta.ca/~tony/OldPapers/encyc.mac.pdf
*Added archive http://web.archive.org/web/20021223103359/http://www.maths.nott.ac.uk:80/personal/anw/G13GAM/alphabet.html to http://www.maths.nott.ac.uk/personal/anw/G13GAM/alphabet.html
*Added archive http://web.archive.org/web/20041123061044/http://chess.verhelst.org:80/search.html to http://chess.verhelst.org/search.html
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).
Cheers.—cyberbot IITalk to my owner:Online 18:53, 22 March 2016 (UTC)
thread_title:  External links modified 

message: It leads to a page that doesn't provide any of the information indicated.  — Preceding unsigned comment added by 67.168.176.62 (talk) 08:13, 24 September 2016 (UTC)
thread_title:  Citation 2 is incorrect. 

message: The article states that the algorithm is optimal and selects the same move as the standard minimax algorithm, but this depends on some unspoken assumptions. If the values of the leaf nodes are known, it will select the optimal move. But the usual context is a limited-depth search, where some (or most) of the leaf nodes have uncertain value. Alpha-beta will select the same move as the standard minimax algorithm if the search depth is the same, but if (as in usual applications) a bigger depth is allowed within the same time because of the pruning, the deeper search might reveal better insights that makes it choose another move.  — Preceding unsigned comment added by 37.44.138.159 (talk) 13:03, 12 March 2018 (UTC)
thread_title:  Unsatisfactory handling of heuristic suboptimality 

message: The section needs considerable rework, replace with reference to Negamax#Negamax_with_alpha_beta_pruning, or remove. Among the issues:
:Missing commentary about alpha / beta.
:Missing references.
:Negamax description unclear and of questionable accuracy.
:Negamax with alpha/beta pruning code inaccurate.
The pseudo code for the section, in this article's context, should resemble the following:
 function alphabeta(node, depth, α, β, color) is
     if depth = 0 or node is a terminal node then
         return color × the heuristic value of node
     value := −∞
     for each child of node do
         value := max(value, −alphabeta(child, depth − 1, −β, −α, −color))
         α := max(α, value)
         if α ≥ β then
             break (* cut-off *)
     return value
GamePlayerAI (talk) 17:14, 30 May 2020 (UTC)
thread_title:  Negamax variation section 

message: Hi, I've created an image which shows the difference between a minimax and alpha-beta pruned search using trees diagrams. Could this be added to the article?
https://i.imgur.com/9AXbblz.png
Sgriffin53 (talk) 13:26, 2 July 2021 (UTC)
thread_title:  Minimax versus Alphabeta tree diagram