0/1 Knapsack Problem Using Dynamic Programming || Design and Analysis of Algorithms || DAA
Вставка
- Опубліковано 3 вер 2021
- #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
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
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..
Happy teacher's day sir ❤️
Best teacher ever 😃
Thanks
Sir what if profits are not in order of purging rule
U R REALLY GREAT SIR 💕
Thank you so much 😀 Plz subscribe to the channel and if possible share with your friends. Thanks in advance...
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.
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...
Thank you sir this is the best explanation on UA-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 🙂
Happy Teachers 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..
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 Teachers Day sir...😊
Thanks
Saviour 🙏❤️
Thanks. 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..
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..
Thank you
You're welcome. Plz subscribe to the channel and if possible share with your friends. Thanks in advance..
HAPPY TEACHER'S DAY SIR
Thanks
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 teacher's day sir
Thanks
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..
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..
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 Teacher's Day...
T
Happy teachers day sir
Thanks
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🤩
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..