Tree 极大极小深度优先搜索博弈树
我想为九人组的莫里斯比赛建立一个游戏树。我想在树上应用minimax算法来进行节点求值。Minimax使用DFS计算节点。那么,我应该先构建一个给定深度的树,然后应用minimax,还是在递归minimax DFS中构建树和求值的过程可以同时发生 多谢各位Tree 极大极小深度优先搜索博弈树,tree,minimax,Tree,Minimax,我想为九人组的莫里斯比赛建立一个游戏树。我想在树上应用minimax算法来进行节点求值。Minimax使用DFS计算节点。那么,我应该先构建一个给定深度的树,然后应用minimax,还是在递归minimax DFS中构建树和求值的过程可以同时发生 多谢各位 Arvind你可以看一看。是的,你可以在递归极小极大中同时构建和计算。 这是一个很好的方法,因为它可以节省内存空间 实际上,你甚至可以同时申请 编辑:以下是来自wiki的伪代码: 因为我们可能在每个节点中存储一个游戏/棋盘状态,所以我们可以嵌
Arvind你可以看一看。是的,你可以在递归极小极大中同时构建和计算。 这是一个很好的方法,因为它可以节省内存空间 实际上,你甚至可以同时申请 编辑:以下是来自wiki的伪代码: 因为我们可能在每个节点中存储一个游戏/棋盘状态,所以我们可以嵌入 创建游戏状态 在minimax算法中,即
function integer play_minimax(node, depth)
if node is a terminal node or depth == 0:
return the heuristic value of node
α = -∞
LOOP: # try all possible movements for this node/game state
player = depth mod 2
move = make_game_move(node, player)
break if not any move
α = max(α, -play_minimax(move, depth-1))
return α
谢谢..我可以参考一下java实现或伪代码吗?
function integer play_minimax(node, depth)
if node is a terminal node or depth == 0:
return the heuristic value of node
α = -∞
LOOP: # try all possible movements for this node/game state
player = depth mod 2
move = make_game_move(node, player)
break if not any move
α = max(α, -play_minimax(move, depth-1))
return α