Forward and Backward Chaining in Artificial intelligence

Forward chaining starts with the available data. This is an initial data and uses inference rules. It helps in extracting more data until a goal is reached. An inference engine using forward chaining searches the inference rules until it finds one. Here the antecedent is known to be true. Whenever such a rule is found, the engine can conclude results. An inference engine using forward chaining searches the inference rules until it finds solution. Here the “IF” clause is known to be true. When found it can conclude. It may infer the “THEN” clause. It will result in the addition of new information to the dataset. It means that it starts with some facts and applies rules to find all possible conclusions. Therefore, it is also known as “Data Driven Approach”.

Backward chaining approach starts with the desired conclusion and works backward to find supporting facts. An inference engine using “Backward Chaining” would search the inference rules until it finds one which has a “THEN clause” that matches a desired goal. If the “IF clause” of that inference rule is not known to be true. At the very next step, it will add to the list of goals. In other words, this approach starts with the desired conclusion and works backward to find supporting facts. Therefore, it is also known as “Goal-Driven Approach”. They do this by finding rules that can conclude the information needed by the goal. It tries to make the If parts of those rules satisfied. It works as follows:

It will check the conclusions of the rules. This is used to find all rules that can satisfy the top goal on the stack. You need to process these rules one at a time. One has to evaluate the conditions in the rules. It may be possible that the condition is currently unknown. Simply you have to push a goal to make that condition known.

At last, one has to recursively invoked the system. It might be possible that the condition which is known to be unsatisfied. We have to continue with the loop till the last. It might be possible that it is difficult to determine whether the condition was satisfied, continue with the loop. If all the conditions in the selected rule are satisfied.

Then we can add to Working Memory. After that pop the goal off the stack. Finally, return from this invocation of the system. The system will terminate with success when the goal stack is empty. It will terminate with failure if the system runs out of rules.

Forward & Backward chaining
Forward & Backward chaining

Comparison of Forward and Backward Chaining

Table of comparison of Forward and Backward Chaining

Forward ChainingBackward Chaining
It starts with new data.It starts with some goal or hypothesis.
It asks few questions.It asks many questions.
It examines all rules.It examines some rules
Slow approach.Fast approach.
Gather larger information from small amount of data.It produce small amount of information from available
data.
Forward Chaining is primarily data driven.Backward Chaining is primarily Goal Driven.
It uses its input. It searches rules for answers.It proves the considered hypothesis.
It is a form of Top-Down reasoning.It is a form of bottom up reasoning.
Works forward to find conclusions from facts.Works backward to find facts that support the hypothesis.
It tends to breath – firstIt tends to depth – first
Table of comparison of Forward and Backward Chaining

Leave a Comment