Computers and Technology

Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingmweight. each objectihas weightwi, and profitpi.(a) first, suppose that the objects are divisible (e. g., the thief is in a cheese shop and the itemsare rolls of cheese that can be cut). for each objecti, if a fractionxi, 0≤xi≤1 (takingxi= 1 would be taking the entire object) is placed in the knapsack, then the profit earnedispixi. come up with an efficient greedy algorithm for maximizing the profit of the thief. prove the correctness and running time.(b) now, suppose the items cannot be taken fractionally. in other words, the thief can eithertake an entire item or leave it behind. suppose we also know the following: the order of theseitems when sorted by increasing weight is the same as their order when sorted by decreasingvalue. give a greedy algorithm to find an optimal solution to this variant of the knapsackproblem. prove the correctness and running time.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:00, haydonmetzger
Which one of the following identifies the primary a purpose of information classification processes? a. define the requirements for protecting sensitive data. b. define the requirements for backing up data. c. define the requirements for storing data. d. define the requirements for transmitting data.
Answers: 2
image
Computers and Technology, 22.06.2019 22:40, ihatemylife0
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
image
Computers and Technology, 23.06.2019 08:30, mai1261
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
image
Computers and Technology, 23.06.2019 16:00, ginaaa20
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
Do you know the correct answer?
Athief is given the choice ofnobjects to steal, but only has one knapsack with a capacity of takingm...

Questions in other subjects:

Konu
English, 23.10.2020 16:00
Konu
Engineering, 23.10.2020 16:00