Question
Use the Backtracking algorithm for the $0-1$ Knapsack problem (Algorithm 5.7) to maximize the profit for the following problem instance. Show the actions step by step.$$\begin{array}{ccccc}i & p_{i} & w_{i} & \frac{p_{i}}{w_{i}} & \\1 & \$ 20 & 2 & 10 & \\2 & \$ 30 & 5 & 6 & \\3 & \$ 35 & 7 & 5 & W=19 \\4 & \$ 12 & 3 & 4 & \\5 & \$ 3 & 1 & 3 &\end{array}$$
Step 1
The current weight is 0, the current profit is 0, and the maximum weight capacity \( W = 19 \). Show more…
Show all steps
Your feedback will help us improve your experience
Ernest Castorena and 94 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Use the simplex method to solve each linear programming problem. $\begin{array}{ll}{\text { Maximize }} & {z=2 x_{1}+5 x_{2}+x_{3}} \\ {\text { subject to: }} & {x_{1}-5 x_{2}+2 x_{3} \leq 30} \\ {} & {4 x_{1}-3 x_{2}+6 x_{3} \leq 72} \\ {\text { with }} & {x_{1} \geq 0, \quad x_{2} \geq 0, \quad x_{3} \geq 0}\end{array}$
Linear Programming:The Simplex Method
Maximization Problems
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD