×

Alpha-beta Pruning | Artificial Intelligence

Alpha-beta pruning is an advance version of MINIMAX algorithm. The drawback of minimax strategy is that it explores each node in the tree deeply to provide the best path among all the paths. This increases its time complexity. But as we know, the performance measure is the first consideration for any optimal algorithm. Therefore, alpha-beta pruning reduces this drawback of minimax strategy by less exploring the nodes of the search tree.

The method used in alpha-beta pruning is that it cutoff the search by exploring less number of nodes. It makes the same moves as a minimax algorithm does, but it prunes the unwanted branches using the pruning technique (discussed in adversarial search).  Alpha-beta pruning works on two threshold values, i.e., ? (alpha) and ? (beta).

  • ?: It is the best highest value, a MAX player can have. It is the lower bound, which represents negative infinity value.
  • ?: It is the best lowest value, a MIN player can have. It is the upper bound which represents positive infinity.

So, each MAX node has ?-value, which never decreases, and each MIN node has ?-value, which never increases.

Note: Alpha-beta pruning technique can be applied to trees of any depth, and it is possible to prune the entire subtrees easily.

Working of Alpha-beta Pruning

Consider the below example of a game tree where P and Q are two players. The game will be played alternatively, i.e., chance by chance. Let, P be the player who will try to win the game by maximizing its winning chances.  Q is the player who will try to minimize P’s winning chances. Here, ? will represent the maximum value of the nodes, which will be the value for P as well. ? will represent the minimum value of the nodes, which will be the value of Q.

alpha beta pruning
  • Any one player will start the game. Following the DFS order, the player will choose one path and will reach to its depth, i.e., where he will find the TERMINAL value.
  • If the game is started by player P, he will choose the maximum value in order to increase its winning chances with maximum utility value.
  • If the game is started by player Q, he will choose the minimum value in order to decrease the winning chances of A with the best possible minimum utility value.
  • Both will play the game alternatively.
  • The game will be started from the last level of the game tree, and the value will be chosen accordingly.
  • Like in the below figure, the game is started by player Q. He will pick the leftmost value of the TERMINAL and fix it for beta (?). Now, the next TERMINAL value will be compared with the ?-value. If the value will be smaller than or equal to the ?-value, replace it with the current ?-value otherwise no need to replace the value.
  • After completing one part, move the achieved ?-value to its upper node and fix it for the other threshold value, i.e., ?.
  • Now, its P turn, he will pick the best maximum value. P will move to explore the next part only after comparing the values with the current ?-value. If the value is equal or greater than the current ?-value, then only it will be replaced otherwise we will prune the values.
  • The steps will be repeated unless the result is not obtained.
  • So, number of pruned nodes in the above example are four and MAX wins the game with the maximum UTILITY value, i.e.,3

The rule which will be followed is: “Explore nodes if necessary otherwise prune the unnecessary nodes.”

Note: It is obvious that the result will have the same UTILITY value that we may get from the MINIMAX strategy.


Related Topics

Constraint Satisfaction Problems in Artificial Intelligence

Constraint Satisfaction Problems in Artificial Intelligence We have seen so many techniques like Local search, Adversarial search to solve different problems. The objective of every problem-solving technique is one, i.e., to find a solution to...

5 minutes read.

Heuristic Functions in Artificial Intelligence

Heuristic Functions in AI: As we have already seen that an informed search make use of heuristic functions in order to reach the goal node in a more prominent way....

3 minutes read.

5 algorithms that demonstrate artificial intelligence bias

Unfortunately, in the machine learning algorithm, AI bias is the output due to the prejudiced assumption made due to the algorithm development process. AI systems have biases due to the...

3 minutes read.

Intelligent Agents | Agents in AI

What is an Agent? An agent can be viewed as anything that perceives its environment through sensors and acts upon that environment through actuators. For example, human being perceives their surroundings through...

8 minutes read.

Cryptarithmetic Problem in AI

Cryptarithmetic Problem Cryptarithmetic Problem is a type of constraint satisfaction problem where the game is about digits and its unique replacement either with alphabets or other symbols. In cryptarithmetic problem, the...

3 minutes read.

Knowledge Based Agents in AI

Knowledge is the basic element for a human brain to know and understand the things logically. When a person becomes knowledgeable about something, he is able to do that thing in a better...

4 minutes read.

Gradient Descent

Gradient Descent When training a neural network, an algorithm is used to minimize the loss. This algorithm is called as Gradient Descent. And loss refers to the incorrect outputs given by...

6 minutes read.

8 best topics for research and thesis in artificial intelligence

AI, abbreviated as Artificial Intelligence, is a field which has a long history. Artificial Intelligence is the ability of machines that perform the same function as human beings, like problem-solving,...

3 minutes read.

The Wumpus World

The Wumpus world is a game playing which provides an environment to the knowledge-based agent to showcase its stored knowledge. It was developed by Gregory Yob in 1973. About the game:  It...

3 minutes read.

Resolution Method in AI

Resolution Method in AI Resolution method is an inference rule which is used in both Propositional as well as First-order Predicate Logic in different ways. This method is basically used for proving the...

5 minutes read.

Neural Networks

Neural Networks are one of the most popular techniques and tools in Machine learning. Neural Networks were inspired by the human brain as early as in the 1940s. Researchers studied the...

5 minutes read.

Local Search Algorithms and Optimization Problem

The informed and uninformed search expands the nodes systematically in two ways: keeping different paths in the memory and selecting the best suitable path, Which leads to a solution state required to reach the goal...

2 minutes read.

Theory of First-order Logic

Theory of First-order Logic First-order logic is also called Predicate logic and First-order predicate calculus (FOPL). It is a formal representation of logic in the form of quantifiers. In predicate logic, the input is taken...

4 minutes read.

Dynamic Bayesian Networks

DBN is a temporary network model that is used to relate variables to each other for adjacent time steps. Each part of a Dynamic Bayesian Network can have any number of Xivariables for...

3 minutes read.

Unsupervised Learning in AI

Unsupervised Learning in AI Unsupervised LearningIntroductionClusteringComparison between Supervised, Unsupervised, and Reinforcement Learning. Unsupervised Learning This is the third major category of Machine Learning. Unsupervised learning happens when we have data without additional feedback,...

2 minutes read.

Informed Search/ Heuristic Search in AI

An informed search is more efficient than an uninformed search because in informed search, along with the current state information,  some additional information is also present, which make it easy to reach the...

6 minutes read.

Inference in First-order Logic

Inference in First-order Logic While defining inference, we mean to define effective procedures for answering questions in FOPL. FOPL offers the following inference rules: Inference rules for quantifiersUniversal Instantiation (UI): In this, we can infer any sentence by...

5 minutes read.

What is Artificial Super Intelligence (ASI)

Before starting with Artificial Super Intelligence, first, we have to know what Artificial Intelligence is. Artificial Intelligence is a field which has a long history. Artificial intelligence is the ability...

3 minutes read.

Natural Language Processing

Natural Language Processing in AI Topics Covered in Language Module Natural Language ProcessingSyntax and SemanticsContext-Free GrammarNLTKN-gramsTokenizationBag of WordsNaïve Bayes In language, we will cover how Artificial Intelligence is used to process human language...

13 minutes read.

Uninformed Search Strategies - Artificial Intelligence

Breadth-first search (BFS) It is a simple search strategy where the root node is expanded first, then covering all other successors of the root node, further move to expand the next...

8 minutes read.