4.7 Traveling Salesperson Problem - Dynamic Programming

Поделиться
HTML-код
  • Опубликовано: 21 фев 2018
  • 4.7 Traveling Salesman Problem - Dyn Prog -Explained using Formula
    • 4.7 [New] Traveling Sa...
    CORRECTION: while writing level 3 values, mistakenly I wrote 4 level values
    Travelling Salesperson problem is solved using Brute Force approach and Dynamic Programming
    PATREON : www.patreon.com/bePatron?u=20...
    Courses on Udemy
    ================
    Java Programming
    www.udemy.com/course/java-se-...
    Data Structures using C and C++
    www.udemy.com/course/datastru...
    C++ Programming
    www.udemy.com/course/cpp-deep...

Комментарии • 547

  • @abhishekvarma3673
    @abhishekvarma3673 3 года назад +600

    Tomorrow DAA exam very Thanks 😊

    • @AMAN-dt9ry
      @AMAN-dt9ry 2 года назад +26

      Lol 😂. It's my turn now

    • @sudhanshusharma6700
      @sudhanshusharma6700 2 года назад +41

      Today DAA exam in 1 hr😌

    • @Xingalaxy
      @Xingalaxy 2 года назад +6

      @@AMAN-dt9ry 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 5 лет назад +1683

    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 5 лет назад +13

      👍

    • @xit
      @xit 5 лет назад +50

      Yeah!, I was thinking the same thing.

    • @xit
      @xit 5 лет назад +107

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

    • @arjunguleria2318
      @arjunguleria2318 5 лет назад +27

      thanks bhai i was confused with this one

    • @dayakarp631
      @dayakarp631 5 лет назад +3

      Yes i also noticed

  • @Vendettaaaa666
    @Vendettaaaa666 4 года назад +117

    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 2 года назад +1

      thank you

    • @kevintyrrell7409
      @kevintyrrell7409 2 года назад +3

      @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 года назад +4

      @@kevintyrrell7409 it is NP-Hard afterall

    • @sbtopzzzlg7098
      @sbtopzzzlg7098 Год назад +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 5 лет назад +34

    Simply outstanding! Doesn't get better than this.

  • @ravipaliwal9726
    @ravipaliwal9726 Год назад +18

    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

  • @mdrukonuzzaman8347
    @mdrukonuzzaman8347 6 лет назад +44

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

  • @aditnigam8281
    @aditnigam8281 5 лет назад +27

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

  • @aayushagarwal5666
    @aayushagarwal5666 6 лет назад +26

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

  • @bswethar
    @bswethar 3 года назад +17

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

  • @onlinesocialworld7504
    @onlinesocialworld7504 3 года назад +49

    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

  • @reddyr4420
    @reddyr4420 6 лет назад +44

    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 5 лет назад +6

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

    • @RyanMJohn-xw6bh
      @RyanMJohn-xw6bh 7 месяцев назад

      pass hua?

  • @abhiyaanand8689
    @abhiyaanand8689 11 месяцев назад +3

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

  • @himareddy3240
    @himareddy3240 4 года назад +1

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

  • @ayan1751
    @ayan1751 Год назад +3

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

  • @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. ⚡

  • @kalp2586
    @kalp2586 6 лет назад +7

    Best explanation i've seen.

  • @Jean-yk9eo
    @Jean-yk9eo 4 года назад +9

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

  • @KingKhan-bi7kb
    @KingKhan-bi7kb 5 лет назад +2

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

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

  • @rishikakapoor6220
    @rishikakapoor6220 5 лет назад +1

    Great explanations!!
    thank you sir.

  • @sankarkuppu5031
    @sankarkuppu5031 4 года назад +21

    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 6 месяцев назад

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

  • @02andrewedwiny14
    @02andrewedwiny14 4 года назад

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

  • @wycliffeottawa7998
    @wycliffeottawa7998 4 месяца назад +1

    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

  • @pspkfan9913
    @pspkfan9913 6 лет назад +4

    Sir wonderful explaination.hats off sir😍😍

  • @thanujasrinivas504
    @thanujasrinivas504 3 года назад +4

    Your lectures helped me to pass in my examinations 🙏

  • @OneT0One
    @OneT0One 3 года назад +2

    This Channel deserves more subscribers and views

  • @galadesonne5643
    @galadesonne5643 5 лет назад +1

    Great explanation! Thx!

  • @darthashpie3370
    @darthashpie3370 5 лет назад +5

    Watching this a night before ADA exam . Wish me luck

  • @yesumashi9433
    @yesumashi9433 2 года назад

    Abdul Sir you are the best! 🙏🏽

  • @aeshgupta5662
    @aeshgupta5662 5 лет назад +1

    Great Videos Sir!! Really helps a lot.

  • @gahlyogu4570
    @gahlyogu4570 5 лет назад

    very good! thorough explanation

  • @dvddisk
    @dvddisk 5 месяцев назад

    This is extremely useful. Thanks a lot!

  • @mythiliptv3490
    @mythiliptv3490 4 года назад

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

  • @chintan_rana
    @chintan_rana 5 лет назад

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

  • @Sandhya-wd8jg
    @Sandhya-wd8jg Год назад +8

    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 2 месяца назад +2

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

  • @Soniya0715
    @Soniya0715 7 месяцев назад

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

  • @sulemanali4023
    @sulemanali4023 2 года назад +3

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

  • @bhushankumarkhade2985
    @bhushankumarkhade2985 Год назад

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

  • @dogmanvfx
    @dogmanvfx Год назад +1

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

  • @bilalchandio1
    @bilalchandio1 5 лет назад +10

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

    • @baal1297
      @baal1297 3 года назад

      praise to mulla allah

    • @bilalchandio1
      @bilalchandio1 3 года назад

      @@baal1297 I didn't get.

  • @46-shabnambashir50
    @46-shabnambashir50 Год назад

    i was searching for this nice explaination

  • @arjunsingharjunsingh1634
    @arjunsingharjunsingh1634 6 лет назад

    Best algorithms lecture

  • @ankk98
    @ankk98 6 лет назад +2

    Nice explanation sir
    Can you please make some videos on in depth explanation on making these general dp formulas and determining if we can apply dp in a particular problem?

  • @syedmahasibali2324
    @syedmahasibali2324 5 лет назад

    Well understood by this video
    Great ......

  • @gulaamnabim822
    @gulaamnabim822 5 лет назад

    Masha Allah your teaching very nice sir...,

  • @babuprasadr4205
    @babuprasadr4205 7 месяцев назад +1

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

  • @5sempart49
    @5sempart49 2 года назад

    sir i love your teaching method

  • @niceguy9048
    @niceguy9048 3 года назад

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

  • @ParveenSk-xt5rx
    @ParveenSk-xt5rx 3 года назад +1

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

  • @ihebbendebba2978
    @ihebbendebba2978 4 года назад

    The best teacher in the world

  • @prasenjitsaha5322
    @prasenjitsaha5322 5 лет назад

    Thanks a lot for these wonderful videos.

    • @prasenjitsaha5322
      @prasenjitsaha5322 5 лет назад

      You have very nice voice. It makes listening to you more enjoyable.

  • @PankajKumar-pf6sh
    @PankajKumar-pf6sh 6 лет назад +2

    Sir please make video on longest common subsequence

  • @fahmidaahmed6669
    @fahmidaahmed6669 5 лет назад

    much helpful....thanks sir.

  • @jahanvikhedwal1107
    @jahanvikhedwal1107 4 года назад

    Really nice explanation sir.

  • @shreyashachoudhary480
    @shreyashachoudhary480 2 года назад +1

    Really understandable.

  • @IIBCARMTCIAcia
    @IIBCARMTCIAcia Год назад

    Very excellent thank you your valuable team

  • @tushar_pawar040
    @tushar_pawar040 Год назад +1

    Our teachers are watches your videos sir before teaching a lecture

  • @gurpreettata
    @gurpreettata 6 лет назад +6

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

  • @Manisci3
    @Manisci3 8 дней назад +1

    thank yoou so much sir you make feel like a superman

  • @akashreddyjammula3684
    @akashreddyjammula3684 3 года назад

    Nice work with cool explaination

  • @ManurManasa
    @ManurManasa 7 месяцев назад

    Excellent teaching ❤

  • @yuninrju6213
    @yuninrju6213 5 лет назад

    awesome way to explain

  • @jayrajvardhan9906
    @jayrajvardhan9906 Месяц назад

    Thank you sir for wonderful explanation

  • @golsocial4769
    @golsocial4769 3 года назад

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

  • @chinnireddy8236
    @chinnireddy8236 5 лет назад

    Awesome teaching

  • @federickelvis247
    @federickelvis247 Год назад +2

    You saved me !!

  • @kiruthigav6704
    @kiruthigav6704 5 лет назад +5

    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

  • @a.mohamedkhalidmasood106
    @a.mohamedkhalidmasood106 2 года назад

    Jazak Allaahu khair...

  • @user-rv8yx3df9g
    @user-rv8yx3df9g 8 месяцев назад +1

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

  • @nikhilb3880
    @nikhilb3880 5 лет назад +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 5 лет назад +3

      gitam,visakhapatnam sir..

    • @nikhilb3880
      @nikhilb3880 5 лет назад +1

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

  • @Sarjiwan-zp1lx
    @Sarjiwan-zp1lx Месяц назад

    Today is my in evening and I'll watching this I the morning ❤

    • @Ujvall
      @Ujvall Месяц назад

      I dont understand can you repeat

  • @meaparadox5864
    @meaparadox5864 6 лет назад

    Great video sir

  • @itsme-sm9jp
    @itsme-sm9jp Месяц назад

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

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

  • @ccmrshrdnt
    @ccmrshrdnt Год назад +2

    Thank you so much Sir,

  • @ganeshjaggineni4097
    @ganeshjaggineni4097 Год назад +1

    NICE SUPER EXCELLENT MOTIVATED

  • @Libertoso
    @Libertoso 3 года назад +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

  • @fatihcenesiz9587
    @fatihcenesiz9587 5 лет назад

    you are making it from hard way

  • @PalukuriSuseela
    @PalukuriSuseela 7 месяцев назад

    Good explanation thank you sir

  • @suhailcool13111985
    @suhailcool13111985 5 лет назад

    Sir . So clear explanation . One doubt I have is in the formula you have used - {K}. Can you explain that with an example which has to be subtracted.

  • @diverseaspirants
    @diverseaspirants 6 лет назад

    Thank You So Much Sir..nice explanation SIr!!!

  • @priyankaraikwar9367
    @priyankaraikwar9367 6 лет назад +3

    Haslee - free .... U blessed me

  • @danishnabeel2101
    @danishnabeel2101 5 лет назад +1

    Can you make a video on inventory transshipment problem for individual retailers in the system ?

  • @maheshvangala8472
    @maheshvangala8472 5 лет назад

    Great lecture

  • @Sanatanabhishekaa28498
    @Sanatanabhishekaa28498 6 лет назад

    Please add video on travelling salesman using Branch and Bound method

  • @teacher-5293
    @teacher-5293 4 года назад

    Thank you so much sir

  • @harichandanareddy8199
    @harichandanareddy8199 6 лет назад

    Thank you sir....

  • @studioportable7639
    @studioportable7639 6 лет назад

    Thanks This is cool

  • @harininuthalakanti8256
    @harininuthalakanti8256 6 месяцев назад

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

  • @san9870
    @san9870 Год назад

    simply awesome

  • @efstathiosmolyvas1102
    @efstathiosmolyvas1102 6 лет назад +1

    Great!!!

  • @talarikrishnamurthy3011
    @talarikrishnamurthy3011 2 года назад

    Tq sir I cleared my subject

  • @abhay_Awasthicarguy7777
    @abhay_Awasthicarguy7777 Год назад +2

    Tomorrow is college exam very thank you.

  • @prateektalukdar4657
    @prateektalukdar4657 2 года назад +1

    Hello,
    I just saw your video on travelling sales man problem. I had another problem that is similar to this one, however we have the revenue at each location on a certain day and we want to travel through any combination of cities to figure out the maximum revenue possible. Do you have any suggestions on how I could solve this?

  • @edokohgodpls5239
    @edokohgodpls5239 4 года назад

    Thank you teacher

  • @lol-hz9mc
    @lol-hz9mc Год назад +1

    Thank u sir!!

  • @rohankottawar96
    @rohankottawar96 6 лет назад +2

    why dont you publish a book? awesome teaching

  • @rishabjain5890
    @rishabjain5890 6 лет назад +5

    You should explain time complexity with the help of algorithm. Overall it's was very good.

  • @librae-5664
    @librae-5664 10 месяцев назад +1

    사랑한다 선생님

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