1. Fractional Knapsack Problem Algorithm
Which best describes the tightest range of the number of items with only fractional inclusion (i.e. not entirely included or excluded) in the knapsack? (Let n denote the number of items for possible inclusion.)
A) At least 0 items and at most n items
B) At least 1 items and at most n items
C) Exactly n items
D) At least 0 items and at most n-1 items
E) At least 1 items and at most n-1 items
F) At least 0 items and at most 1 items
G) Exactly 1 items
H) Exactly 0 items
2. Fractional Knapsack Problem - Time Complexity
Assuming that the values per weight can be represented with no more than three digits each before and after the decimal point, which best describes the TOTAL time complexity of our greedy algorithm for the Fractional Knapsack Problem?
A) Θ(log n)
B) Θ(n)
C) Θ(n log log n)
D) Θ(n log n)
E) Θ(n^2)
F) Θ(n^2 log n)
3. Fractional Knapsack Algorithm - Fractional Case
In the greedy algorithm for the Fractional Knapsack Problem, what should go in the blank to determine the fraction being used?
A) fraction = initialCapacity / value[i]
B) fraction = initialCapacity / weight[i]
C) fraction = initialCapacity / (value[i]/weight[i])
D) fraction = remainingCapacity / value[i]
E) fraction = remainingCapacity / weight[i]
F) fraction = remainingCapacity / (value[i]/weight[i])
4.
Complexity of Knapsack Problems
Which of the following versions of the Knapsack Problem can be solved (optimally) in polynomial time?
Multiple answers:You can select more than one option
A) Fractional Knapsack Problem
B) 0/1 Knapsack Problem
C) 0/1 Knapsack Problem with integer knapsack capacity
D) none of the above
Please, include a short explanation with the answer.
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
1. Fractional Knapsack Problem Algorithm Which best describes the tightest range of the number of items...
Recall that in the "Knapsack Problem", there are n items having respective values V1..n) and weights W1..n), all greater than 0 and one needs to maximize the total value of the subset of the items placed in the knapsack limited by a weight capacity of W In the 0-1 Knapsack Problem, each item must be either be included or excluded in its entirety, in light of the fact that this problem is to be "NP-Complete", how can one solve the...
For given capacity of knapsack W and n items {i1,i2,...,in} with its own value {v1,v2,...,vn} and weight {w1,w2,...,wn}, find a greedy algorithm that solves fractional knapsack problem, and prove its correctness. And, if you naively use the greedy algorithm to solve 0-1 knapsack problem with no repetition, then the greedy algorithm does not ensure an optimal solution anymore. Give an example that a solution from the greedy algorithm is not an optimal solution for 0-1 knapsack problem.
Suppose you are given an instance of the fractional knapsack problem in which all the items have the same weight. Show that you can solve the fractional knapsack problem in this case in O(n) time.
"Greedy, but Better": Given a knapsack problem with a weight capacity C, and n items, and each item has a weight W[1:n] and monetary value P[1:n]. You have to determine which items to take so that the total weight is C, and the total value (profit) is maximized. In this case we are considering an integer problem, so you can either take an item, or not take an item, you cannot take it fractionally. If you recall, the greedy algorithm...
solution is required in pseudo code please. 2 Knapsack Problem În al Knapsack problem. given n items(11-12. . . . . 1"} with weight {w1·W2. . . . . ux) and value (n 2, .., nJ, the goal is to select a combination of items such that the total value V is maximized and the total weight is less or equal to a given capacity In this question, we will consider two different ways to represent a solution to the...
2 Knapsack Problem In a Knapsack problem, given n items {11, I2, -.., In} with weight {wi, w2, -.., wn) and value fvi, v2, ..., vn], the goal is to select a combination of items such that the total value V is maximized and the total weight is less or equal to a given capacity W. Tt i=1 In this question, we will consider two different ways to represent a solution to the Knapsack problem using an array with size...
please I would like assistance with this which are question 1 and 2, thank you 2. We have 5 objects, and the weights and values are No. 2 3 4 5 10 20 30 50 V 20 30 66 60 55 W 40 The knapsack can carry a weight not exceeding 90, find a subset items and give the total weight and value for following algorithms: 1) By using the algorithm of greedy of value for 0-1 knapsack problem? By...
There are n items in a store. For each item i=1,2,...,n the weight of the item is wi and the value of the item is vi. A thief is carrying a knapsack of weight W. In this version of a problem the items can be broken into smaller pieces, so the thief may decide to carry only a fraction xi of object i, where 0≤xi ≤1. Item i contributes xiwi to the total weight in the knapsack, and xivi to...
In a Knapsack problem, given n items {I1, I2, · · · , In} with weight {w1, w2, · · · , wn} and value {v1,v2, ···, vn}, the goal is to select a combination of items such that the total value V is maximized and the total weight is less or equal to a given capacity W . i-1 In this question, we will consider two different ways to represent a solution to the Knapsack problem using . an...
Design a local search algorithm for the 0-1 knapsack problem. Assume there are n items x1 ... xn each with weight wi and value vi. The knapsack can have at most one of each item and the total weight cannot exceed W. You want to maximize the total value in the knapsack.Question 1: (7 points) Show the psuedocode/explanation for your algorithm.Question 2. (3 points) Is it guaranteed to find an optimal solution? Justify your answer.