眼睛充血吃什么药| 维生素c什么时候吃最好| 为什么说有钱难买孕妇B| 妇女是什么意思| 夏天可以种什么蔬菜| 农历5月是什么月| 湛江有什么好玩的| 内分泌失调吃什么食物好| 月子里可以吃什么蔬菜| 11月11日是什么星座| 槿字五行属什么| 手脚发热吃什么药| 壅是什么意思| 一般是什么意思| 职业病是什么意思| 醋酸生育酚是什么东西| 什么是野鸡大学| 表示什么意思| 吃酸的有什么好处| 野生铁皮石斛什么价| 尿酸高说明什么问题| 6月24号什么星座| 芈月是秦始皇的什么人| 掌中宝是什么东西| x射线是什么| 仙灵脾又叫什么| 羊字五行属什么| 吃完油炸的东西后吃什么化解| 压力过大会有什么症状| 澳门什么时候回归的| 悠着点是什么意思| 妇科炎症吃什么药最好| 什么茶降血压| 小猫咪吃什么| 尿多是什么问题| 好机车是什么意思| 唐僧最后成了什么佛| 脚气用什么洗脚| 3.2号是什么星座| 为什么会乳糖不耐受| 轩尼诗是什么酒| 下巴发黑是什么原因| 发烧喝什么水| 紧急避孕药什么时候吃有效| 升阳举陷是什么意思| 霉菌性阴道炎用什么药好| aki是什么意思| 青柑是什么| 雌二醇高有什么症状| 捭阖是什么意思| 王维被称为什么| 突然暴瘦是什么原因| 九月是什么星座的| 怀孕初期有什么表现| 9月15号是什么日子| 女人什么时候性欲最强| 肺结核有什么症状| 青玉是什么玉| rop是什么意思| 多囊挂什么科| 肛塞有什么用| 12月28是什么星座| 单发房早是什么意思| study是什么意思| 梦见找鞋子是什么意思| 尿臭是什么原因男性| 孩子生化了是什么意思| 喝茶有什么好处和坏处| 亥时右眼跳是什么预兆| 鱼加它是什么字| 心颤吃什么药效果好| 俎是什么意思| 什么的水井| 什么车最长脑筋急转弯| 什么是预防医学| 麦高芬是什么意思| 断章取义是什么生肖| 血压低吃什么能补上来| 一动就出汗是什么原因| 大汗淋漓是什么意思| 洋葱吃了有什么好处| 胸疼挂什么科| 5月21号是什么星座| 思想感情是什么意思| 孩子上火吃什么药| 四次元是什么意思| 命中注定是什么意思| 地贫是什么病| 10月24是什么星座| 为什么冬天会下雪| 禾花鱼是什么鱼| 男人有卧蚕代表什么| 腊肉炒什么菜最好吃| 多吃玉米有什么好处和坏处| 举贤不避亲什么意思| 跖疣去医院挂什么科室| 神经性皮炎用什么药最好| 面包虫是什么| 深圳少年宫有什么好玩的| 飞机上不能带什么| 非你莫属是什么意思| 为什么会睡不着| 法国的货币叫什么| cap是什么| 1962年五行属什么| 别开生面什么意思| 有什么笑话| au750是什么意思| 挪揄是什么意思| 手脚肿胀是什么原因引起的| 鬼门关是什么意思| 无纺布是什么| 吃黄豆有什么好处| 吃完饭就想吐是什么原因| 甲状腺炎吃什么药| 干巴爹什么意思| 梦见鼻子出血是什么意思| 海扶治疗是什么| 蒲公英可以和什么一起泡水喝| 肤色不均匀是什么原因| 6.16什么星座| 掐是什么意思| qn是什么医嘱| 今年流行什么发型女| 坐围是什么| 艾滋有什么症状| 开车压到猫有什么预兆| 论坛是什么| 去医院看嘴唇挂什么科| 肾功能不好有什么症状| 十灵日是什么意思| 安眠药有什么副作用| 什么钙片补钙效果最好| 定增股票是什么意思| 脊柱炎吃什么药| 妄想症吃什么药| 梦见老公有外遇预示什么| 感想是什么意思| 磷脂是什么东西| 小刺猬吃什么东西| 什么的海底| 小孩便秘吃什么通便快| 女生diy什么意思| 海兔是什么动物| 梦见打死猫有什么预兆| 产妇吃什么下奶快又多| 太阳穴疼什么原因| 老妈子是什么意思| 刚生完孩子可以吃什么水果| 珩五行属什么| 范仲淹是什么朝代的| 去三亚需要什么证件| 经常吃红枣有什么好处和坏处| 为什么星星会眨眼睛| 日月星辰是什么意思| 牙痛安又叫什么| 什么是应力| 淡盐水是什么| 电导率低是什么意思| 十月初是什么星座| 花胶有什么功效与作用| 麦饭石是什么| 手指甲发黑是什么原因| 任达华属什么生肖| 双相情感障碍吃什么药| 胃镜预约挂什么科| 方寸之地什么意思| 为什么做b超要憋尿| 白细胞低吃什么药可以增加白细胞| 什么是中性洗涤剂| 神经梅毒有什么症状| 股东是什么意思| 邮政编码是什么意思| 胃胀反酸吃什么药效果好| lsa是什么胎位| 胃痛胃胀吃什么好| 黑魔鬼烟为什么是禁烟| 朝朝暮暮是什么意思| 贫血三项是指什么检查| 破费是什么意思| 梦到前妻预示什么| 风疹吃什么药好得快| 女人喜欢什么礼物| 蚧壳虫用什么药| 双肺纤维条索是什么意思| 螃蟹为什么吐泡泡| 活珠子是什么| 受凉感冒吃什么药| 喝酒前喝什么不容易醉| 涤纶是什么面料优缺点| 关晓彤属什么生肖| 梦见老公不理我是什么意思| 6月21号什么星座| 什么是妊娠| 为什么叫马桶| 熹字五行属什么| 洋地黄是什么药| 沐五行属性是什么| 为什么客厅不能放假花| 为什么会有荨麻疹| 什么是夫妻宫| 虾肚子上的黑线是什么| 99年属什么生肖| 什么是滑档| 疱疹用什么药最好| 建成区是什么意思| 公务员是什么编制| 蛋白粉有什么作用| 肋间神经炎吃什么药| 茶叶五行属什么| 什么原因造成痫性发作| 熟练的反义词是什么| 龙骨是什么东西| 仁字五行属什么| 授受不亲什么意思| 三月二十三是什么星座| 穆字五行属什么| 哈库呐玛塔塔什么意思| 未见胎芽是什么意思| 做造影什么时候做最好| 全套是什么| dr股票是什么意思| 新车上牌需要什么资料| 4月3号是什么星座| 吃韭菜有什么好处| 三个句号代表什么意思| 手术后吃什么鱼伤口愈合快| 鼻子上长痘是什么原因| 为什么睡觉会出汗| 湿疹用什么药好| 散光和近视有什么区别| 喝酒后手麻是什么原因| 瓜子脸适合什么眼镜| 生津止渴是什么意思| 吃什么水果美白| 什么不周| 石膏的主要成分是什么| 参保是什么意思| 青团是什么节日吃的| 有氧运动是什么意思| 生气吃什么药可以顺气| 做梦梦见前男友是什么意思| a4腰什么意思| 多吃木耳有什么好处和坏处| 眉中间有竖纹代表什么| 自怨自艾是什么意思| 庙是什么意思| 尿频尿急吃什么药最好| 吃什么水果对皮肤好又美白| 空调的睡眠模式是什么意思| 包干费用是什么意思| 喝什么茶降血脂| 药物制剂是干什么的| 我要控制我自己是什么歌| 总免疫球蛋白e是什么| 天天吹空调有什么危害| 谷丙转氨酶是什么| 甲状腺过氧化物酶抗体高说明什么问题| 马斯卡彭是什么| 粉刺用什么药膏最有效| 咖啡因是什么东西| gr是什么单位| 纳征是什么意思| 宽慰是什么意思| 百度Jump to content

