0/1 Knapsack Problem Using Dynamic Programming || Design and Analysis of Algorithms || DAA
ฝัง
- เผยแพร่เมื่อ 5 ต.ค. 2024
- #sudhakaratchala #daavideos #daaplaylist
We are having ‘n’ objects and a knapsack or a bag in which the object ‘i’ has weight ‘wi’ is to be placed. And the knapsack has capacity ‘M’.
The profit pixi can be earned, if an object ‘i’ has to be placed into the knapsack.
The objective of the knapsack problem is to fill the knapsack with maximum profitable objects and the sum of the weights of the object is lessthan or equal to the capacity of the knapsack. That is
Maximize ∑2_(𝑖=0)^𝑛▒"pixi"
Purging rule (or) Dominance rule
If Si+1 contains (pj, wj) and (pk, wk) two pairs such that (pj ≤ pk ) and (wj ≥ wk)
then (pj, wj) pair can be eliminated. This purging rule is also called "dominance rule”.
In purging rule basically the dominated tuples get purged that is remove the pair with less profit and more weight.
The formula for solving the problem is
Si+1 = Si U S1i
Happy Teachers day sir.. without you there would be many backlogs in my btech but you made me clear all in the first attempt itself! thank you so much sir for teaching many students like us and helping them to pass their exams ❤️
Thanks
Sir thankyou so much your classes are very clear and understandable 🙏
All the best. Plz subscribe to the channel and if possible share with your friends. Thanks in advance.
Your explanation outstanding sir. Thank you sir thank you sooo much❤
You are most welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Ur videos are most useful to btech students sir thank you so much sir ur videos are useful in my exams for that tq so much sir 🙏🙏🙏🙏
So nice of you
Happy teacher's day sir ❤️
Best teacher ever 😃
Thanks
Never understood this tricky concepts in entire sem , what a detail and clear explanation sir our exams doesn't ends with your clases .... tqqq you 😇♥you sir
All the best. Please like the video, subscribe to the channel, and share it with your friends. Thanks in advance.
Sir , meeru lekapothe memu mamimun kuda pass avvamu sir , u r my real god of teacher sir ....
All the best. Please like the videos, subscribe to the channel, and share it with your friends. Thanks in advance.
Sir you're a saviour ❤
So nice of you. Please like the video, subscribe to the channel, and share it with your friends. Thanks in advance.
Thank you so much sir, your videos are very useful for many b-tech students, keep rocking sir....🤝
All the best. Plz subscribe to the channel and if possible share with your friends. Thanks in advance...
U R REALLY GREAT SIR 💕
Thank you so much 😀 Plz subscribe to the channel and if possible share with your friends. Thanks in advance...
Sir what if profits are not in order of purging rule
Thank a lot sir😇😇😇your video lectures are very helpful for us......... And your teaching was too good sir......
It's my pleasure. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Very good explanation sir!! Thank you
You are welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Happy Teachers day sir ❤️
Thanks
Thank you sir this is the best explanation on TH-cam thanks a lot 😊❤
You are most welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
@@SudhakarAtchala already subscribed your channel 3 years ago and shared with friends as well carry on the good work 😉😄 but plz also tell that how to represent these types of questions in exam question paper in your videos thanks a lot once again 🙂
Sir your explanatiom is excellent but video length is so much 😢 please try to say fast
Okay, noted. Plz subscribe to the channel and if possible share with your friends. Thanks in advance...
@@SudhakarAtchala Ok sir🤩
Happy Teachers Day sir...😊
Thanks
Nice explanation sir thank you
welcome
Tq for giving useful information
Welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance.
happy teacher's day sir
Thanks
Tq for teaching knapsack problem
It's my pleasure. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
HAPPY TEACHER'S DAY SIR
Thanks
TQ so much sir all ur videos are sooo useful to mee
So nice of you. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Saviour 🙏❤️
Thanks. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
In this video so useful for me
Glad it helped. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
for example p1>=p2 what operation we perform sir
No need to remove the dominant pair.
Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Thank you sir
So nice of you. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Thank you
You're welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
Happy Teacher's Day...
T
For the same problem can you Please explain tabular method
Okay sure. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
You want to do video on reliability design problem
Ya sure. Plz subscribe to the channel and if possible share with your friends. Thanks in advance.
Happy teachers day sir
Thanks