For those wondering what makes this a DP solution: Basically instead of finding all permutations. and then doing the arithmetic, IE, instead of doing min(1->2->3->4, 1->2->4->3, ...) of all possible routes, we can see that there are repetitive calculations in 1->2->3->4 and 1->2->4->3 for instance. The route 1->2 is common(overlap) to routes 1->2->3->4 and 1->2->4->3, if you looked at the tree closely. By definition of DP, we are trying all possibilities and we also see overlapping subproblems!
@vendettaaaa666 So essentially all this is, is caching distances into a giant lookup table? That still seems very complexity-demanding to solve this problem.
I think we are overlapping because we don't know from which direction path cost is minimum. If both sided path would be same then that approach will not be more good.
Sir one thing I've to tell you ! Watched all of your videos for 3 times or atleast 2 times perfectly and It's just because of you , today I was confidently able to write the DAA Exam under JNTU-H Thank You so much Sir ! Really lovely explantions ! and I hope you create some more videos on other Computer Subjects Sir , you were known to whole of our College and you were the one who have helped almost 450 students in our college Once again Hats Off to you Sir !
Profesor Bari, you surprise me all the time, are you Magic? i have just come from another video and i could not understand what he was saying but within the first two minutes and 30 seconds here i already understand the problem... thank you
Sir as you took g(2, {3}) =15 then all the remaining will be also like same..... But you wrote g(2, {4}) =8 it will be 18 na, and g(3, {2}) =5 but 18....g(3, {4}) =20, g(4, {2}) =13, g(4, {3}) =15.....na?
Our college teachers became teachers because they didn't get placement 😀 . and this person became teacher because of his interest. The difference can be seen 😁 clearly
Awesome sir.....I'm in DAA semester exam's previous day, I'm blank about DAA, but after seen your all videos I'm very much cleared and having hope i will pass in exam👏👏👏👏👏 Hat's of sirG
Sir, Thank you for a great explanation! I have a question. For g(2, {3}) we have 15, but then should not g(2, {4}) = 18, g(3, {2}) = 18, g(3, {4}) = 20, g(4, {2}) = 13, g(4, {3}) = 15? Thank you
No one is perfect , but that mistake screwed up my solution.... Well i found a helpful guy who gave the correct values... Guys like me will get into depression if our answers don't match, so thanks to that guy....
Sir u r teaching very useful for me tq so much and this TSP it has 1 small mistake g(2,{3} )=15 but g(2,{4})=18, g(3,{2})=18and so on... But u just consider only 1vetex only that is mistake
sir u messed up near the intermediate part where there is 1 remaining vertex as in ... g(2,{3}) ..... to ..... g(4,{3}) .... but it is a good explanation ... thank you
Great explanation, thank you sir i got clarity on this problem, but there is a little problem: 10:30, I think he wrote number "1" not number "4" since he said "start from vertex 2 to nowhere -> return vertex 1" -> so his answer is g(2,{1}) =5. I have misled as well, but I listen to him carefully so maybe we are misled at this point. 11:28, g(2,{4}) = 18 not 8 (Cause g(4,1) = 8 + g(2, 4) = 10 -> 18), and the continuous answer is similar to Mr. @kennethi.e answer.
Sir, promise me you'll never delete these videos! These are great for references even when I'm 30 Edit: We have exam tomorrow with students of about 20sec*60 = 1200 students watch your videos this entire day like me :-)
Sir, I believe Dynamic Programming is an improvement over Brute Force, although approach is similar. But in this particular example, I can't find any improvement, it looks exactly Brute Force. My question is what is the difference between Brute Force and Dynamic P, if we solve this problem using both?
This is already a little smaller than the brute force. Brute force is O(n!) which means the table would have 24 entries. He doesn't work the last 3 entries for his table, but there are 15 total. This improvement gets more dramatic as the problem increases in size.
So this is pretty much the same as the multistage graph problem? The algorithm starts finding out minimum costs from the end towards the starting point. The only difference is instead of having a table saving the shortest path to the next node, we have have all the combinations as some sort of list
Tomorrow DAA exam very Thanks 😊
Lol 😂. It's my turn now
Today DAA exam in 1 hr😌
@@CellerCity haha now it's my turn👻
@@XINgalaxy Army💜🤣
Mine too 🤝
And mine is today after 1 hour 🙃🙂
There was a mistake from g(2, {4}) to g(4, {4})..The solutions are g(2, {4}) = 18, g(3, {2}) = 18, g(3, {4}) = 20, g(4, {2}) = 13, g(4, {3}) = 15
👍
Yeah!, I was thinking the same thing.
@@abdul_bari No problem. Your students can easily overcome minor mistakes. At the end of the day " we are your student ".
thanks bhai i was confused with this one
Yes i also noticed
Sir, you are a great teacher . Your explanation is excellent . wish you all the best and you live long with sound health . Thanks.
For those wondering what makes this a DP solution:
Basically instead of finding all permutations. and then doing the arithmetic, IE, instead of doing min(1->2->3->4, 1->2->4->3, ...) of all possible routes, we can see that there are repetitive calculations in 1->2->3->4 and 1->2->4->3 for instance. The route 1->2 is common(overlap) to routes 1->2->3->4 and 1->2->4->3, if you looked at the tree closely.
By definition of DP, we are trying all possibilities and we also see overlapping subproblems!
thank you
@vendettaaaa666 So essentially all this is, is caching distances into a giant lookup table? That still seems very complexity-demanding to solve this problem.
@@kevintyrrell7409 it is NP-Hard afterall
@@kevintyrrell7409 at least we're eliminating the computational redundancy while reaching each possibility
I think we are overlapping because we don't know from which direction path cost is minimum. If both sided path would be same then that approach will not be more good.
Simply outstanding! Doesn't get better than this.
All the best for tomorrow's exam 😂 👍
The way of teaching is like bottom up approach - first solve , then derive algorithm !
Great videos - all of them : )
You the best in explaining these tough algorithms in an layman language. Thank you sir!!
th-cam.com/video/K3rYJYi2geE/w-d-xo.html
Sir
one thing I've to tell you !
Watched all of your videos for 3 times or atleast 2 times perfectly
and It's just because of you , today I was confidently able to write the DAA Exam under JNTU-H
Thank You so much Sir !
Really lovely explantions !
and I hope you create some more videos on other Computer Subjects
Sir , you were known to whole of our College and you were the one who have helped almost 450 students in our college
Once again Hats Off to you Sir !
NOT ONLY YOUR COLLEGE!
HE IS HELPFULL FOR EVERY COLLEGE STUDENT PURSUING BTECH IN CSE.
pass hua?
Profesor Bari, you surprise me all the time, are you Magic? i have just come from another video and i could not understand what he was saying but within the first two minutes and 30 seconds here i already understand the problem... thank you
Sir as you took g(2, {3}) =15 then all the remaining will be also like same..... But you wrote g(2, {4}) =8 it will be 18 na, and g(3, {2}) =5 but 18....g(3, {4}) =20, g(4, {2}) =13, g(4, {3}) =15.....na?
Yes bro , he had written wrong
I was also confused
All are saying well explained sir but one is observing the mistakes
This Channel deserves more subscribers and views
He is teaching for the sake of TEACHING..and unlike others not asking for Like, Share And Subscribe 🙏🙏🙏🙏
If someone asks for like, share and Subscribe, there's nothing wrong. They need to fill their stomach to actually teach. Really D*m* take by you.
I think you mean love. Sake usually implies he's doing it because he has to not because he wants to.
also incorrectly
11:23 forward has some mistakes, but thanks for the video. I kinda understand
Our college teachers became teachers because they didn't get placement 😀 . and this person became teacher because of his interest. The difference can be seen 😁 clearly
Teacher is at another level 🤩👏🏼 now I can do it on my own..thank you sir
thank you sir finally I understand how to solve this types of problem ....😊
Daa exam is tommorow ... i am here 😂
Our teachers are watches your videos sir before teaching a lecture
Me, who Today having DAA exam😂
Same dude 😂
Your lectures helped me to pass in my examinations 🙏
nee thooti potti machu
You know you will top when sir abdul bari is there. Thx sir
Watching this a night before ADA exam . Wish me luck
The best teacher in the world
You are
doing a great help to students like us sir... huge repect
Sir your videos are too good and easy to understand... I studied from your algorithm Playlist only... You're a saviour... Thanks a ton!!!
Tomorrow DAA exam....my DAA mam is a waste...thought me nothing but how to pluck the hair........thankyou for explaining sir
Awesome sir.....I'm in DAA semester exam's previous day, I'm blank about DAA, but after seen your all videos I'm very much cleared and having hope i will pass in exam👏👏👏👏👏 Hat's of sirG
did you pass? I have DAA tomorrow, asking for a friend
@@nanduugee I have daa exam tomorrow what should do. To pass
@@nanduugee there is no waY TO pass by watching his video, i got failed , i had watched his video 100 times but still not cleared
Simple and easy explanation nice 😊we are easily understanding u r simply way ☺️
thank yoou so much sir you make feel like a superman
Bahut acche se samaj me aaya sir... Thank you...
Even my subject faculty is watching your videos to take classes for us sir😂😂
This is morning 5 am and today is daa exam but I'm ok daa easy and his lectures are very useful ❤😊
I'm pass this exam tq soo much sir 👏😍
Tomorrow is college exam very thank you.
Akgec....
Thank you sir understood this very clearly. Except for that small mistake of g(2,{4}) everything is explained well and fine. ⚡
Tomorrow DAA exam , very thanks😊
Super thalaiva❤🎉
🎉
I have DAA EXAM TOMORROW THANK YOU
Sir,
Thank you for a great explanation! I have a question. For g(2, {3}) we have 15, but then should not g(2, {4}) = 18, g(3, {2}) = 18, g(3, {4}) = 20, g(4, {2}) = 13, g(4, {3}) = 15?
Thank you
You are crt bro
correct bro
@@vijaykumarRC1215 🥕
I think there is mistake in this problem sir, but the way you teaching students can easily find that error😍
Sir you are great sir, this help me lot in #DAA exam 🙏🙏🔥
I should have watched this in regular of my examination 😩
Now I can pass my exam 😃
No one is perfect , but that mistake screwed up my solution.... Well i found a helpful guy who gave the correct values...
Guys like me will get into depression if our answers don't match, so thanks to that guy....
Tomorrow is daa exam tq sir ❤
MashaAllah beautifully explained sir. Thanks for uploading such a great lecture.
#Balochistan
praise to mulla allah
@@baal1297 I didn't get.
Abdul Sir you are the best! 🙏🏽
Sir u r teaching very useful for me tq so much and this TSP it has 1 small mistake g(2,{3} )=15 but g(2,{4})=18, g(3,{2})=18and so on... But u just consider only 1vetex only that is mistake
Super explain sir thanks for wonderful information for tsp
One big alumni network in the comments😂. Great explanation, thanks sir!
You make the subject very easy sir.
Thank you so much.
i was searching for this nice explaination
sir u messed up near the intermediate part where there is 1 remaining vertex as in ... g(2,{3}) ..... to ..... g(4,{3}) ....
but it is a good explanation ... thank you
Excellent teaching ❤
This is extremely useful. Thanks a lot!
time duration 11:14, I am little bit confused Sir at this point And the rest of it is very much helpful.
Best explanation i've seen.
bari mama mass. I fan u. Khuda Haafiz
Tomorrow Ada exam
Thanks 👍
Thank u ji.. For helping before exam day..❤❤nice teaching skills saab
To me it looks like Recursion problem instead of Dynamic Programming. Can someone explain, how DP is used here, there is no optimal substructure here.
It is finding the shortest route for one node in step one, for 2 node in the second step and so on..
Recursion is brute force, DP means eliminating a path as you calculate the minimal cost at each step.
th-cam.com/video/K3rYJYi2geE/w-d-xo.html
@@pkhris th-cam.com/video/K3rYJYi2geE/w-d-xo.html
@@AmitKumar-tw1sj th-cam.com/video/K3rYJYi2geE/w-d-xo.html
Tomorrow day exam mama ..thanks 👍
It is concept of discrete Mathematics and Graph Theory?
Sir wonderful explaination.hats off sir😍😍
NICE SUPER EXCELLENT MOTIVATED
Today DAA Exam.
Thanks ❤
Great explanation, thank you sir i got clarity on this problem, but there is a little problem:
10:30, I think he wrote number "1" not number "4" since he said "start from vertex 2 to nowhere -> return vertex 1" -> so his answer is g(2,{1}) =5.
I have misled as well, but I listen to him carefully so maybe we are misled at this point.
11:28, g(2,{4}) = 18 not 8 (Cause g(4,1) = 8 + g(2, 4) = 10 -> 18), and the continuous answer is similar to Mr. @kennethi.e answer.
Sir, promise me you'll never delete these videos! These are great for references even when I'm 30
Edit: We have exam tomorrow with students of about 20sec*60 = 1200 students watch your videos this entire day like me :-)
gitam,visakhapatnam sir..
@@pranavigogireddy9859 here you go!! Told you there will many people watching it.. 2 out of 1200
Thank you sir i gave exam today for algorithm and my exam was good thnx to you
Sir, I believe Dynamic Programming is an improvement over Brute Force, although approach is similar. But in this particular example, I can't find any improvement, it looks exactly Brute Force. My question is what is the difference between Brute Force and Dynamic P, if we solve this problem using both?
Good question. I also don't see any improvement of using dynamic programming in this case.
This is already a little smaller than the brute force. Brute force is O(n!) which means the table would have 24 entries. He doesn't work the last 3 entries for his table, but there are 15 total. This improvement gets more dramatic as the problem increases in size.
memory..i guess
I appreciate the fact that you used salesperson instead of salesman. It is 2021 we don't assume genders.
Masha Allah your teaching very nice sir...,
at 8:51 as well as at 9:49, why 'k' is being subtracted?
sir i love your teaching method
U teach very well sir no doubt ...bt best thing what i found is tha u take examples from text book ...it makes very easy to understand us the concept
Sir does A Matrix is given in the question paper
Today Daa exam thanks
Sir g(2,{3})= is 6 right how come 15
Thanks slot sir I really feel very happy after seeing u r videos it's really awesome I learned alot tqqqqqqqqq so Much
Very excellent thank you your valuable team
g(2,{3})=15
started from the bottom, now we're here...
Lmao
So this is pretty much the same as the multistage graph problem? The algorithm starts finding out minimum costs from the end towards the starting point. The only difference is instead of having a table saving the shortest path to the next node, we have have all the combinations as some sort of list
Ye toh abdul baari hai.. Ye to accha baccha hai.. Ye duaae sithkaa hai.. Acchi baate bataata hai.
To aao, chalo sikhe abdul baari ke sanng..
Thank you sir for wonderful explanation
Sir padhai khtm krne ka shortest path nikalne k liye koi algorithm hai kya sir 😢😢
Hii sir,
11:12 the cost g(2,{3}) is 6
7:55 DYNAMIC PROGRAMMING approach
Nice work with cool explaination
great explanation but it could have been awsome if algorithm would have explained with any code (C/C++)
thanks alot. it was so helpful🙏🏻🙏🏻🙏🏻
Really nice explanation sir.
Great Videos Sir!! Really helps a lot.
Thank you so much Sir,
Tomorrow DAA Exam Ajeenkya DY Patil University
Thank you❤
Can we expect TSP problem with branch and bound.
please share the link if you have done it before.
th-cam.com/video/1FEP_sNb62k/w-d-xo.html
Sir I want to ask if there is infinity in the matrix then what cost will be considered in the tree for that
Tq sir I cleared my subject
اول محاضرة خوارزميات عند حسن معيدي
very good! thorough explanation
10
Analyze the minimum cost tour for given problem in travelling sales person
Concepts by using dynamic programming.