陈羽凡背绿腰包疑回应妻子出轨:蛋疼的都回家过节

From Wikipedia, the free encyclopedia
Alpha–beta pruning
ClassSearch algorithm
Worst-case performance
Best-case performance
百度 当今的中国汽车市场,市场需求量最大的车型就是紧凑型SUV,而哈弗H6作为一个资深车型就算设计的比以前年轻多了,但也很难打动新生消费者。

Alpha–beta pruning is a search algorithm that seeks to decrease the number of nodes that are evaluated by the minimax algorithm in its search tree. It is an adversarial search algorithm used commonly for machine playing of two-player combinatorial games (Tic-tac-toe, Chess, Connect 4, etc.). It stops evaluating a move when at least one possibility has been found that proves the move to be worse than a previously examined move. Such moves need not be evaluated further. When applied to a standard minimax tree, it returns the same move as minimax would, but prunes away branches that cannot possibly influence the final decision.[1]

History

[edit]

John McCarthy during the Dartmouth Workshop met Alex Bernstein of IBM, who was writing a chess program. McCarthy invented alpha–beta search and recommended it to him, but Bernstein was "unconvinced".[2]

Allen Newell and Herbert A. Simon who used what John McCarthy calls an "approximation"[3] in 1958 wrote that alpha–beta "appears to have been reinvented a number of times".[4] Arthur Samuel had an early version for a checkers simulation. Richards, Timothy Hart, Michael Levin and/or Daniel Edwards also invented alpha–beta independently in the United States.[5] McCarthy proposed similar ideas during the Dartmouth workshop in 1956 and suggested it to a group of his students including Alan Kotok at MIT in 1961.[6] Alexander Brudno independently conceived the alpha–beta algorithm, publishing his results in 1963.[7] Donald Knuth and Ronald W. Moore refined the algorithm in 1975.[8][9] Judea Pearl proved its optimality in terms of the expected running time for trees with randomly assigned leaf values in two papers.[10][11] The optimality of the randomized version of alpha–beta was shown by Michael Saks and Avi Wigderson in 1986.[12]

