Graphs: Dijkstra's Algorithm

  Рет қаралды 1,039,742

distanceedjohn

distanceedjohn

Күн бұрын

Пікірлер: 428
@kingofwebguru
@kingofwebguru 11 жыл бұрын
Short and easy to understand. Great job. Hate books that spend pages over pages that make you want to burn it all.
@thodap1
@thodap1 9 жыл бұрын
Excellent explanation, I just passed an exam because of this video, god bless you!
@ArwensarYunikoCreations
@ArwensarYunikoCreations 8 жыл бұрын
you explained 1 semester in 10 minutes
@dvorak2676
@dvorak2676 7 жыл бұрын
what school and what year ?? wtf
@ammadahmed8811
@ammadahmed8811 7 жыл бұрын
30 minutes of my Data Structures and Algorithms lectures. I think you belongs to mid of 20th Century
@Vrbik15
@Vrbik15 7 жыл бұрын
fuck your school then
@tianyuchen1802
@tianyuchen1802 7 жыл бұрын
We just explained that for 30 minutes,elps...
@ashishnegi3848
@ashishnegi3848 7 жыл бұрын
is it so?? advanced? we are studying this in our 3rd sem and it comes of only 8-10 marks...it's an average level of problem.
@GtaRockt
@GtaRockt 9 жыл бұрын
thank you! My Uni professor just explained this in such a complicated way.. and you do it within 10 minutes in such an easy way! you are the best, I love you.
@Athanazeus
@Athanazeus 11 жыл бұрын
that's how you squeeze an hour of course into 10 mins
@me-zb7qm
@me-zb7qm 6 жыл бұрын
This video is more than 10 years old, yet still so useful. Going into exams with more confidence after watching your explanation, thank you!
@Vineyverma
@Vineyverma 10 жыл бұрын
Very well explained. Explaining complex things so easy is really an art. You are an artist. Thank you and Good wishes to you.
@joetron5114
@joetron5114 12 жыл бұрын
This is the best explanation for Dijkstra's that I have seen on the net. I was having a hard time with this algorithm until I saw it explained like this. It helped me finish my project. Perfect!
@euclid9492
@euclid9492 2 жыл бұрын
This one was very helpful. The other video I watched gave me the impression we chose the new vertex from the list of unvisited adjacent vertices because the graphs were too simple. This one was complex enough (having h have only one path leading in) that it made it clear we are choosing the next vertex to check just from the list of unvisited vertices. Thank you.
@mostafaeldeep7539
@mostafaeldeep7539 8 жыл бұрын
Thanks alot man I passed my exam last year because of this video , thanks from egypt .
@max29297
@max29297 15 жыл бұрын
Now to find other paths, for example, as you said, D to H or H to G, you use the same method that the instructor used in this video. Notice that the instructor started with A - this was his starting vertex. To find a path from a vertex other than A, simply use the same method starting with that vertex instead (for your problems, D or H respectively) Hope all of this helped! :)
@4ourTimber
@4ourTimber 11 жыл бұрын
Explained much better than my lecturer! Thanks!
@Masenken
@Masenken 14 жыл бұрын
wow, now if math teachers could find ways to be this straightforward and concise in their teaching, we'd all be astrophysicists by now. Nice explanation
@lanesetrimmingham3331
@lanesetrimmingham3331 7 жыл бұрын
I don't leave comments, but I had to say a job well done with this explanation. Just perfect!!
@volrath__
@volrath__ 9 жыл бұрын
These have been really good for revising for my Data Structures and Algorithms exam today! thank you :)
@lanoche
@lanoche 14 жыл бұрын
helped a lot, managed to learn more in 10 minutes with your explanation, than with my prof's lecture that took 3 hours
@TheSyncan
@TheSyncan 11 жыл бұрын
B:20, C:40, D:50, E:N/A, F:30, G:70, H:60. For clarity, ignore the "small letters" under the numeric line values; they represet the "via node". Each line value from left to right aligns with each Goal Node's "main column", starting with B (focus on the letters written in blue at the top). That stated, to get the shortest path from A to Goal n: read *only* the numerical values on the final line (#7). (first value is for B .. last value is for H).
@anasfcb
@anasfcb 13 жыл бұрын
Thanks a Lot !! I have Exam tomorrow too !! This algorithm has been a headache to me for a long time untill I saw and understood your very good leçon a few seconds ago ! Thanks again Sir !
@ddd222444
@ddd222444 10 жыл бұрын
Amazing man , really thank you, I have a final exam tomorrow and your video and easy explaining was too helpful for me , Keep on
@bharatraturi
@bharatraturi 14 жыл бұрын
fantastic one. i had been trying to understand this for a long time but this video really took very few of my time to make me understand
@excel20
@excel20 15 жыл бұрын
You take a look at the values in row 7: G can be reached the fastest via D (as D is the last vertex mentioned in column G) D is reached via C, C via F, F via B, and B via A. So to reach G by the shortest path, you go A->B->F->C->D->G
@RoyalSwish
@RoyalSwish 14 жыл бұрын
This algorithm is so annoying, thank you for making it more clear than the textbook.
@travolta91
@travolta91 12 жыл бұрын
I'' be sitting for Data Structure final exam paper in 3 days time.. You just saved my life!!~ :) :)
@NoorAhmedAboiye
@NoorAhmedAboiye 14 жыл бұрын
Excellent!!! you made it really easy to grasp in 10 minutes than a full class lecture. Thank you very much, keep up the good work.
@ThisaraPinto
@ThisaraPinto 14 жыл бұрын
You just saved me for my final exam! This is the only problem I had trouble with. Thank you!
@UnrealLotus
@UnrealLotus 13 жыл бұрын
I have an exam tomorrow and you have just saved my life! Thanks!
@TheRuinedUniverse
@TheRuinedUniverse 8 жыл бұрын
I like it! I'm going to pay him a visit in the Bath House, in Novigrad, I believe congratulations are in order!
@vojtechjanku2534
@vojtechjanku2534 8 жыл бұрын
Yes! Finally someone made a Witcher reference. I was browsing xkcd and suddenly "Dijkstra's algorithm" came out of nowhere. I was like "What sorcery is this??"
@TheRuinedUniverse
@TheRuinedUniverse 8 жыл бұрын
Vojtěch Janků Ahaha 😂😂
@kamoroso94
@kamoroso94 9 жыл бұрын
I'm glad I found this video. I'm working on a project for class that requires this algorithm.
@janashafi6674
@janashafi6674 9 жыл бұрын
Soo simple and easy way of exaplaining. Hats OFFF
@c.harris7823
@c.harris7823 5 жыл бұрын
This is an outstanding video. The only example or scenario that seems to be missing is how to manage/make a decision when you have two (2) edges from the same node (so two different path options from the same node) that cost the same...e.g. going from F to C or from F to D and they both cost 40.
@kristijanceple6026
@kristijanceple6026 5 жыл бұрын
Note I'm just a student practising this, so I'm not sure if it's correct but seems to have worked and made sense, at least for me so far. But still take it with a massive grain of salt, and if somebody could correct me that'd be great choose either one, just make sure it's the shortest one or among the shortest routes as calculating using shortest routes is the whole point of the algorithm. Also if to a certain node you have got 2 paths of the same length, just write something like 60, (A, D) down into the table. For example, if both A and D lead to E at a cost of 60 each, write 60, (A, D) under E. Then you can pick either one, the point is just to cover all the nodes.
@gregorygofman1155
@gregorygofman1155 10 жыл бұрын
Very nice, I think you saved my mark for this semester. Cheers from Russia
@nafnaf6002
@nafnaf6002 13 жыл бұрын
OMG that was amazing i was desperate to understand this thing cause there are only 4 hours till my final and then i found this tutorial when i was revising thnq so much you saved me
@imismael
@imismael 12 жыл бұрын
You usually use a secondary criterion for selection. In our class we select according to alphabetical order. For example, if A -> C = 20 & A -> G = 20, we select C as it comes first in the alphabetical order.
@pratapbhanusolanki6613
@pratapbhanusolanki6613 9 жыл бұрын
An awesome explanation with a great example. You have covered all of the possible trickiest cases. Thanks a lot :)
@ragnarokl3923
@ragnarokl3923 7 жыл бұрын
Thank you very very much. You explained it well and I understood it well. My teacher didn't haven't taught us this (as far as I remember), but gave us an assignment which we have to use this method to solve (it said so in the problem, as in we have to specifically use this method). So I'm really really thankfull for this video. Once again, thank you.
@noobdevtutorials50
@noobdevtutorials50 6 жыл бұрын
Understand it without any difficulty.Thanks man.
@thatAdamskid
@thatAdamskid 13 жыл бұрын
Just wanted to thank you profusely. And also to say this is my first actual youtube comment. Hello world!
@preritdatta
@preritdatta 15 жыл бұрын
God Bless u made it as simple as a childs game!!! Thanks to you,I can now score well.Thanks a lot man!!!!! keep posting!
@AndreiPetre
@AndreiPetre 12 жыл бұрын
to get a best path, take for e.g. the best path from A to D (obtained with Dijkstra's alg), you follow the reverse path given by the parents from which they were explored. So starting from D, you see that it was visited from parent C and has a cost of 50. Now going to C, you see that its parent is F. And F was visited through B (its parent). And finally, B's parent is A. So the path would be A-B-F-C-D. The idea is that you have to reconstruct your path from _goal_ node to the _starting_ node.
@ocb2112
@ocb2112 15 жыл бұрын
wow i have been searchin through my skripts and through wiki to learn that stuff. but that was the best explanation by far! good job and thank you!
@Zerpentile93
@Zerpentile93 10 жыл бұрын
Wtf. Didn't know it could be explained so easily. Thanks!
@JoeBuza
@JoeBuza 11 жыл бұрын
Can you believe this is a 5 year old video? Good work mate
@sumeyayenzaismael5727
@sumeyayenzaismael5727 6 жыл бұрын
kkkkkk
@leggermentesara
@leggermentesara 6 жыл бұрын
Now it's 10 year old 😱
@AlexGomez-rv2ny
@AlexGomez-rv2ny 6 жыл бұрын
Can you believe that your comment is 4 years old?
@vim1729
@vim1729 5 жыл бұрын
Hiii
@iam_topg
@iam_topg 5 жыл бұрын
its 11 years now lool
@JohnSmith-hn6kv
@JohnSmith-hn6kv 7 жыл бұрын
This is the 3rd algorithm you've taught me!
@MrTeetam
@MrTeetam 11 жыл бұрын
The TSP is the hardest problem to solve, as it is an equivalent problem to all of the other hardest problems (the rest of those that are NP-complete)--what you are describing is a probabilistic approach which will estimate (but can't guarantee) an optimal path, which one could argue isn't a solution as the problem is to find the optimal path which you may or may not have done with this.
@towhidskynet
@towhidskynet 9 жыл бұрын
I love your explanation about algorithm. what is your youtube channel ?. your explanation on BFS and DFS destroyed my 15 year old fear about Graph problems. you explain things 1000 better than a Professor of MIT. Thank you !!!
@ComputerScienceExplained
@ComputerScienceExplained 8 жыл бұрын
+Mubeen Ali pretty sure he was watching open courseware and was confused by a university presentation that explains theory as well...
@ervinzhou8251
@ervinzhou8251 7 жыл бұрын
I mean I thought the MIT lecture guy explained it pretty well..
@cellardoor8943
@cellardoor8943 8 жыл бұрын
nice man ! i was trying to understand what " vertex relaxation " was and i got it from your video
@graysonwebb2018
@graysonwebb2018 9 жыл бұрын
Really well explained! And easy to remember. Text books should teach this way of doing it, much more pedagogical.
@nawkwan
@nawkwan 14 жыл бұрын
Thanks for this clear illustration and explanation. Good Job.
@nikkei5410
@nikkei5410 9 жыл бұрын
Best Explained I've ever seen.
@OnlineSGNTheFishBoss
@OnlineSGNTheFishBoss 6 жыл бұрын
this video helped me in my final exam.... THANKS A LOT !!!!!!!
@wendygal6910
@wendygal6910 8 жыл бұрын
You rule! you are the only exapmple like this put there! and Ive been looking for like 2 hours. Thank you :)
@PotionDweller
@PotionDweller 12 жыл бұрын
Thank you so much, this was fantastic for clarification. Watched two of your videos so far and they've been very well done.
@darkcarney1
@darkcarney1 13 жыл бұрын
Awesome, Exam later today and was totally blanking on Dijkstra algorithm Thanks heaps
@Dimme
@Dimme 12 жыл бұрын
What I've concluded is that I need to keep applying Dijkstra's algorithm until my destination node is marked as permanent. Then I can stop and I don't need to visit the rest of the nodes. This makes the algorithm a little more efficient.
@Ben1220
@Ben1220 15 жыл бұрын
So well explained that my Grandma understood it!
@MrTeetam
@MrTeetam 11 жыл бұрын
This is a completely different problem to what you describe (TSP). Dijkstra's algorithm finds a 'single source shortest path', and so it computes the shortest path from A to any other vertex. It doesn't require that all (or any) of the other points be included in the solution's path.
@AleksandarGeyne
@AleksandarGeyne 11 жыл бұрын
Really helped, man !! I watched this video an hour before my exam, went there and nailed it !!! :D
@leggermentesara
@leggermentesara 6 жыл бұрын
Thanks! 🔝 10 years later 🌱
@29leej
@29leej 8 жыл бұрын
finally the video for directed weighted Dijkstra graph.
@annevyner
@annevyner 11 жыл бұрын
Thank you soo much i had finals 3 hrs later, i just needed to und this part and im done, Thanks to you u saved hours of mine. Keep it up!
@AlexWard94
@AlexWard94 10 жыл бұрын
Incredibly helpful video - completely ironed out my confusion with this topic! Thank you! :D
@Tgasparian
@Tgasparian 14 жыл бұрын
This is much better than my text book explanation
@tqbfjotlddltojfbqt
@tqbfjotlddltojfbqt 12 жыл бұрын
Very good tutorial, it be even better if you talk about how using a min priority queue is improvement over original algorithm Dijkstra submitted in his paper
@smartalex32
@smartalex32 12 жыл бұрын
Whichever one you get to first is the one you use. They both are valid paths though, so you can technically use either one.
@oguzhangoller697
@oguzhangoller697 8 жыл бұрын
Best explanation so far, Great Work !!
@AbyssenTheHoly
@AbyssenTheHoly 13 жыл бұрын
Dude. Thank you so much. This helps me a LOT, I have a final tomorrow!
@U0ykcuf
@U0ykcuf 13 жыл бұрын
Thank you so much. My textbook is super vague on this, and now I finally understand.
@mbawaters
@mbawaters 5 жыл бұрын
Going from Vertex B to F without processing other neighbors of A is a digression from BFS approach. More often Dijkstra is considered BFS with greedy approach.
@Nictron80
@Nictron80 14 жыл бұрын
Thanks a lot, this will help me with my test next Tuesday. :)
@Cdoddsy
@Cdoddsy 12 жыл бұрын
College final in 3 hours and 1/3 of it is going to be on this. I have not shown up to class once and now I am cramming. Pray for me.
@twistedflamingo1
@twistedflamingo1 12 жыл бұрын
No, the shortest path isn't the order of the letters in the first column. The path would be A to B to F to C to (both D and H) and then from D to G.
@amizan8653
@amizan8653 11 жыл бұрын
Thanks a lot for posting this, it makes perfect sense now
@max29297
@max29297 15 жыл бұрын
To answer your first question: Yes! Vertex A is your starting node. The highlighted distances at the end of the video are the shortest distances from A to every other vertex.
@The1311714
@The1311714 12 жыл бұрын
Thanks so much, It's helping me for my test tomorrow.
@yashithayasanga9985
@yashithayasanga9985 5 жыл бұрын
me too
@semifuntastik
@semifuntastik 16 жыл бұрын
thank you very much amigo, your time and effort is greaty appreciated
@colonelbastian6036
@colonelbastian6036 9 жыл бұрын
Best dijktra demo. evar
@h34rtk0rps
@h34rtk0rps 12 жыл бұрын
Heh, you're much better than my professors at explaining stuff. Would have thrown a like your way...
@Kemenesfalvi
@Kemenesfalvi 15 жыл бұрын
This is not about going somewhere and staying there, but if we want to go to H he found the lowest cost path there, but if we want to got to G we have a lowest cost path there too which doesn't include H but goes on from C .The solution shows all the lowest cost paths for any point
@syedhamzah3324
@syedhamzah3324 9 жыл бұрын
A very good explanation, very helpful for my exam!
@imorio
@imorio 14 жыл бұрын
@elgonost You could choose a random path, or the path given by the algoritm checking for the lowest number. I suspect you could enhance the algoritm to track both paths in that case. Now it only finds the shortest path to a point, if you rewrite the algoritm to track both and continue further steps seperatly, you'd get an algoritm that gives all shortest paths to all points.
@max29297
@max29297 15 жыл бұрын
To find the order, work backwards. Find the highlighted distance for your destination vertex and look at the letter beneath the distance. Write it down. Now look at the letter beneath the highlighted distance for the vertex you just copied and write IT down. Continue this pattern 'til you get to the start and reverse the list.
@SPyoutube42069
@SPyoutube42069 11 жыл бұрын
a quite nice visual explanation, good stuff
@viharsarok
@viharsarok 13 жыл бұрын
@manojsam79 You only need the last row. Begin at the vertex you're interested in, look up its parent (the node that's written under the optimal cost), than look up the parent's parent etc. Proceed until you reach the starting node. Reverse the list of nodes to get the shortest path. E. g. the shortest path to H is H, C, F, B, A reversed, that is A, B, F, C, H
@MrSyKoM
@MrSyKoM 13 жыл бұрын
Thanks, this helped me. I have to specify that this is no the Djikstra original algorithm: this is implemented choosing the min vertex (with a min heap), the original algorithm choses the first node of a queue. Anyway, it does not change the core buisness :) Thanks!
@silversvartnad
@silversvartnad 14 жыл бұрын
Thi vid makes it very easy to understand the algorithm. Thanks a lot =)
@rene13cross
@rene13cross 11 жыл бұрын
This must be one of the only 16:10 vids on KZbin :D Thanks for a great explanation btw
@piurek10
@piurek10 8 жыл бұрын
good explanation thanks from Poland.
@arngorf
@arngorf 11 жыл бұрын
This is absolutely brilliant. Just what I needed! Thanks!
@darrylbil
@darrylbil 7 жыл бұрын
AWESOME !!!!! U SIR JUST SAVED A LIFE
@ahmedrezwan3856
@ahmedrezwan3856 7 жыл бұрын
No doubt it is the best explanation ever
@4.0.4
@4.0.4 11 жыл бұрын
Only gor the sake of a clarification; the "traveling salesman" problem you describe is not the hardest problem to solve. It's just somewhat hard if you want to brute force all paths (which is silly), but even that is not too hard by moderns standards (You can brute-force it in a GPU with CUDA now a days!) You can "solve" it cheaply by using genetic algorithms. Look it up :) Also, it's been thaught for too much time in universities by teachers who don't like to keep up-to-date.
@ahmetturan4783
@ahmetturan4783 10 жыл бұрын
Thank you. You explained pretty easy to understand.
@DavidRutten
@DavidRutten 14 жыл бұрын
Well done, excellent description. But why no rating?
@dheerenr
@dheerenr 7 жыл бұрын
Thank you soo much, by far the best explanation ive found :-)
@muhammadsaad6101
@muhammadsaad6101 7 жыл бұрын
Watching this after like 9 years of it. Wow.
@saurabh1qaz2wsx3edc
@saurabh1qaz2wsx3edc 13 жыл бұрын
thnk u so mch... have xams in 8 hours :P . thnx 2 u... will at least score 5 marks for Dijkstra algo :D
@lizard2728
@lizard2728 14 жыл бұрын
Thank you -- awesome explanation! I'm needing to implement the algorithm, and this helps tremendously!
@CGagnon5
@CGagnon5 13 жыл бұрын
I really like this notation. Thank you!
@liamMaru
@liamMaru 15 жыл бұрын
It's just mathematically convenient, because we want to take the minimum weighted distance, and there exists no number larger than infinity, therefore we can assume ANY path is better than none at all (infinite distance). Does that make sense? The use of infinity doesn't change the algorithm, but it can greatly simplify the readability of its implementation (IE, if your language is IEEE 754 standard and recognizes infinity)
@TheSyncan
@TheSyncan 11 жыл бұрын
The shortest path, of all in the return set, is A->B=20. But that's not the intent nor the answer for this problem. The algorithm returns a *set* of shortest paths (B-H), given a topology of nodes with multiple connections (or edges). Not just a single, shortest path.
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
Dijkstra's Shortest Path Algorithm | Graph Theory
24:47
WilliamFiset
Рет қаралды 210 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 27 МЛН
Players vs Pitch 🤯
00:26
LE FOOT EN VIDÉO
Рет қаралды 134 МЛН
Dijkstra's Algorithm with Example
11:53
Beena Ballal
Рет қаралды 169 М.
Dijkstra's Algorithm:  Another example
8:41
barngrader
Рет қаралды 795 М.
شرح وحل مثال Dijkstra algorithm
12:36
Ahmed Hashim - احمد هاشم
Рет қаралды 3,3 М.
Graph Data Structure 4. Dijkstra’s Shortest Path Algorithm
10:52
Computer Science Lessons
Рет қаралды 1,5 МЛН
Dijkstra Algorithm - Example
13:04
Lalitha Natraj
Рет қаралды 156 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,4 МЛН
L-4.10: Dijkstra's Algorithm - Single Source Shortest Path - Greedy Method
15:49
Level 2 NCEA Networks - Shortest Path (Dijkstra’s Algorithm)
11:41
Maths is Maths
Рет қаралды 10 М.
Dijkstra's Algorithm with example of undirected graph
12:31
Beena Ballal
Рет қаралды 320 М.
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 27 МЛН