Search code examples
algorithmchessalpha-beta-pruning

Alpha Beta Pruning Assumptions


I am learning about game trees(Chess) and was wondering if alpha beta pruning is based on the assumption that the two players playing are 'perfect players'. What happens if a human who is not perfect plays, and makes a bad move? How does alpha beta pruning work when the opponent does not always choose the best move.


Solution

  • Every time you have a position, it can be considered to be the root of the analyze tree. Alpha-beta pruning has the philosophy of assuming that the opponent plays perfect chess, because if the opponent makes mistakes, then naturally, the situation will be better for the computer. Therefore, the classic alpha-beta pruning assumes that the opponent is perfect and whenever something unexpected occurs, like

    • mistake done by the opponent
    • finding out that the line considered to be the best is not really the best

    the algorithm reconsiders the position. Classic alpha-beta pruning calculates the position again and again each time a move occurred, but naturally, there can be serious improvements:

    1. You can carry over a descending list of attractive moves to the next move and if the opponent makes the expected move, you calculate the most attractive variations first, note, that chess games are played using time for each player and we should avoid time trouble.

    2. While the opponent is thinking you can build up your best scenarios in the second, third and so on most attractive variations

    3. Chess is actually a VERY complicated game. Alpha-beta pruning is only giving you assumptions, it is not able to determine the best move. As a computer, you can adjust aggression by calculating the tactical wildness (number of forks, skewers and so on) in a variation and using a weight you can add "personality" by adjusting the aggression. Also, you can adjust trickiness, that is, the probability that the computer will choose slightly worse moves to complicate things and make it harder for the opponent.

    4. You can adjust time and depth strategies.

    and many more things, but I will not describe them here, because I do not want to quickly acquire many down-votes due to sharing too many details and boring people :)