Core idea

[edit]

A game tree can represent many two-player zero-sum games, such as chess, checkers, and reversi. Each node in the tree represents a possible situation in the game. Each terminal node (outcome) of a branch is assigned a numeric score that determines the value of the outcome to the player with the next move.[13]

The algorithm maintains two values, alpha and beta, which respectively represent the minimum score that the maximizing player is assured of and the maximum score that the minimizing player is assured of. Initially, alpha is negative infinity and beta is positive infinity, i.e. both players start with their worst possible score. Whenever the maximum score that the minimizing player (i.e. the "beta" player) is assured of becomes less than the minimum score that the maximizing player (i.e., the "alpha" player) is assured of (i.e. beta < alpha), the maximizing player need not consider further descendants of this node, as they will never be reached in the actual play.

To illustrate this with a real-life example, suppose somebody is playing chess, and it is their turn. Move "A" will improve the player's position. The player continues to look for moves to make sure a better one hasn't been missed. Move "B" is also a good move, but the player then realizes that it will allow the opponent to force checkmate in two moves. Thus, other outcomes from playing move B no longer need to be considered since the opponent can force a win. The maximum score that the opponent could force after move "B" is negative infinity: a loss for the player. This is less than the minimum position that was previously found; move "A" does not result in a forced loss in two moves.

Improvements over naive minimax

[edit]
An illustration of alpha–beta pruning. The grayed-out subtrees don't need to be explored (when moves are evaluated from left to right), since it is known that the group of subtrees as a whole yields the value of an equivalent subtree or worse, and as such cannot influence the final result. The max and min levels represent the turn of the player and the adversary, respectively.

The benefit of alpha–beta pruning lies in the fact that branches of the search tree can be eliminated.[13] This way, the search time can be limited to the 'more promising' subtree, and a deeper search can be performed in the same time. Like its predecessor, it belongs to the branch and bound class of algorithms. The optimization reduces the effective depth to slightly more than half that of simple minimax if the nodes are evaluated in an optimal or near optimal order (best choice for side on move ordered first at each node).

With an (average or constant) branching factor of b, and a search depth of d plies, the maximum number of leaf node positions evaluated (when the move ordering is pessimal) is O(bd) – the same as a simple minimax search. If the move ordering for the search is optimal (meaning the best moves are always searched first), the number of leaf node positions evaluated is about O(b×1×b×1×...×b) for odd depth and O(b×1×b×1×...×1) for even depth, or . In the latter case, where the ply of a search is even, the effective branching factor is reduced to its square root, or, equivalently, the search can go twice as deep with the same amount of computation.[14] The explanation of b×1×b×1×... is that all the first player's moves must be studied to find the best one, but for each, only the second player's best move is needed to refute all but the first (and best) first player move—alpha–beta ensures no other second player moves need be considered. When nodes are considered in a random order (i.e., the algorithm randomizes), asymptotically, the expected number of nodes evaluated in uniform trees with binary leaf-values is .[12] For the same trees, when the values are assigned to the leaf values independently of each other and say zero and one are both equally probable, the expected number of nodes evaluated is , which is much smaller than the work done by the randomized algorithm, mentioned above, and is again optimal for such random trees.[10] When the leaf values are chosen independently of each other but from the interval uniformly at random, the expected number of nodes evaluated increases to in the limit,[11] which is again optimal for this kind of random tree. Note that the actual work for "small" values of is better approximated using .[11][10]

A chess program that searches four plies with an average of 36 branches per node evaluates more than one million terminal nodes. An optimal alpha-beta prune would eliminate all but about 2,000 terminal nodes, a reduction of 99.8%.[13]

