0% found this document useful (0 votes)
96 views2 pages

Knapsack Problem Using Dynamic Programming

The document discusses the knapsack problem, specifically focusing on solving it using dynamic programming. It outlines the constraints of the problem, where items can either be placed completely into the bag or not at all, with the goal of maximizing profit based on the weights and profits of the items. The total capacity of the bag is defined, and various weights and profits are provided for analysis.

Uploaded by

arutchelvamus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views2 pages

Knapsack Problem Using Dynamic Programming

The document discusses the knapsack problem, specifically focusing on solving it using dynamic programming. It outlines the constraints of the problem, where items can either be placed completely into the bag or not at all, with the goal of maximizing profit based on the weights and profits of the items. The total capacity of the bag is defined, and various weights and profits are provided for analysis.

Uploaded by

arutchelvamus
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

programmixg

10. Sulveoli Koaysack proklem uing dynamic


Rrefit
Me weiqht
capaucty
Total Cayacty , M=4

(w) weignt
21 4

Wi
3 3 3 3
wib 3 10
3 7
5 8
3 12
12 2

21/al24
Sslue i ol kaapsack prcblem Mcing(dymanic programning
t&, &, Pu,ee E, 2, 6,64
M nz A Compare Ni Weighty
Max Welqt)
&insert the pofit
Valesinside
box 2Ye SWefa ht=0 23
PrefitCP)
P Wi

22 2- 2 3 33
5 4 5 5 67 7
6 4 2 5 667 previous fow

2-6-2
in
but2 glso
Sonot
i

So naz hcofit s 54=3 2-2-O

SolutioE2,6y
clasSmate
Date

Pagege13

Given Nitemns where each item has some weight kprcfit


2550siated withit Z
qiven o24 ith capacity WCie,the baq canhald st mest
Wweiqht in it
The tsk is to putthe items into the bag Such that thesum
of profits associated nith them is the maximum possible.

Note The constraint here is e can either


an item completaly) into the baa 9Y
camat put it at all CIt isfaotposcible te put a
part of an ttem into the bag

You might also like