4.7 Traveling Salesperson Problem - Dynamic Programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ธ.ค. 2024

ความคิดเห็น • 616

  • @abhishekvarma3673
    @abhishekvarma3673 4 ปีที่แล้ว +887

    Tomorrow DAA exam very Thanks 😊

    • @CellerCity
      @CellerCity 2 ปีที่แล้ว +38

      Lol 😂. It's my turn now

    • @sudhanshusharma6700
      @sudhanshusharma6700 2 ปีที่แล้ว +50

      Today DAA exam in 1 hr😌

    • @XINgalaxy
      @XINgalaxy 2 ปีที่แล้ว +7

      @@CellerCity haha now it's my turn👻

    • @justjukebox
      @justjukebox 2 ปีที่แล้ว +5

      @@XINgalaxy Army💜🤣
      Mine too 🤝

    • @AKASHRAJ-xs5ed
      @AKASHRAJ-xs5ed 2 ปีที่แล้ว

      And mine is today after 1 hour 🙃🙂

  • @kennethi.e
    @kennethi.e 6 ปีที่แล้ว +1951

    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

    • @karthikpallikonda8922
      @karthikpallikonda8922 6 ปีที่แล้ว +17

      👍

    • @xit
      @xit 5 ปีที่แล้ว +63

      Yeah!, I was thinking the same thing.

    • @xit
      @xit 5 ปีที่แล้ว +120

      @@abdul_bari No problem. Your students can easily overcome minor mistakes. At the end of the day " we are your student ".

    • @arjunguleria2318
      @arjunguleria2318 5 ปีที่แล้ว +31

      thanks bhai i was confused with this one

    • @dayakarp631
      @dayakarp631 5 ปีที่แล้ว +4

      Yes i also noticed

  • @mdrukonuzzaman8347
    @mdrukonuzzaman8347 6 ปีที่แล้ว +51

    Sir, you are a great teacher . Your explanation is excellent . wish you all the best and you live long with sound health . Thanks.

  • @Vendettaaaa666
    @Vendettaaaa666 4 ปีที่แล้ว +135

    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!

    • @vibhavrathee6788
      @vibhavrathee6788 3 ปีที่แล้ว +1

      thank you

    • @kevintyrrell7409
      @kevintyrrell7409 3 ปีที่แล้ว +4

      @vendettaaaa666 So essentially all this is, is caching distances into a giant lookup table? That still seems very complexity-demanding to solve this problem.

    • @harsh3948
      @harsh3948 2 ปีที่แล้ว +6

      @@kevintyrrell7409 it is NP-Hard afterall

    • @sbtopzzzlg7098
      @sbtopzzzlg7098 2 ปีที่แล้ว +3

      @@kevintyrrell7409 at least we're eliminating the computational redundancy while reaching each possibility

    • @deepak-ly3ob
      @deepak-ly3ob ปีที่แล้ว

      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.

  • @wentworthmiller1890
    @wentworthmiller1890 6 ปีที่แล้ว +37

    Simply outstanding! Doesn't get better than this.

  • @prasathmsd0760
    @prasathmsd0760 7 หลายเดือนก่อน +27

    All the best for tomorrow's exam 😂 👍

  • @aayushagarwal5666
    @aayushagarwal5666 6 ปีที่แล้ว +29

    The way of teaching is like bottom up approach - first solve , then derive algorithm !
    Great videos - all of them : )

  • @bswethar
    @bswethar 4 ปีที่แล้ว +18

    You the best in explaining these tough algorithms in an layman language. Thank you sir!!

    • @newsanalysis4831
      @newsanalysis4831 ปีที่แล้ว

      th-cam.com/video/K3rYJYi2geE/w-d-xo.html

  • @reddyr4420
    @reddyr4420 6 ปีที่แล้ว +54

    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 !

    • @ratanupadhyay9497
      @ratanupadhyay9497 6 ปีที่แล้ว +6

      NOT ONLY YOUR COLLEGE!
      HE IS HELPFULL FOR EVERY COLLEGE STUDENT PURSUING BTECH IN CSE.

    • @RyanMJohn-xw6bh
      @RyanMJohn-xw6bh ปีที่แล้ว

      pass hua?

  • @wycliffeottawa7998
    @wycliffeottawa7998 10 หลายเดือนก่อน +2

    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

  • @Sandhya-wd8jg
    @Sandhya-wd8jg ปีที่แล้ว +15

    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?

    • @bolimeradinesh2638
      @bolimeradinesh2638 8 หลายเดือนก่อน +8

      Yes bro , he had written wrong
      I was also confused
      All are saying well explained sir but one is observing the mistakes

  • @OneT0One
    @OneT0One 3 ปีที่แล้ว +2

    This Channel deserves more subscribers and views

  • @onlinesocialworld7504
    @onlinesocialworld7504 4 ปีที่แล้ว +60

    He is teaching for the sake of TEACHING..and unlike others not asking for Like, Share And Subscribe 🙏🙏🙏🙏

    • @mysticlunala8020
      @mysticlunala8020 2 ปีที่แล้ว

      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.

    • @ActuallyAudacity
      @ActuallyAudacity ปีที่แล้ว +3

      I think you mean love. Sake usually implies he's doing it because he has to not because he wants to.

    • @shauryaverma292
      @shauryaverma292 ปีที่แล้ว

      also incorrectly

  • @Jean-yk9eo
    @Jean-yk9eo 4 ปีที่แล้ว +13

    11:23 forward has some mistakes, but thanks for the video. I kinda understand

  • @ravipaliwal9726
    @ravipaliwal9726 ปีที่แล้ว +28

    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

  • @abhiyaanand8689
    @abhiyaanand8689 ปีที่แล้ว +3

    Teacher is at another level 🤩👏🏼 now I can do it on my own..thank you sir

  • @aditnigam8281
    @aditnigam8281 6 ปีที่แล้ว +27

    thank you sir finally I understand how to solve this types of problem ....😊

  • @it_is_Mighty
    @it_is_Mighty 3 หลายเดือนก่อน +8

    Daa exam is tommorow ... i am here 😂

  • @tushar_pawar040
    @tushar_pawar040 ปีที่แล้ว +1

    Our teachers are watches your videos sir before teaching a lecture

  • @saisurya1723
    @saisurya1723 6 หลายเดือนก่อน +21

    Me, who Today having DAA exam😂

  • @thanujasrinivas504
    @thanujasrinivas504 4 ปีที่แล้ว +4

    Your lectures helped me to pass in my examinations 🙏

  • @KingKhan-bi7kb
    @KingKhan-bi7kb 5 ปีที่แล้ว +2

    You know you will top when sir abdul bari is there. Thx sir

  • @darthashpie
    @darthashpie 5 ปีที่แล้ว +5

    Watching this a night before ADA exam . Wish me luck

  • @ihebbendebba2978
    @ihebbendebba2978 4 ปีที่แล้ว

    The best teacher in the world

  • @ayan1751
    @ayan1751 2 ปีที่แล้ว +3

    You are
    doing a great help to students like us sir... huge repect

  • @sanyam188
    @sanyam188 5 ปีที่แล้ว +9

    Sir your videos are too good and easy to understand... I studied from your algorithm Playlist only... You're a saviour... Thanks a ton!!!

  • @BhuvaaneshRajeswaran
    @BhuvaaneshRajeswaran ปีที่แล้ว +1

    Tomorrow DAA exam....my DAA mam is a waste...thought me nothing but how to pluck the hair........thankyou for explaining sir

  • @sankarkuppu5031
    @sankarkuppu5031 5 ปีที่แล้ว +22

    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

    • @nanduugee
      @nanduugee 2 ปีที่แล้ว

      did you pass? I have DAA tomorrow, asking for a friend

    • @akshatkatal7055
      @akshatkatal7055 2 ปีที่แล้ว

      @@nanduugee I have daa exam tomorrow what should do. To pass

    • @thecreativemind...1104
      @thecreativemind...1104 ปีที่แล้ว

      @@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

  • @Soniya0715
    @Soniya0715 ปีที่แล้ว

    Simple and easy explanation nice 😊we are easily understanding u r simply way ☺️

  • @Manisci3
    @Manisci3 6 หลายเดือนก่อน +1

    thank yoou so much sir you make feel like a superman

  • @bhushankumarkhade2985
    @bhushankumarkhade2985 2 ปีที่แล้ว

    Bahut acche se samaj me aaya sir... Thank you...

  • @babuprasadr4205
    @babuprasadr4205 ปีที่แล้ว +1

    Even my subject faculty is watching your videos to take classes for us sir😂😂

  • @itsme-sm9jp
    @itsme-sm9jp 6 หลายเดือนก่อน

    This is morning 5 am and today is daa exam but I'm ok daa easy and his lectures are very useful ❤😊

  • @harininuthalakanti8256
    @harininuthalakanti8256 ปีที่แล้ว

    I'm pass this exam tq soo much sir 👏😍

  • @abhay_Awasthicarguy7777
    @abhay_Awasthicarguy7777 2 ปีที่แล้ว +2

    Tomorrow is college exam very thank you.

  • @StarkPlayz
    @StarkPlayz 5 ปีที่แล้ว +16

    Thank you sir understood this very clearly. Except for that small mistake of g(2,{4}) everything is explained well and fine. ⚡

  • @NagendraReddy-n5y
    @NagendraReddy-n5y ปีที่แล้ว

    Tomorrow DAA exam , very thanks😊

  • @LogeshRaj-st6wk
    @LogeshRaj-st6wk 2 หลายเดือนก่อน +1

    Super thalaiva❤🎉
    🎉

  • @jayadeepnandigam8921
    @jayadeepnandigam8921 หลายเดือนก่อน

    I have DAA EXAM TOMORROW THANK YOU

  • @isaaca3849
    @isaaca3849 6 ปีที่แล้ว +27

    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

  • @dogmanvfx
    @dogmanvfx 2 ปีที่แล้ว +1

    I think there is mistake in this problem sir, but the way you teaching students can easily find that error😍

  • @sulemanali4023
    @sulemanali4023 3 ปีที่แล้ว +3

    Sir you are great sir, this help me lot in #DAA exam 🙏🙏🔥

  • @Pleiades_Ayesha
    @Pleiades_Ayesha 3 ปีที่แล้ว +1

    I should have watched this in regular of my examination 😩
    Now I can pass my exam 😃

  • @niceguy9048
    @niceguy9048 4 ปีที่แล้ว

    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....

  • @yashugaming_yt8089
    @yashugaming_yt8089 ปีที่แล้ว +1

    Tomorrow is daa exam tq sir ❤

  • @bilalchandio1
    @bilalchandio1 5 ปีที่แล้ว +11

    MashaAllah beautifully explained sir. Thanks for uploading such a great lecture.
    #Balochistan

    • @baal1297
      @baal1297 4 ปีที่แล้ว

      praise to mulla allah

    • @bilalchandio1
      @bilalchandio1 4 ปีที่แล้ว

      @@baal1297 I didn't get.

  • @yesumashi9433
    @yesumashi9433 3 ปีที่แล้ว

    Abdul Sir you are the best! 🙏🏽

  • @kiruthigav6704
    @kiruthigav6704 6 ปีที่แล้ว +6

    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

  • @YuvaKishorefacts
    @YuvaKishorefacts หลายเดือนก่อน +1

    Super explain sir thanks for wonderful information for tsp

  • @adarshbalachandar8680
    @adarshbalachandar8680 7 หลายเดือนก่อน

    One big alumni network in the comments😂. Great explanation, thanks sir!

  • @himareddy3240
    @himareddy3240 4 ปีที่แล้ว +1

    You make the subject very easy sir.
    Thank you so much.

  • @46-shabnambashir50
    @46-shabnambashir50 2 ปีที่แล้ว

    i was searching for this nice explaination

  • @avisekmondal441
    @avisekmondal441 3 ปีที่แล้ว

    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

  • @ManurManasa
    @ManurManasa ปีที่แล้ว

    Excellent teaching ❤

  • @dvddisk
    @dvddisk 11 หลายเดือนก่อน

    This is extremely useful. Thanks a lot!

  • @capitallaterA
    @capitallaterA 6 ปีที่แล้ว

    time duration 11:14, I am little bit confused Sir at this point And the rest of it is very much helpful.

  • @kalp2586
    @kalp2586 6 ปีที่แล้ว +7

    Best explanation i've seen.

  • @ParQuik
    @ParQuik ปีที่แล้ว +1

    bari mama mass. I fan u. Khuda Haafiz

  • @gani_yt
    @gani_yt ปีที่แล้ว +1

    Tomorrow Ada exam
    Thanks 👍

  • @02andrewedwiny14
    @02andrewedwiny14 5 ปีที่แล้ว

    Thank u ji.. For helping before exam day..❤❤nice teaching skills saab

  • @easycodingconcepts6642
    @easycodingconcepts6642 4 ปีที่แล้ว +24

    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.

    • @AmitKumar-tw1sj
      @AmitKumar-tw1sj 3 ปีที่แล้ว +3

      It is finding the shortest route for one node in step one, for 2 node in the second step and so on..

    • @pkhris
      @pkhris 2 ปีที่แล้ว +2

      Recursion is brute force, DP means eliminating a path as you calculate the minimal cost at each step.

    • @newsanalysis4831
      @newsanalysis4831 ปีที่แล้ว

      th-cam.com/video/K3rYJYi2geE/w-d-xo.html

    • @newsanalysis4831
      @newsanalysis4831 ปีที่แล้ว

      ​@@pkhris th-cam.com/video/K3rYJYi2geE/w-d-xo.html

    • @newsanalysis4831
      @newsanalysis4831 ปีที่แล้ว

      ​@@AmitKumar-tw1sj th-cam.com/video/K3rYJYi2geE/w-d-xo.html

  • @jarajapubhanuprakash2476
    @jarajapubhanuprakash2476 ปีที่แล้ว

    Tomorrow day exam mama ..thanks 👍

    • @pradeepninganuri7939
      @pradeepninganuri7939 ปีที่แล้ว

      It is concept of discrete Mathematics and Graph Theory?

  • @pspkfan9913
    @pspkfan9913 6 ปีที่แล้ว +4

    Sir wonderful explaination.hats off sir😍😍

  • @ganeshjaggineni4097
    @ganeshjaggineni4097 ปีที่แล้ว +1

    NICE SUPER EXCELLENT MOTIVATED

  • @SrinivasReddyReddy-tf5ho
    @SrinivasReddyReddy-tf5ho 10 หลายเดือนก่อน

    Today DAA Exam.
    Thanks ❤

  • @Nam_David
    @Nam_David 8 หลายเดือนก่อน

    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.

  • @nikhilb3880
    @nikhilb3880 6 ปีที่แล้ว +12

    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 :-)

    • @pranavigogireddy9859
      @pranavigogireddy9859 6 ปีที่แล้ว +3

      gitam,visakhapatnam sir..

    • @nikhilb3880
      @nikhilb3880 6 ปีที่แล้ว +1

      @@pranavigogireddy9859 here you go!! Told you there will many people watching it.. 2 out of 1200

  • @chintan_rana
    @chintan_rana 6 ปีที่แล้ว

    Thank you sir i gave exam today for algorithm and my exam was good thnx to you

  • @dr.vinodkumarchauhan3454
    @dr.vinodkumarchauhan3454 6 ปีที่แล้ว +12

    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?

    • @jamesmufugi5316
      @jamesmufugi5316 3 ปีที่แล้ว +1

      Good question. I also don't see any improvement of using dynamic programming in this case.

    • @AdamHoelscher
      @AdamHoelscher 3 ปีที่แล้ว

      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.

    • @e_51_shubhamdebnath43
      @e_51_shubhamdebnath43 2 ปีที่แล้ว +1

      memory..i guess

  • @doso7139
    @doso7139 3 ปีที่แล้ว +5

    I appreciate the fact that you used salesperson instead of salesman. It is 2021 we don't assume genders.

  • @gulaamnabim822
    @gulaamnabim822 6 ปีที่แล้ว

    Masha Allah your teaching very nice sir...,

  • @milan_shah
    @milan_shah 4 ปีที่แล้ว +1

    at 8:51 as well as at 9:49, why 'k' is being subtracted?

  • @5sempart49
    @5sempart49 2 ปีที่แล้ว

    sir i love your teaching method

  • @BM-sc1pc
    @BM-sc1pc 6 ปีที่แล้ว

    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

  • @suryanarayana161
    @suryanarayana161 หลายเดือนก่อน +1

    Sir does A Matrix is given in the question paper

  • @28-anishanne86
    @28-anishanne86 ปีที่แล้ว +1

    Today Daa exam thanks

  • @jayasuryak9551
    @jayasuryak9551 2 ปีที่แล้ว +2

    Sir g(2,{3})= is 6 right how come 15

  • @mythiliptv3490
    @mythiliptv3490 5 ปีที่แล้ว

    Thanks slot sir I really feel very happy after seeing u r videos it's really awesome I learned alot tqqqqqqqqq so Much

  • @IIBCARMTCIAcia
    @IIBCARMTCIAcia 2 ปีที่แล้ว

    Very excellent thank you your valuable team

  • @soloeditz7581
    @soloeditz7581 2 ปีที่แล้ว +1

    g(2,{3})=15

  • @agamersdiary1622
    @agamersdiary1622 3 ปีที่แล้ว +1

    started from the bottom, now we're here...

  • @Libertoso
    @Libertoso 4 ปีที่แล้ว +1

    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

  • @salilchincholikar
    @salilchincholikar 5 ปีที่แล้ว +13

    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..

  • @jayrajvardhan9906
    @jayrajvardhan9906 7 หลายเดือนก่อน

    Thank you sir for wonderful explanation

  • @biprodeepdas3593
    @biprodeepdas3593 ปีที่แล้ว +2

    Sir padhai khtm krne ka shortest path nikalne k liye koi algorithm hai kya sir 😢😢

  • @techgamerz498
    @techgamerz498 5 หลายเดือนก่อน

    Hii sir,
    11:12 the cost g(2,{3}) is 6

  • @corntheatre1398
    @corntheatre1398 4 หลายเดือนก่อน +1

    7:55 DYNAMIC PROGRAMMING approach

  • @akashreddyjammula3684
    @akashreddyjammula3684 4 ปีที่แล้ว

    Nice work with cool explaination

  • @gurpreettata
    @gurpreettata 6 ปีที่แล้ว +6

    great explanation but it could have been awsome if algorithm would have explained with any code (C/C++)

  • @golsocial4769
    @golsocial4769 3 ปีที่แล้ว

    thanks alot. it was so helpful🙏🏻🙏🏻🙏🏻

  • @jahanvikhedwal1107
    @jahanvikhedwal1107 4 ปีที่แล้ว

    Really nice explanation sir.

  • @aeshgupta5662
    @aeshgupta5662 6 ปีที่แล้ว +1

    Great Videos Sir!! Really helps a lot.

  • @ccmrshrdnt
    @ccmrshrdnt ปีที่แล้ว +2

    Thank you so much Sir,

  • @sanataniengineer4074
    @sanataniengineer4074 หลายเดือนก่อน +2

    Tomorrow DAA Exam Ajeenkya DY Patil University
    Thank you❤

  • @manojmuraboina6834
    @manojmuraboina6834 6 ปีที่แล้ว +12

    Can we expect TSP problem with branch and bound.
    please share the link if you have done it before.

  • @anantgupta6642
    @anantgupta6642 6 ปีที่แล้ว

    Sir I want to ask if there is infinity in the matrix then what cost will be considered in the tree for that

  • @talarikrishnamurthy3011
    @talarikrishnamurthy3011 3 ปีที่แล้ว

    Tq sir I cleared my subject

  • @محمدحادر-غ8م
    @محمدحادر-غ8م 2 หลายเดือนก่อน

    اول محاضرة خوارزميات عند حسن معيدي

  • @gahlyogu4570
    @gahlyogu4570 6 ปีที่แล้ว

    very good! thorough explanation

  • @jeevankumar8139
    @jeevankumar8139 ปีที่แล้ว

    10
    Analyze the minimum cost tour for given problem in travelling sales person
    Concepts by using dynamic programming.