Knapsack Problem Dynamic Programming

Veröffentlicht am: 23 Juli 2015
auf dem Kanal: IDeserve
13,336
126

Knapsack Problem Dynamic Programming: Given a set of items, each with weight and benefit, determine the items to include in a collection so that the total weight is less than or equal to a given limit and the total benefit is maximized.

For example,
With a given weight limit of 5, if we have to choose from following set of four item with weights and benefits as shown -
weight[] = {2,2,4,5}, benefit[] = {3,7,2,9}

Then to maximize the benefit, we have to choose item 0 and item 1 to get the maximum benefit possible of 10 units.

If for the same set, weight limit is changed to 10 then our algorithm should choose items 0, item 1 and item 3 to get the benefit of 19 which is maximum.

Code: https://github.com/IDeserve/learn/blo...

Website: http://www.ideserve.co.in

Facebook:   / ideserve.co.in  


Auf dieser Seite können Sie das Online-Video Knapsack Problem Dynamic Programming mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer IDeserve 23 Juli 2015 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 13,336 Mal angesehen und es wurde von 126 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!