Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Backtracking, Branch and Bound - Algorithms and Applications in Java - Lecture Slides, Slides of Computer Science

These are the Lecture Slides of Algorithms and Applications in Java which includes Greedy Method, Divide and Conquer, Dynamic Programming, Backtracking, Branch and Bound, Integer Programming, Neural Networks, Genetic Algorithms, Tabu Search etc.Key important points are: Backtracking, Branch and Bound, Subset Problem, Permutation Problems, Tree Organization, Solution Space, Subset Tree, Permutation Tree, Depth-First Manner, Bounding Functions, Subet Sum

Typology: Slides

2012/2013

Uploaded on 03/27/2013

agarkar
agarkar 🇮🇳

4.3

(26)

380 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Backtracking And Branch And Bound
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Backtracking, Branch and Bound - Algorithms and Applications in Java - Lecture Slides and more Slides Computer Science in PDF only on Docsity!

Backtracking And Branch And Bound

Subset & Permutation Problems

  • Subset problem of size n.

 Nonsystematic search of the space for the answer takes O(p2 n^ ) time, where p is the time needed to evaluate each member of the solution space.

  • Permutation problem of size n.

 Nonsystematic search of the space for the answer takes O(pn!) time, where p is the time needed to evaluate each member of the solution space.

  • Backtracking and branch and bound perform a systematic search; often taking much less time than taken by a nonsystematic search.
 - Subset Tree For n = - x 1 =1 x^1 = 
  • x 2 =1 x 2 = 0 x^2 =1 x^2 =
  • x 3 =1 x 3 = - x 4 =1 x 4 =

Permutation Tree For n = 3

x 1 =1 (^) x 1 =^

x 1 = 3

x 2 = 2 x 2 = 3 x 2 = 1 x 2 = 3 x 2 = 1 x 2 = 2

x 3 =3 x 3 =2 x 3 =3 x 3 =1 x 3 =2 x 3 =

123 132 213 231 312 321

Backtracking Depth-First Search

x 1 =1 x^1 = 0

x 2 =1 x 2 = 0 x^2 =1^ x^2 = 0

Backtracking Depth-First Search

x 1 =1 x^1 = 0

x 2 =1 x 2 = 0 x^2 =1^ x^2 = 0

Backtracking Depth-First Search

x 1 =1 x^1 = 0

x 2 =1 x 2 = 0 x^2 =1^ x^2 = 0

Backtracking Depth-First Search

x 1 =1 x^1 = 0

x 2 =1 x 2 = 0 x^2 =1^ x^2 = 0

Backtracking

  • Space required is O(tree height).
  • With effective bounding functions, large instances can often be solved.
  • For some problems (e.g., 0/1 knapsack), the answer (or a very good solution) may be found quickly but a lot of additional time is needed to complete the search of the tree.
  • Run backtracking for as much time as is feasible and use best solution found up to that time.

Branch And Bound

  • Search the tree using a breadth-first search (FIFO branch and bound).
  • Search the tree as in a bfs, but replace the FIFO queue with a stack (LIFO branch and bound).
  • Replace the FIFO queue with a priority queue (least-cost (or max priority) branch and bound). The priority of a node p in the queue is based on an estimate of the likelihood that the answer node is in the subtree whose root is p.

Branch And Bound

 FIFO branch and bound finds solution closest to root.  Backtracking may never find a solution because tree depth is infinite (unless repeating configurations are eliminated).

  • Least-cost branch and bound directs the search to parts of the space most likely to contain the answer. So it could perform better than backtracking.