An animated pedagogical example that attempts to be human-friendly by substituting initial infinite (or arbitrarily large) values for emptiness and by avoiding using the negamax coding simplifications.

Normally during alpha–beta, the subtrees are temporarily dominated by either a first player advantage (when many first player moves are good, and at each search depth the first move checked by the first player is adequate, but all second player responses are required to try to find a refutation), or vice versa. This advantage can switch sides many times during the search if the move ordering is incorrect, each time leading to inefficiency. As the number of positions searched decreases exponentially each move nearer the current position, it is worth spending considerable effort on sorting early moves. An improved sort at any depth will exponentially reduce the total number of positions searched, but sorting all positions at depths near the root node is relatively cheap as there are so few of them. In practice, the move ordering is often determined by the results of earlier, smaller searches, such as through iterative deepening.

Additionally, this algorithm can be trivially modified to return an entire principal variation in addition to the score. Some more aggressive algorithms such as MTD(f) do not easily permit such a modification.

Pseudocode

[edit]

The pseudo-code for depth limited minimax with alpha–beta pruning is as follows:[15]

function alphabeta(node, depth, α, β, maximizingPlayer) is
    if depth == 0 or node is terminal then
        return the heuristic value of node
    if maximizingPlayer then
        value := −∞
        for each child of node do
            value := max(value, alphabeta(child, depth − 1, α, β, FALSE))
            if value ≥ β then
                break (* β cutoff *)
            α := max(α, value)
        return value
    else
        value := +∞
        for each child of node do
            value := min(value, alphabeta(child, depth − 1, α, β, TRUE))
            if value ≤ α then
                break (* α cutoff *)
            β := min(β, value)
        return value
(* Initial call *)
alphabeta(origin, depth, −, +, TRUE)

Implementations of alpha–beta pruning can often be delineated by whether they are "fail-soft," or "fail-hard". The pseudo-code illustrates the fail-soft variation. With fail-soft alpha–beta, the alphabeta function may return values (v) that exceed (v < α or v > β) the α and β bounds set by its function call arguments. In comparison, fail-hard alpha–beta limits its function return value into the inclusive range of α and β.

Heuristic improvements

[edit]

Further improvement can be achieved without sacrificing accuracy by using ordering heuristics to search earlier parts of the tree that are likely to force alpha–beta cutoffs. For example, in chess, moves that capture pieces may be examined before moves that do not, and moves that have scored highly in earlier passes through the game-tree analysis may be evaluated before others. Another common, and very cheap, heuristic is the killer heuristic, where the last move that caused a beta-cutoff at the same tree level in the tree search is always examined first. This idea can also be generalized into a set of refutation tables.

Alpha–beta search can be made even faster by considering only a narrow search window (generally determined by guesswork based on experience). This is known as an aspiration window. In the extreme case, the search is performed with alpha and beta equal; a technique known as zero-window search, null-window search, or scout search. This is particularly useful for win/loss searches near the end of a game where the extra depth gained from the narrow window and a simple win/loss evaluation function may lead to a conclusive result. If an aspiration search fails, it is straightforward to detect whether it failed high (high edge of window was too low) or low (lower edge of window was too high). This gives information about what window values might be useful in a re-search of the position.

Over time, other improvements have been suggested, and indeed the Falphabeta (fail-soft alpha–beta) idea of John Fishburn is nearly universal and is already incorporated above in a slightly modified form. Fishburn also suggested a combination of the killer heuristic and zero-window search under the name Lalphabeta ("last move with minimal window alpha–beta search").

Other algorithms

[edit]

Since the minimax algorithm and its variants are inherently depth-first, a strategy such as iterative deepening is usually used in conjunction with alpha–beta so that a reasonably good move can be returned even if the algorithm is interrupted before it has finished execution. Another advantage of using iterative deepening is that searches at shallower depths give move-ordering hints, as well as shallow alpha and beta estimates, that both can help produce cutoffs for higher depth searches much earlier than would otherwise be possible.

Algorithms like SSS*, on the other hand, use the best-first strategy. This can potentially make them more time-efficient, but typically at a heavy cost in space-efficiency.[16]

See also

[edit]

References

