Question

In: Computer Science

discuss the differences and similarities (implementation and performance) between the solution for 0-1 knapsack problem using...

discuss the differences and similarities (implementation and performance) between the solution for 0-1 knapsack problem using Backtracking versus Branch and Bound. Do not just define the algorithms compare the performance and implementation of the 0-1 knapsack problem

Solutions

Expert Solution

We can use Backtracking to optimize the Brute Force solution. In the tree representation, we can do DFS of the tree. If we reach a point where a solution no longer is feasible, there is no need to continue exploring. Backtracking would be much more effective if we had even more items or a smaller knapsack capacity.

The backtracking based solution works better than brute force by ignoring infeasible solutions. We can do better (than backtracking) if we know a bound on the best possible solution subtree rooted with every node. If the best in the subtree is worse than the current best, we can simply ignore this node and its subtrees. So we compute-bound (best solution) for every node and compare the bound with current best solution before exploring the node.

Branch and bound is a very useful technique for searching a solution but in the worst case, we need to fully calculate the entire tree. At best, we only need to fully calculate one path through the tree and prune the rest of it.


Related Solutions

Discuss the differences and similarities between these three business forms : 1. Differences and similarities between...
Discuss the differences and similarities between these three business forms : 1. Differences and similarities between LLC in USA vs SARL in Lebanon 2. Corporation in USA vs S.A.L in Lebanon 3. General Partnership in USA vs. Unlimited Partnership in Lebanon
Discuss the differences and similarities between these two business forms : 1.Similarities and differences between limited...
Discuss the differences and similarities between these two business forms : 1.Similarities and differences between limited partnership in USA vs Limited partnership in Lebanon 2. Similarities and differences between Sole proprietorship in USA vs. Establishment in Lebanon
(1) Explain the similarities and differences between a traditional budget, a program budget, and a performance...
(1) Explain the similarities and differences between a traditional budget, a program budget, and a performance budget. Be specific. (2) Explain the focus and purpose of each budget.
similarities and differences between minimization and maximazation problems using the graphical solution approaches of LP
similarities and differences between minimization and maximazation problems using the graphical solution approaches of LP
1. Explain and discuss the differences and similarities between the circular flow and entrepreneurial profits by...
1. Explain and discuss the differences and similarities between the circular flow and entrepreneurial profits by providing specific examples so that the differences and similarities are evident, and it is clear how businesses can be categorized as to whether they are earning entrepreneurial profits or part of the circular flow.
Discuss and explain similarities and differences between Private Browsing / Incognito Mode using a standard Web...
Discuss and explain similarities and differences between Private Browsing / Incognito Mode using a standard Web Browser, vs. Anonymized Browsing using a relay-based overlay network as well as the trade-offs in terms of privacy and network performance.
Describe the differences and similarities between Financial position ratios and Financial performance ratios.
Describe the differences and similarities between Financial position ratios and Financial performance ratios.
Describe the differences and similarities between financial position ratios and financial performance ratios.
Describe the differences and similarities between financial position ratios and financial performance ratios.
In C++ or Java Write the Greedy programming Algorithm for the 0-1 Knapsack problem.                    (a)...
In C++ or Java Write the Greedy programming Algorithm for the 0-1 Knapsack problem.                    (a) No fraction allowed Max Weight W= 9 item 1: profit $20, weight 2, prof/weight=$10 item 2: profit $30, weight 5, prof/weight=$6 item 3: profit $35, weight 7, prof/weight=$5 item 4: profit $12, weight 3, prof/weight=$4 item 5: profit $3, weight 1, prof/weight=$3
Discuss the similarities of and differences between terrorist groups and organized crime.
Discuss the similarities of and differences between terrorist groups and organized crime.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT