Back Tracking and Branch and Bound
Back Tracking and Branch and Bound
Backtracking algorithm
Backtracking search is an exhaustive search algorithm
(depth-first search) that systematically assigns all possible
combinations of values to the variables and checks if these
assignments constitute a solution
o It is a modified depth first search of a tree,
which determines problem solutions by
systematically searching the solution space for
the given problem instance.
o It involves forming a solution and checking at
every step if this has any chance of success.
If the solution at any point seems not
promising, that solution is ignored
o That is if the algorithms determines that a node
can lead to nothing or dead end,
we go back (backtrack) to the nodes
parent and proceed with the search on the
next child.
o Backtracking search is complete in the sense that it is
guaranteed to find a solution if one exists.
o On the downside, the worst-case running time of
backtracking search is exponential.
Terminology:
ALGORITHM
Step 1 − if current_position is goal, return success
Step 2 − else,
Step 3− if current_position is an end point, return failed.
Step 4− else, if current_position is not end point, explore and repeat above steps.
Example 1
N-Queen problem
Solution
{0 , 1 , 0 , 0}
{0 , 0 , 0 , 1}
{1 , 0 , 0 , 0}
{0 , 0 , 1 , 0}
Example 2
Example 4
Solution
Thank you
End
.
o If the sum a + b is over or equal to the current upper
bound, the solutions on that branch guarantees to be
worse than the current best solution, and the branch can
be pruned.
For example, for the unfinished route A→B→E=7
and a minimum spanning tree is built for nodes A, C, D, and E,
and its value is =12 and a+b=19
o Every time a partial route is extended by a vertex, a lower
bound for the length of the rest of the route is computed
o In the case of A→B→C→D→E→A the, the upper bound
is 21
o If we consider the next route as of A→B→C→E→D→A
the new upper bound is 15 and the route of 21 is pruned
and 15 is taken and the currents best value
In this graph, most of the nodes will be pruned since
a+b is greater than 15.
In summary, in using an exhaustive search, a total of 89
nodes will be searched
o but with branch-and-bound only 20 node will be searched
Branch-and-bound accelerates the search process by reducing
the solution space en masse.
o Although branch-and-bound algorithms generally do not
possess proven time complexity, their efficiency has made
them the first choice for many problems, especially for
NP-complete problems.
Branch-and-bound mainly addresses optimization problems,
because bounding is often based on numerical comparisons
Thank you
End