Artificial Intelligence Minimax and Alpha Beta Pruning code
2012-05-18 18:37
405 查看
function alphabeta(node, depth, α, β, Player)
if depth = 0 or node is a terminal node
return the heuristic value of node
if Player = MaxPlayer
for each child of node
α := max(α, alphabeta(child, depth-1, α, β, not(Player) ))
if β ≤ α
break (* Beta cut-off *)
return α
else
for each child of node
β := min(β, alphabeta(child, depth-1, α, β, not(Player) ))
if β ≤ α
break (* Alpha cut-off *)
return β
(* Initial call *)
alphabeta(origin, depth, -infinity, +infinity, MaxPlayer)
if depth = 0 or node is a terminal node
return the heuristic value of node
if Player = MaxPlayer
for each child of node
α := max(α, alphabeta(child, depth-1, α, β, not(Player) ))
if β ≤ α
break (* Beta cut-off *)
return α
else
for each child of node
β := min(β, alphabeta(child, depth-1, α, β, not(Player) ))
if β ≤ α
break (* Alpha cut-off *)
return β
(* Initial call *)
alphabeta(origin, depth, -infinity, +infinity, MaxPlayer)
相关文章推荐
- Alpha Deblocking and Beta Deblocking
- Codeforces Beta Round #61 (Div. 2) E. Petya and Post
- What’s the Difference Between Artificial Intelligence, Machine Learning, and Deep Learning?
- 大数据和人工智能如何改变网贷(How Big Data And Artificial Intelligence are Changing Online Lending)
- Advanced Applications of Neural Networks and Artificial Intelligence: A Review
- MIT Computer Science And Artificial Intelligence Laboratory
- 概率机器学习和人工智能(Probabilistic machine learning and artificial intelligence_Nature2015)
- The difference between artificial and intelligence
- 现代投资组合理论的几个统计衡量指标——alpha, beta, standard deviation, R-squared and the Sharpe ratio
- R code to the plot the bias, variance, and MSE for the beta/binomial model
- (转)A curated list of Artificial Intelligence (AI) courses, books, video lectures and papers
- Alpha-expansion and Alpha-beta-swap Algorithm Flow
- Minds and Computers: An Introduction to the Philosophy of Artificial Intelligence
- Alpha-expansion and Alpha-beta-swap Algorithm Flow
- Alpha-Beta剪枝(Alpha Beta Pruning)
- Alpha and Beta
- The difference between artificial and intelligence
- Alpha 和Beta 测试 (Alpha and Beta Test)
- What Is The Difference Between Artificial Intelligence And Machine Learning?
- CodeRush for Visual Studio .NET v.3.0.2 (Beta) released on 18 Dec 2007 and What'a New