4.7 [New] Traveling Salesman Problem - Dynamic Programming using Formula

  Рет қаралды 518,518

Abdul Bari

Abdul Bari

Күн бұрын

Пікірлер: 142
@Nex_Addo
@Nex_Addo 5 жыл бұрын
You are going to single-handedly get me through my algorithms course. It's so clear, almost obvious, when you explain these things, where seemed so murky when I first heard them. Very much appreciated.
@SadisticShade
@SadisticShade 5 ай бұрын
For my own reference: final path : {1,2,4,3,1}
@rohitkandula8493
@rohitkandula8493 11 ай бұрын
You are a divine god for me ,tomorrow i have exam learning today from ur channel😊✨🔥
@vishaladithya9703
@vishaladithya9703 2 жыл бұрын
thank you sir for your easy explanation. the topics which i felt hard in class, you explained it so understandable.
@mohammedadel8948
@mohammedadel8948 2 жыл бұрын
Thank you for your hard work.
@kinglygaurav
@kinglygaurav 4 жыл бұрын
@Abdul Bari What will be the time complexity of TSP when done this way? I am guessing Tabulation will reduce some amount of time but ultimately we are having to consider all possible routes from all possible vertices. Thus O(n!) correct?
@hughjanus5342
@hughjanus5342 9 ай бұрын
We love you sir!!!!
@absiddiq2623
@absiddiq2623 6 жыл бұрын
Awesome 👍🏻👏🏻
@jyotsnapriyadarshi8016
@jyotsnapriyadarshi8016 4 жыл бұрын
Sir please provide the code also for some of the algorithms of which code has not been provided .
@pranav288
@pranav288 3 жыл бұрын
be grateful
@mkhussain3099
@mkhussain3099 2 жыл бұрын
Cannot see overlapping sub problem
@youtubecr3115
@youtubecr3115 2 жыл бұрын
Exactly what I was wondering
@nayba100
@nayba100 8 ай бұрын
Where i can find the first formul that you used. Can you name your source please?
@pearlminestudios7568
@pearlminestudios7568 6 жыл бұрын
Sir, why don’t you swap this video into the playlist instead of the old one.
@Shivam-vr6eh
@Shivam-vr6eh 5 жыл бұрын
Abdul Bari Sir my question is Can we use that old video method for Salesman Problem using dynamic prog?
@ayasswain
@ayasswain 5 жыл бұрын
The best algorithm explaining teacher I have ever seen. Thanks Abdul Bari sir.
@niranjanreddy6334
@niranjanreddy6334 4 жыл бұрын
Abdul Bari sir I randomly landed in your page , after that I cant stop myself from binge watching all your Algo videos , your videos are amazing n Iam loving it
@unseenscenes3296
@unseenscenes3296 4 жыл бұрын
Algo ki sb videos dekh kr ke bol skte ke yr mera kafi had tk algorithm clear ho gya Mtlb fir me ja kr k codeforces wagera ki c type problems solve kr pao ga
@arpitaarpi7015
@arpitaarpi7015 4 ай бұрын
Dear sir, This semester is very short, 3 months approximately So our professor can't complete the whole syllabus But our college professor is referring your channel for learning You are awesome sir❤
@AnitShrestha
@AnitShrestha 5 жыл бұрын
Thank you. I found deriving the formula, than implementing one more effective. But it was nice to see the other way as well.
@souravkumarskb7131
@souravkumarskb7131 4 жыл бұрын
11:36 apke sath ek chota sa prank hua, camera ke saamne dekh ke smile karde
@sudhagbhat8226
@sudhagbhat8226 4 жыл бұрын
U r out of mind
@divyanshutripathy3484
@divyanshutripathy3484 4 жыл бұрын
@@sudhagbhat8226 He was just joking, don't take it seriously.
@s.a.h.q9389
@s.a.h.q9389 3 жыл бұрын
😂🔥
@asheeshmathur
@asheeshmathur 2 жыл бұрын
Good, is this part of some of your Udemy course. Please advise.
@theperennialbaker5264
@theperennialbaker5264 6 жыл бұрын
Awesome explanation Sir... 👍👌 Thanks alot... 💕
@pralaykumarlahiri3788
@pralaykumarlahiri3788 6 жыл бұрын
If in the source matrix, position [3,1] value we change it as value '0'. Then what should be the Path?
@Deepak-jk1eh
@Deepak-jk1eh 4 жыл бұрын
this video is much clear than previous one give a medal to this man
@vishalc832
@vishalc832 4 ай бұрын
00:01 Explaining the traveling salesman problem using dynamic programming formula. 02:15 The formula explains how to find the minimum cost for visiting the remaining vertices. 04:12 Finding the minimum value by using dynamic programming formula 06:06 Dynamic programming for solving traveling salesman problem 08:27 Discussing the recursive tree execution for solving the traveling salesman problem using dynamic programming. 10:27 Dynamic programming is done with tabular values. 12:43 Finding smallest values first using dynamic programming 14:47 The shortest route for the Traveling Salesman Problem using Dynamic Programming is 35.
@vakhariyajay2224
@vakhariyajay2224 2 жыл бұрын
Thank you very much. You are a genius. 👍👍🔝🔝🙏🙏👌👌
@mohammedkhan7029
@mohammedkhan7029 8 ай бұрын
kya yaaro chale jaate aisich class se sikhaana chodhke unsubscribe dislike
@Wizzy404
@Wizzy404 7 ай бұрын
you the GOAT at this.
@VijayKumar-tt6tj
@VijayKumar-tt6tj 4 жыл бұрын
Sir, I'm a great fan of your videos, You make things really easy for us no matter how complex the problem statement is. Since the time complexity of this algorithm is not polynomial, AFAIK we can just find the MST (Minimum Spanning Tree) and can add the Cost from last vertex to the source to the final result. This way we can have only O(E log V) complexity? Please correct me if i'm wrong?
@aronquemarr7434
@aronquemarr7434 4 жыл бұрын
You cannot revisit a city in the standard travelling salesman problem.
@devashreerane4867
@devashreerane4867 6 жыл бұрын
Hello Sir, Which reference or standard book is preferred for referring algorithms ?
@anmol4893
@anmol4893 3 жыл бұрын
Introduction to algorithm by comren
@aparnasai9641
@aparnasai9641 Ай бұрын
Very nice explanation sir super super
@vipinkumartripathi5022
@vipinkumartripathi5022 3 жыл бұрын
what's the use of making table.....I mean what optimization we are achieving by using dp
@diegochicurel4724
@diegochicurel4724 6 ай бұрын
It would have been nice if he showed the table at the end. But basically, you start from the bottom and fill the values in the table, then you don’t need to do recursion or anything else, just fill the table and check if the values are already defined (they will if we do it this way)
@sarfarazbaig1898
@sarfarazbaig1898 6 жыл бұрын
I got more benefits by learning from this video,it is very nice video👌.
@shaikobaid3528
@shaikobaid3528 5 жыл бұрын
Really satisfying 👌
@wirito
@wirito 4 жыл бұрын
Professor, I asked you this in a different video but I have noticed the following: If I click on your course for data structure, it sends me to Udemy with a price of $10 which is correct but it clearly says that this offer is for “new students only”. Since I already have an account, as soon as I log in the price goes up. I could create a new account with a different email but I am hoping you can look into this. I have also noticed that at random times on different days, the offer is different. Sometimes is $170, other times is $90, or $19 etc. I don’t believe the offer will be $10 during thanksgiving promotion as you stated. But even if it is, please let me know if the only option for me is to create a new account so that I can pay the $10. I am a college student and while I could pay $20 (which is what it goes up to when I log in if the offer is $10) I am suffering from greedy syndrome. You see, since you have already advertised it as $10 then I only want to pay $10 :). That’s how greedy algorithm works professor! I can’t go on paying $20 when there clearly is a lower weight Lol Please let me know!
@starattaker4803
@starattaker4803 Жыл бұрын
At -5:41 jo pachak hua , sir kehte ye method to lamba hai ye nahi karna 😭 yaar ek din pehle padhrai aur ye dekhne ko mile , LOL ho gaya 😂
@josephsylvan6511
@josephsylvan6511 4 жыл бұрын
what's the time complexity of this algorithm?
@basujayanta1
@basujayanta1 4 жыл бұрын
If there are more vertices present, say 6, then this algorithm becomes almost too huge to handle and cumbersome!!!
@tanushreeagarwal4151
@tanushreeagarwal4151 3 жыл бұрын
it is appearing so but see from computer's perspective ..when we gonna program then its just A matter of a loop for controlling value of k.
@reddy6131
@reddy6131 4 ай бұрын
But u didn't say the shortest route
@vishalc832
@vishalc832 4 ай бұрын
Plot twist at 11:41
@aarzooshaikh2688
@aarzooshaikh2688 6 жыл бұрын
very good explanation sir.....guys watch him if u want to learn
@shivanshusuryakar8692
@shivanshusuryakar8692 3 жыл бұрын
we are already :)
@shanerelish3762
@shanerelish3762 Жыл бұрын
thank you so much for this video.. i was a little confused with the formula.. now i feel dumb for not understanding it before.. 😅
@fauguswanto6595
@fauguswanto6595 Жыл бұрын
Amazing content! Thank you !
@ashishg656
@ashishg656 4 жыл бұрын
Very good explanation, watched lot of videos :) Thanks a lot for such awesome content.
@valerian2768
@valerian2768 Жыл бұрын
Incredible Explanation!!
@srinivb1
@srinivb1 5 жыл бұрын
As usual AWESOME explanation by Abdul Bari sir. Kudos to you for explaining complex topics in easy and simple terms.
@GautamNishant
@GautamNishant 6 жыл бұрын
Thanks a lot SIR! very helpful :)
@dishasuresh4813
@dishasuresh4813 2 жыл бұрын
Can somebody give me the previous video on traveling salesman problem he is referring to please?
@pujithagaddale7171
@pujithagaddale7171 4 жыл бұрын
Sir can we do exactly in exam like drawing tree and writing remaining vertices???
@amanmanna8976
@amanmanna8976 3 жыл бұрын
Depends what type of pattern your university follows .....
@SRNR_PODCAST.
@SRNR_PODCAST. 3 жыл бұрын
a goldmine in youtube
@anandbaskaran
@anandbaskaran 2 жыл бұрын
In an iterative approach, you can simply solve it as you show in the tree diagram.
@abdullahmeo
@abdullahmeo 3 жыл бұрын
What about the return path - imagine u have the case where the return path for a vertex is shorter if we use an indirect route. Would you just run the algorithm backwards?
@ramaarahatekar1570
@ramaarahatekar1570 9 ай бұрын
so how and what are we supposed to write it in college university end exam? I mean, where do we start? Do we draw the tree with sample calculations or do we directly do calculations by formula?
@sohamghosh533
@sohamghosh533 3 ай бұрын
Do everything 😂😂
@rohitkandula8493
@rohitkandula8493 11 ай бұрын
The Man The Myth🫶🔥
@aditiranjan303
@aditiranjan303 3 жыл бұрын
What is the vedio no. For previous vedio on this topic as said by sir?
@basobpaulbrinta3198
@basobpaulbrinta3198 Жыл бұрын
how are we gonna use tabulation method for this one?
@bhargavakhani4921
@bhargavakhani4921 3 жыл бұрын
Sir can you please solve for s1=abbacdcba and s2=bcdbbcaac
@saksheegoel2654
@saksheegoel2654 4 жыл бұрын
Where is previous video sir? Tmw is my exam can you give the link ?
@talharashid7703
@talharashid7703 Жыл бұрын
Paatal Lok,s Jaideep Ahlawat.👍
@parulgupta179
@parulgupta179 6 жыл бұрын
Finally got it thanx
@anjaneyaagrawal1882
@anjaneyaagrawal1882 Жыл бұрын
algo bhi bata dete toh thek rahta..................hehehe
@vidyamkaushik8796
@vidyamkaushik8796 5 жыл бұрын
How to find the path?
@fatimamaj7964
@fatimamaj7964 2 жыл бұрын
Thanks for the tutorial. I would like to just add one note. Maybe it is better to go through tree as Depth-first search not Breadth-first search, because I think recursive algorithm use Depth-first Search.
@vaishnavikotapati3196
@vaishnavikotapati3196 2 жыл бұрын
Superb explanation Sir hatsoff🙏🙌🙌
@anjalian6314
@anjalian6314 2 жыл бұрын
Sir can you explain cutting plane algorithm
@nikhilkumarjamwal5322
@nikhilkumarjamwal5322 Жыл бұрын
Long but easy question with awesome explanation!💫
@inevitablegaming9365
@inevitablegaming9365 3 жыл бұрын
Saviour ❤️
@RohitKumar-xn8ez
@RohitKumar-xn8ez 4 жыл бұрын
Sir, why C[2][1] and C[1][2] have different values and similarly for others.
@justwanttoknow4621
@justwanttoknow4621 4 жыл бұрын
1st city se 2nd city jane pe Ola mili bro Aur 2nd se 1st jane pe uber Ab bhai jo mehnga h wo mehnga hai🙅‍♂🤷‍♂😛 Just kidding Actually they are predefined weights of path available for the salesperson. Suppose it like a two different root from going 1 location to another location. Assume each vertex as a city/country in the world and there are multiple paths for every city from another city. The available data is just the indication of the salesmen didn't choose the same path. Agra->Delhi Delhi->Agra There are multiple roads available for this Assume A(agra)(delhi) = 12 and A(delhi)(agra) = 13 Then the path for reaching delhi and returning back from there might be different. It's just given. Hope you got it.
@mona5711
@mona5711 6 ай бұрын
legendary thanks a lot!!
@atharva808
@atharva808 2 жыл бұрын
thank you sir thank you so much 🙏🙏🙏
@AnkitSoni-vm5od
@AnkitSoni-vm5od 6 жыл бұрын
Your algorithm lectures is really awesome....!!
@paulsnehasish5830
@paulsnehasish5830 3 жыл бұрын
how do you do the table without writing the recursion tree first? we have to write the recursion tree in order to know the later values
@Mansoor-qf3mw
@Mansoor-qf3mw 3 жыл бұрын
Watch few of his prev. videos on DP u will get it. In a table u don't find 'later' ones but 'previous' ones or from where the subprob came. Actually if u find the value of the smallest subproblem then u would be able to find the answer to thelarger subprob and so on.. Inshort u start from small and then form large.
@pavan7432--
@pavan7432-- 11 ай бұрын
11:37
@aroo1377
@aroo1377 3 жыл бұрын
Sir you are awesome.. Thank you
@nikitasinha8181
@nikitasinha8181 3 жыл бұрын
Thank you so much sir 👍👍👍🙏🙏🙏
@anjaneyaagrawal1882
@anjaneyaagrawal1882 Жыл бұрын
thank you very helpful
@ريماآلنزال
@ريماآلنزال 3 жыл бұрын
Please, I want an algorithm for this problem. I want to transfer it to program c # :( if you allow
@ريماآلنزال
@ريماآلنزال 3 жыл бұрын
Please help 🥺🥺
@SandeshMotoVlogs
@SandeshMotoVlogs 3 жыл бұрын
U will get it on gfg
@devanshmesson2777
@devanshmesson2777 4 жыл бұрын
Is it a bottom up approach?
@bhuppidhamii
@bhuppidhamii 9 ай бұрын
Thankyou sir
@SindyanCartoonJordanian
@SindyanCartoonJordanian 4 жыл бұрын
Thank you very much , May Allah bless you
@saisravani2625
@saisravani2625 3 жыл бұрын
Sir how do we do the table without writing the recursion tree first? we have to write the recursion tree in order to know the later values
@manishrai6845
@manishrai6845 3 жыл бұрын
simple find 2 to null three to null four to null then get the values similarly 2 to 3 2 to 4 then 3 to 2 and 3 to 4 etc . Or use the formula which he's given in the beggining of this video (g[i,s] one ).
@chaoluncai4300
@chaoluncai4300 2 жыл бұрын
@@manishrai6845 i think if using formula we have to do like a top down memoization dp, i can't think of a effective way for bottom-up dp yet, like how do we know the remaining set if starting from the bottom (from 2-> null etc.)?
@shahinpathan5705
@shahinpathan5705 4 жыл бұрын
It will be found in hindi
@saadbinkhalid4208
@saadbinkhalid4208 4 жыл бұрын
Thank you so much Sir. You make it really easy to grasp and apply these concepts. I am even doing your course on Udemy. Hope to see more of your content and your channel grow even vast. Best Wishes.
@nigadenagendrasunil8503
@nigadenagendrasunil8503 6 жыл бұрын
One Doubt! The formula you explained is for minimum spanning tree. I think you should explain the last condition when a set is empty we have to return distance from the last node to the starting node. Anyways, Its been great to watch your videos. Kudos to you!
@jDelicious___
@jDelicious___ 3 жыл бұрын
He did explain that
@pratikkumar6148
@pratikkumar6148 5 жыл бұрын
best playlist in algorithm cheers
@unseenscenes3296
@unseenscenes3296 4 жыл бұрын
Bhaiyaa ye series complete kr ne se algorithm ka kaafi part cover ho jye ga
@sonalgoje
@sonalgoje 6 жыл бұрын
You are awesome sir , it's very nice and clear explanation. 👏👏👏
@thefuntech2810
@thefuntech2810 5 жыл бұрын
Can we apply a dijikistra algo to find the path ...
@AdeshPaul
@AdeshPaul 4 жыл бұрын
No, because you've to traverse back to the source vertex.
@mfaraday4044
@mfaraday4044 4 жыл бұрын
thank you sir
@tushardalave4619
@tushardalave4619 4 жыл бұрын
Thank you sir
@kharouddavindersingh2237
@kharouddavindersingh2237 4 жыл бұрын
great explanation.
@abirpaul9027
@abirpaul9027 4 жыл бұрын
Best teacher for Algorithms
@abhishekjha1658
@abhishekjha1658 6 жыл бұрын
excellent explanation sir..... please explain the implementation of algorithm too...!
@ashishsinha8893
@ashishsinha8893 6 жыл бұрын
sir LCS problems I think u forget??
@rvranjan99
@rvranjan99 4 жыл бұрын
Great content and easy to understand.
@LocNguyen-mn4dd
@LocNguyen-mn4dd Жыл бұрын
thanks
@allenhung4390
@allenhung4390 4 жыл бұрын
awesome explanation!!!
@nurel882
@nurel882 4 жыл бұрын
Thank you
@yashaswinisyashu3861
@yashaswinisyashu3861 Жыл бұрын
🙏🙏🙏
@ankitgunjal1116
@ankitgunjal1116 2 жыл бұрын
11:07
@peasant12345
@peasant12345 Жыл бұрын
n 2^n?
@dimajangveladze3712
@dimajangveladze3712 3 жыл бұрын
Nice
@AdeshPaul
@AdeshPaul 4 жыл бұрын
Thanks.
@shriharrsha3541
@shriharrsha3541 2 жыл бұрын
.
@knoName5691
@knoName5691 6 жыл бұрын
superb :-) Thanks a lot sir :-)
4.8 Reliability Design - Dynamic Programming
26:32
Abdul Bari
Рет қаралды 391 М.
7.3 Traveling Salesman Problem - Branch and Bound
24:42
Abdul Bari
Рет қаралды 1,7 МЛН
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 21 МЛН
Worst flight ever
00:55
Adam W
Рет қаралды 27 МЛН
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Паша Осадчий
Рет қаралды 9 МЛН
4.7 Traveling Salesperson Problem - Dynamic Programming
15:25
Abdul Bari
Рет қаралды 1,5 МЛН
Fastest Way to Learn ANY Programming Language: 80-20 rule
8:24
Sahil & Sarra
Рет қаралды 867 М.
4.3 Matrix Chain Multiplication - Dynamic Programming
23:00
Abdul Bari
Рет қаралды 1,6 МЛН
4.5 0/1 Knapsack - Two Methods - Dynamic Programming
28:24
Abdul Bari
Рет қаралды 2,8 МЛН
Traveling Salesman Problem | Dynamic Programming | Graph Theory
20:28