What is the efficient way to solve an Alpha beta pruning algorithm? will it be efficient to visit the nodes from (right to left) or (left to right) ? and the reason?
Asked
Active
Viewed 834 times
0
-
You need to be more descriptive. As it will help us to figure out what we can do. – Mayur Apr 13 '20 at 09:13
-
Left to right is just how iteration works (for(i = 0; i < n; i++) which goes from 0->n. You could do it backwards, but it slightly complicates things. For alpha-beta pruning to work right to left, you would have to order the moves backwards. – Crupeng May 09 '20 at 16:17
1 Answers
0
There is no single answer of whether left-to-right or right-to-left will be correct. What really matters is that you search the moves from best to worst. If you get the best result on the first move you are more likely to be able to prune immediately and get a smaller search tree.
In an implementation the first step is to reason about moves and try to manually order them. For instance, you might try capture moves before forward moves and forward moves before reverse moves.
The second step is to try implementing something like the history heuristic which can be used to dynamically order moves to be more efficient and generate a smaller search tree.

Nathan S.
- 5,244
- 3
- 45
- 55