[edit]
  1. ^ Russell & Norvig 2021, p. 152-161.
  2. ^ McCarthy, John (2025-08-14). "The Dartmouth Workshop--as planned and as it happened". www-formal.stanford.edu. Retrieved 2025-08-14.
  3. ^ McCarthy, John (27 November 2006). "Human Level AI Is Harder Than It Seemed in 1955". Stanford University. Retrieved 2025-08-14.
  4. ^ Newell, Allen; Simon, Herbert A. (1 March 1976). "Computer science as empirical inquiry: symbols and search". Communications of the ACM. 19 (3): 113–126. doi:10.1145/360018.360022.
  5. ^ Edwards, D.J.; Hart, T.P. (4 December 1961). The Alpha–beta Heuristic (Technical report). Massachusetts Institute of Technology. hdl:1721.1/6098. AIM-030.
  6. ^ Kotok, Alan (2004) [1962]. "A Chess Playing Program". Artificial Intelligence Project. RLE and MIT Computation Center. Memo 41. Retrieved 2025-08-14.
  7. ^ Marsland, T.A. (May 1987). "Computer Chess Methods" (PDF). In Shapiro, S. (ed.). Encyclopedia of Artificial Intelligence. Wiley. pp. 159–171. ISBN 978-0-471-62974-0. Archived from the original (PDF) on 2025-08-14.
  8. ^ Knuth, Donald E.; Moore, Ronald W. (1975). "An analysis of alpha-beta pruning". Artificial Intelligence. 6 (4): 293–326. doi:10.1016/0004-3702(75)90019-3. S2CID 7894372.
  9. ^ Abramson, Bruce (1 June 1989). "Control strategies for two-player games". ACM Computing Surveys. 21 (2): 137–161. doi:10.1145/66443.66444. S2CID 11526154.
  10. ^ a b c Pearl, Judea (1980). "Asymptotic Properties of Minimax Trees and Game-Searching Procedures". Artificial Intelligence. 14 (2): 113–138. doi:10.1016/0004-3702(80)90037-5.
  11. ^ a b c Pearl, Judea (1982). "The Solution for the Branching Factor of the Alpha-Beta Pruning Algorithm and Its Optimality". Communications of the ACM. 25 (8): 559–64. doi:10.1145/358589.358616. S2CID 8296219.
  12. ^ a b Saks, M.; Wigderson, A. (1986). "Probabilistic Boolean Decision Trees and the Complexity of Evaluating Game Trees". 27th Annual Symposium on Foundations of Computer Science. pp. 29–38. doi:10.1109/SFCS.1986.44. ISBN 0-8186-0740-8. S2CID 6130392.
  13. ^ a b c Levy, David (January 1986). "Alpha-Beta Soup". MacUser. pp. 98–102. Retrieved 2025-08-14.
  14. ^ Russell & Norvig 2021, p. 155.
  15. ^ Russell & Norvig 2021, p. 154.
  16. ^ Pearl, Judea; Korf, Richard (1987), "Search techniques", Annual Review of Computer Science, 2: 451–467, doi:10.1146/annurev.cs.02.060187.002315, Like its A* counterpart for single-player games, SSS* is optimal in terms of the average number of nodes examined; but its superior pruning power is more than offset by the substantial storage space and bookkeeping required.

Bibliography

[edit]
血燕是什么 一个口一个麦念什么 吃什么能减脂肪肝 嘴酸是什么原因引起 男人为什么会得尿结石
后厨打荷是干什么的 脱发去医院挂什么科 桃胶是什么东西 人为什么要读书 十二是什么意思
下呼吸道感染吃什么药 特点是什么 肚脐眼右边是什么器官 打嗝是什么引起的 属鸡的守护神是什么菩萨
人格魅力什么意思 夏天什么面料的衣服最舒服 拉稀肚子疼是什么原因 师傅是什么意思 榴莲对孕妇有什么好处
乌龟死了是什么样子hcv7jop5ns2r.cn 湿气重用什么泡脚最好hcv8jop2ns0r.cn 什么的原野hcv9jop1ns0r.cn kai是什么意思hcv8jop1ns5r.cn 2025年是什么命hcv8jop4ns2r.cn
吃什么能解决便秘hcv9jop4ns4r.cn 安享晚年是什么意思hcv8jop2ns8r.cn 购物狂是什么心理疾病hkuteam.com 夏天脚出汗是什么原因hcv8jop1ns9r.cn 手指没有月牙是什么原因hcv7jop7ns2r.cn
面瘫是什么原因造成的hcv9jop2ns1r.cn 异常灌注是什么意思hcv9jop8ns1r.cn kappa属于什么档次hcv9jop4ns8r.cn 太阳穴疼什么原因hcv9jop3ns6r.cn 什么茶减肥效果最好hcv9jop5ns3r.cn
儿童看小鸡挂什么科jingluanji.com 手指甲有竖纹什么原因hcv8jop8ns9r.cn 马驹是什么意思hkuteam.com hpv45型阳性是什么意思0297y7.com 心脏什么情况下需要支架hcv8jop0ns5r.cn
百度