Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Week 9 : Unbonded Knapsack Problem The unbounded knapsack problem ( also known as complete knapsack problem ) is a problem which similar to 0
Week : Unbonded Knapsack Problem
The unbounded knapsack problem also known as complete knapsack problem is a problem which similar to knapsack problem. Given a set of items and capacity of knapsack, asking you to maximizing total value of items that you can keep in the knapsack. The only difference is we restrict the number of item copies or not. In knapsack problem, we can only decide take or not take. In unbounded knapsack problem, we don't restrict the number of item copies, in other words, you can take each item arbitrary nonnegative integer times. We can define the problem IO as below:
Instance: candidate items dots, where tuple shows item value and weight for ith item, knapsack capacity
Result: The maximum value or possible combination of items that you can keep in knapsack
Description
You can design your transition function similar to knapsack problem. Consider capacity and the item you can peek the item at most copies.
Questions
We can solve above problem by dynamic programming approach, what's the transition function? Please write down your answer in recursively way.
Traditional DP algorithm will construct an table to keep subproblem solutions. We can improve the space complexity by reduce the size of cache table. Please design an algorithm to solving unbounded knapsack problem with space complexity
Design an algorithm to reconstruct the combination of items with table, and analyzing its time complexity.
Same to Q but doing things with
For the implementations please use c language!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started