×

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. Therefore, there are several pathways in a search tree to reach the goal node from the current node. The selection of a good heuristic function matters certainly. A good heuristic function is determined by its efficiency. More is the information about the problem, more is the processing time.

Some toy problems, such as 8-puzzle, 8-queen, tic-tac-toe, etc., can be solved more efficiently with the help of a heuristic function. Let’s see how:

Consider the following 8-puzzle problem where we have a start state and a goal state. Our task is to slide the tiles of the current/start state and place it in an order followed in the goal state. There can be four moves either left, right, up, or down. There can be several ways to convert the current/start state to the goal state, but, we can use a heuristic function h(n) to solve the problem more efficiently.

heuristic function for the 8-puzzle problem

A heuristic function for the 8-puzzle problem is defined below:

h(n)=Number of tiles out of position.

So, there is total of three tiles out of position i.e., 6,5 and 4. Do not count the empty tile present in the goal state). i.e. h(n)=3. Now, we require to minimize the value of h(n) =0.

We can construct a state-space tree to minimize the h(n) value to 0, as shown below:

heuristic function for the 8-puzzle problem 2

It is seen from the above state space tree that the goal state is minimized from h(n)=3 to h(n)=0. However, we can create and use several heuristic functions as per the reqirement. It is also clear from the above example that a heuristic function h(n) can be defined as the information required to solve a given problem more efficiently. The information can be related to the nature of the state, cost of transforming from one state to another, goal node characterstics, etc., which is expressed as a heuristic function.

Properties of a Heuristic search Algorithm

Use of heuristic function in a heuristic search algorithm leads to following properties of a heuristic search algorithm:

  • Admissible Condition: An algorithm is said to be admissible, if it returns an optimal solution.
  • Completeness: An algorithm is said to be complete, if it terminates with a solution (if the solution exists).
  • Dominance Property: If there are two admissible heuristic algorithms A1 and A2 having h1 and h2 heuristic functions, then A1 is said to dominate A2  if h1 is better than h2 for all the values of node n.
  • Optimality Property: If an algorithm is complete, admissible, and dominating other algorithms, it will be the best one and will definitely give an optimal solution.

Related Topics

Hill Climbing Algorithm in AI

Hill Climbing Algorithm: Hill climbing search is a local search problem. The purpose of the hill climbing search is to climb a hill and reach the topmost peak/ point of...

4 minutes read.

Adversarial Search in Artificial Intelligence

AI Adversarial search: Adversarial search is a game-playing technique where the agents are surrounded by a competitive environment. A conflicting goal is given to the agents (multiagent). These agents compete...

3 minutes read.

Forward Chaining in AI : Artificial Intelligence

Forward Chaining is the process which works on the basis of available data to make certain decisions. Forward chaining is the process of chaining data in the forward direction. In forward chaining, we...

4 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.

Artificial Intelligence vs. Machine learning

Artificial Intelligence This word is trending in the world of technology. Artificial means something which was not present naturally, and it is built by humans, and intelligence means the ability to...

4 minutes read.

Quantifying Uncertainty

The concept of quantifying uncertainty relies on how an agent can keep away uncertainty with a degree of belief. The term uncertainty refers to that situation or information which is either unknown or...

5 minutes read.

Utility Functions in Artificial Intelligence

The agents use the utility theory for making decisions. It is the mapping from lotteries to the real numbers. An agent is supposed to have various preferences and can choose the one...

3 minutes read.

Classical Planning

Classical Planning is the planning where an agent takes advantage of the problem structure to construct complex plans of an action. The agent performs three tasks in classical planning: Planning: The agent plans after...

4 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.

Top 7 Artificial Intelligence and Machine Learning trends for 2024

Artificial Intelligence is the ability of machines to perform the same function as human beings, like problem-solving, learning, reasoning and recognizing. Machine Learning is another branch of Computer Science and...

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.

Artificial Satellites

Many objects like stars, satellites and the moon are visible in the night sky. Satellites are objects revolving around the planet or a more significant object. Moon is the most...

6 minutes read.

Integration of Blockchain and Artificial Intelligence

A Blockchain is a shared database or ledger where pieces of data are stored in data structures known as blocks. So, we can say that Blockchain is the distribution storage...

6 minutes read.

Minimax Strategy

In artificial intelligence, minimax is a decision-making strategy under game theory, which is used to minimize the losing chances in a game and to maximize the winning chances. This strategy is also known...

3 minutes read.

Information Retrieval

Information Retrieval: In order to analyze and categorize the text, we'd like to be able to figure out information about the text, some meaning about the text as well. And,...

14 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.

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.

Top 10 Artificial Intelligence Technologies in 2024

Artificial Intelligence Technologies in 2020 1. Augmented Reality This is one of the most fascinating technology nowadays. Augmented Reality is the use of text, graphics, audio, etc. in real time. In Simple...

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.

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.