Parameter | Backtracking | Branch and Bound |
Approach | Backtracking is used to find all possible solutions available to a problem. When it realises that it has made a bad choice, it undoes the last choice by backing it up. It searches the state space tree until it has found a solution for the problem. | Branch-and-Bound is used to solve optimisation problems. When it realises that it already has a better optimal solution that the pre-solution leads to, it abandons that pre-solution. It completely searches the state space tree to get optimal solution. |
Traversal | Backtracking traverses the state space tree by DFS(Depth First Search) manner. | Branch-and-Bound traverse the tree in any manner, DFS or BFS. |
Function | Backtracking involves feasibility function. | Branch-and-Bound involves a bounding function. |
Problems | Backtracking is used for solving Decision Problem. | Branch-and-Bound is used for solving Optimisation Problem. |
Searching | In backtracking, the state space tree is searched until the solution is obtained. | In Branch-and-Bound as the optimum solution may be present any where in the state space tree, so the tree need to be searched completely. |
Efficiency | Backtracking is more efficient. | Branch-and-Bound is less efficient. |
Applications | Useful in solving N-Queen Problem, Sum of subset, Hamilton cycle problem, graph coloring problem | Useful in solving Knapsack Problem, Travelling Salesman Problem. |
Solve | Backtracking can solve almost any problem. (chess, sudoku, etc ). | Branch-and-Bound can not solve almost any problem. |
Used for | Typically backtracking is used to solve decision problems. | Branch and bound is used to solve optimization problems. |
Nodes | Nodes in stat space tree are explored in depth first tree. | Nodes in tree may be explored in depth-first or breadth-first order. |
Next move | Next move from current state can lead to bad choice. | Next move is always towards better solution. |
Solution | On successful search of solution in state space tree, search stops. | Entire state space tree is search in order to find optimal solution. |