How Dijkstra's Algorithm Works

  Переглядів 1,260,142

Spanning Tree

Spanning Tree

День тому

Dijkstra's Algorithm allows us to find the shortest path between two vertices in a graph. Here, we explore the intuition behind the algorithm - what information we need to keep track of, in what order we need to explore vertices, and what the limitations of the algorithm are.
***
Spanning Tree is an educational video series about computer science and mathematics. See more at spanningtree.me
To be notified when a new video is released, sign up for the Spanning Tree mailing list at spanningtree.substack.com/
Spanning Tree is created by Brian Yu. brianyu.me/
Email me at brian@spanningtree.me to suggest a future topic.

КОМЕНТАРІ: 700
@beketmyrzanov1979
@beketmyrzanov1979 3 роки тому
This video is ridiculously underrated ((
@vn5051
@vn5051 3 роки тому
istg
@travelrealindia1
@travelrealindia1 2 роки тому
Can't agree more
@thishandleistaken.
@thishandleistaken. 2 роки тому
I noticed that people put everything between is and underrated
@myleshayhurst5187
@myleshayhurst5187 Рік тому
Truuee
@nayankumarbarwa4317
@nayankumarbarwa4317 Рік тому
Criminally underrated, Brian Yu also teaches in Cs50 topics like AI and Web dev
@hongweichen3581
@hongweichen3581 3 роки тому
Came from Computerphile's video after not understanding, and this is just so much better! You made advanced concepts so easy to understand for beginners like me, thank you.
@TainuiaKid1973
@TainuiaKid1973 Рік тому
Here's the implementation in Python ukposts.info/have/v-deo/jp6FoI1sbmiExGg.html
@Itachi.Uchiha.Offical
@Itachi.Uchiha.Offical Рік тому
Same! Came from Computerphile, felt dumb, watched this, and understood.
@turuus5215
@turuus5215 Рік тому
Same, concepts should be intuitive for humans.
@dineshkumare1750
@dineshkumare1750 Рік тому
@@TainuiaKid1973 I also came here after seeing Computerphile video😂..
@nayankumarbarwa4317
@nayankumarbarwa4317 Рік тому
This video is criminally underrated
@aries3690
@aries3690 2 роки тому
I cant stress how amazing these animations are! You are a livesaver for "self-learners" like us :)
@acedev003
@acedev003 2 роки тому
Absolutely!
@Yell-Heah
@Yell-Heah 2 роки тому
fuck, dude, yeah. I don't learn anything from my college lectures- I need stuff I can pause and rewind, and my monkey brain does great with visual assistance. needing to basically self-teach myself all my CompSci, I don't wanna think about where I'd be without videos like this
@MichaelKingsfordGray
@MichaelKingsfordGray Рік тому
Learn your real name first!
@MikhailFederov
@MikhailFederov Рік тому
Calling yourself a self learner is meaningless. Everyone is a self learner.
@MichaelKingsfordGray
@MichaelKingsfordGray Рік тому
@@MikhailFederov There is a more respectable term for self-taught: Autodidact.
@Mobin92
@Mobin92 Рік тому
THANK YOU for the part at 6:28 ! Nobody else seems to explain how to actually find the path, and not just it's length.
@Yell-Heah
@Yell-Heah 2 роки тому
I've been agonizing over trying to understand this algorithm for a class for hours- and now I'm about halfway through this video, and I'm already feeling enlightened. It's FINALLY clicking. You're a lifesaver, mate!
@dominiorrr6510
@dominiorrr6510 Рік тому
I love learning based on examples and this is by far the best example of Dijkstra's algorithm I've seen so far. It covers a lot of aspects that might not be obvious at first. I haven't even learned Dijkstra yet, but it feels trivial to implement after knowing how simple graph algorithms like DFS or BFS work.
@prashanthvaidya
@prashanthvaidya 2 роки тому
The animation is just outstanding! A video on "how" you make these videos or just what inspired you to get started on this creative journey would be awesome. Keep up the amazing work. I have subscribed and also pressed the bell icon. :)
@soyandoat4106
@soyandoat4106 2 роки тому
Please continue to do more of this video! Thank you so much for your content!!
@whatsup_internet
@whatsup_internet 4 місяці тому
So far the best and easiest explainations i have ever seen on YT yet for dijkstra;s Algo. Great work !!! Thank you :)
@pend_deletepatrickguarente4916
@pend_deletepatrickguarente4916 8 місяців тому
By far the best video on this subject I have ever seen, FANTASTIC job with those animations they are really good!
@johnle7705
@johnle7705 3 роки тому
This channel is a germ!! So glad I found you!
@rockstarpesu
@rockstarpesu 9 місяців тому
Such a great way to explain the complex topic. Thanks a lot. 😊
@adrienw4704
@adrienw4704 Рік тому
very interesting! i love how you voice over your code. you make it super understandable!
@nawalkhawar7602
@nawalkhawar7602 2 дні тому
you're videos are extremely helpful. thank you for making these! Also love the robot
@penguinjuice7543
@penguinjuice7543 11 місяців тому
Absoloute life saver. Got taught this by a teacher who literally doesn't know computer science so videos like this are vital.
@ajaysrinivas2814
@ajaysrinivas2814 Рік тому
What a great explainer video! Please make more of algorithms. Thanks a lot for making this video.
@keitumetsemolefe3515
@keitumetsemolefe3515 Рік тому
This is the best explanation on Dijkstra's algorithm I've ever come across!! 🙌🙌
@ozboomer_au
@ozboomer_au Рік тому
A very helpful video. Just looking at code and some rambling explanation in a book made the algorithm as clear as mud in a beer bottle to me... but this video has made it so abundantly clear... and seeing how code is derived from it is more than helpful. Thanks so much for posting.
@ujjwalgupta4160
@ujjwalgupta4160 3 роки тому
Kudos to the animation and explation.
@KingstonFortune
@KingstonFortune 2 роки тому
This is so much better than some other ones I already saw....and that was a nice tip at the end, referring to the negative value.
@DaveAlexKD
@DaveAlexKD Рік тому
I love this explanation is so simple to understand. Thank you!
@kacperwodiczko
@kacperwodiczko 2 роки тому
Thank you! You've made it so easy to comprehend
@alliepiper4772
@alliepiper4772 2 місяці тому
I've been watching a few of your videos over the last day or so, and they're all just so good. You really have a knack for explaining complicated concepts with a clear, easy-to-grasp visual style. I think I'd describe your channel as "3blue1brown for computer science" :) I hope that comes off as complementary as it's intended. Kudos, and keep up the great work, I'm looking forward to more!
@aakashdp
@aakashdp 3 роки тому
thanks! easy to follow. explained in simple terms.
@demonking2526
@demonking2526 Рік тому
Very great explanation, I just followed along Dikstra's algorithm in pseudo code and implemented pathfinding in Unity using it. This visual tool really helps explain the algorithm at hand! Great work.
@artycrafty8691
@artycrafty8691 11 місяців тому
Not only the video is underrated but the whole youtube channel is underrated. best of luck you spanning tree. This is the future of education. I feels so good when i look up to such unique educational channels.
@taumah7302
@taumah7302 11 місяців тому
Incroyable ! Mes profs n'ont pas réussi à ma faire comprendre cet algo en 1h et là je tombe sur cette vidéo ! Merci tu viens de sauver mon année !
@jaylensung7332
@jaylensung7332 8 місяців тому
It's amazing that I recognized this voice immediately and realized this random video I picked is actually from Brain! Thank you for all the hard work you've done!
@smikkelbeer7890
@smikkelbeer7890 Рік тому
By far the best explanation on the internet. Thank you
@davngo
@davngo 3 роки тому
Awesome explanation, short and to the point.
@namankeshari7332
@namankeshari7332 9 місяців тому
This is the first video I watched on your channel and on dijkstra's algorithm and damnn it was sooo good! Loved it!
@magik0630
@magik0630 3 роки тому
Excellent walkthrough. 4th video down and I finally get it. Thanks
@soniahandle
@soniahandle Рік тому
Exactly what we need more of! Amazing explanation
@dailyamazingshortvideos
@dailyamazingshortvideos Рік тому
This is the best explanation,one can ask for. . Waiting for more such algo explanations
@BrianOSheaPlus
@BrianOSheaPlus Рік тому
Excellent video. Clear and concise description of Dijkstra's algorithm.
@SaidElnaffar
@SaidElnaffar Рік тому
I am sharing this link with my students in the Data Structures course -- Keep it up!
@qazizayad4860
@qazizayad4860 11 місяців тому
i have my Alevel Comp Sci paper 12 hours from now. I love you man. Youre a real life saver
@skidoodles
@skidoodles 3 роки тому
For each vertex v: Dist[v] = infinite Prev[v] = none Dist source = 0 Set all vertices to unexplored While destination not explored: V = least valued unexplored vortex Set v to explored For each edge (v, w): If dist[v] + len(v, w) < dist[w]: Dist[w] = dist[v] + len[v, w] Prev[w] = v
@adharlak510
@adharlak510 3 роки тому
Thank you to SpanningTree for the insight and thank you for the memo !
@abam9787
@abam9787 Рік тому
What's the significance of Prev[w] when the latest update of Dist[w] is more important?
@AlumniQuad
@AlumniQuad Рік тому
@@abam9787 6:24
@irrelevant_noob
@irrelevant_noob Рік тому
@Skidoodles the last two lines should be indented more, to indicate they are both part of the "if true" branch of the conditional. Also, why not indent for the while loop?
@shiko4959
@shiko4959 Рік тому
Thanks man
@shandou5276
@shandou5276 2 роки тому
This is incredibly well made!
@chrisogonas
@chrisogonas Рік тому
Excellent illustration of the Dijkstra's algorithm. Superb!
@gargolario
@gargolario Рік тому
Great, clean and simple! Congrats!
@gowinidea
@gowinidea 11 місяців тому
You guys have produced super videos..thanks much!❤
@supersakib62
@supersakib62 Рік тому
One thing I realized, visualization is more helpful to grasp a context than just reading about it.
@Agamista379
@Agamista379 Рік тому
This is amazing. Please keep the good work.
@abdullahmustafa3746
@abdullahmustafa3746 2 роки тому
you are just doing a great job right there, Thank you
@Mercury2wo
@Mercury2wo Рік тому
Fantastic video!! Am watching all your videos back to back
@DC-zb7uf
@DC-zb7uf 2 роки тому
Best video explanation out of them all, thanks !
@curesnow6493
@curesnow6493 Рік тому
I am a virtual person and this is my first video so far, and it is very easy to understand!
@amrutaj28
@amrutaj28 Рік тому
Beautiful explanation. Thank u so much.
@rodrigo-tj1gf
@rodrigo-tj1gf 5 місяців тому
You need to post more, those videos are freaking good
@Adarsh_Tiwari
@Adarsh_Tiwari Рік тому
This is almost similar to the CPM (Critical Path Method) that we study in Project Planning and Management. So beautifully explained
@TheMofRider2
@TheMofRider2 Рік тому
Just wanted to mention that. You're absolutely right 🙂
@minhucbui9566
@minhucbui9566 Рік тому
Brilliant explanation. Thank you!
@lakshman587
@lakshman587 Рік тому
This is Amazing!!! Thank you so much for the video!!!
@ghanshyamtripathi221
@ghanshyamtripathi221 4 місяці тому
not even kidding this is the best explanation/ visualisation one can ever get Thank you sir!!
@sayantankundu973
@sayantankundu973 2 роки тому
Just gotta a say, thanks a lot.... U have made it so easy to understand... The animation is very helpful... Keep going
@JamesCheng999
@JamesCheng999 Місяць тому
Great video, very intuitive and help me a lot!
@jannickbreunis
@jannickbreunis 4 місяці тому
Explained very well!
@rocket007
@rocket007 Рік тому
Really cool stuff. I am also happy about the snippet code algorithm at the end
@josiasbudaydeveloper5864
@josiasbudaydeveloper5864 Рік тому
This video is amazing, thank you very much for this help!
@manishmakode6332
@manishmakode6332 10 місяців тому
Really great animation for explaining the concept, loved it
@stith_pragya
@stith_pragya 5 місяців тому
Thank You So Much for this wonderful video...........🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻
@gutzimmumdo4910
@gutzimmumdo4910 Рік тому
perfectly explained, intuitive well ordered and perfect example. great work
@OneTrueBadShoe
@OneTrueBadShoe Рік тому
I saw this in a class in 1994 or 5. This has always been my favorite algorithm I've ever learned. Nice video
@matteobecatti3157
@matteobecatti3157 2 роки тому
Very clear explanation, thank you!
@camerongray7767
@camerongray7767 Рік тому
Amazing video. So well explained. Brillinat
@SatyarthShankar
@SatyarthShankar Рік тому
Your channel should grow! Amazing work!
@saipan1970
@saipan1970 10 місяців тому
The ambience,sound the illustration and putting the main logic behind this algorithm : Clarity and transparency are optimum.Please do make videos like this for every important algo,a request.Refreshing..
@javel476
@javel476 2 роки тому
Best video about dijkstra algorithm I have ever seen
@chochocho117
@chochocho117 10 місяців тому
clean explanation thanks !
@firebraingames
@firebraingames 3 роки тому
Great way to get a feel of Dijkstra's Algorithm
@user-bk4rv6qx2z
@user-bk4rv6qx2z 8 місяців тому
This channel is so good.
@df_iulia_estera
@df_iulia_estera 2 роки тому
Very useful! Thank you very much for doing this video :D
@s1mplelance964
@s1mplelance964 2 роки тому
Great video with clear explanation! It would fit those entry level guys.
@emmanuelonah4596
@emmanuelonah4596 Рік тому
Thank you for this simplification
@egalomon
@egalomon Рік тому
I don't know why YT is recommending this to me 2 years after its upload, but I gladly clicked on the video! This is pretty much the only thing I remember from when I was studying Geoinformatics before I quit lol so it's a nice throwback for me. Very well explained too! 8:30 for something our professor needed like 2 weeks for
@laxyasharma7535
@laxyasharma7535 Рік тому
Amazing work !!
@elijahdecalmer613
@elijahdecalmer613 11 місяців тому
Very great visualisation, thank you
@___vandanagupta___
@___vandanagupta___ 9 місяців тому
The amazing quality of your videos is super underrated
@MartinStaykov
@MartinStaykov Рік тому
I don't think I've ever watched anything ever explained in a clearer way than this.
@tyronefrielinghaus3467
@tyronefrielinghaus3467 Рік тому
Also...a great voice too. Very clear.
@DontAddMe
@DontAddMe Рік тому
beautifuly explained! Dont stop making these videos. You are the savior of cs students
@saragul2806
@saragul2806 Рік тому
Amazing job! I have a logistics course in uni and I didn't understand the class. Lucky me found this video. Thank you!!!
@megamaser
@megamaser 6 місяців тому
The first time I figured out this algorithm, it was by reading code. That worked, but took way longer than watching this video. This video is very nice. It is clear and touched the most important points. You've made an intuitive understanding of Dijkstra's algorithm easily accessible to anyone. The only thing I would add to this video is at least a brief mention that you would put the data in a heap. This could be a nice segue into a separate video about heaps.
@minhlaburninghihi5627
@minhlaburninghihi5627 3 роки тому
Coolest video on Dijkstra's ever. So easy to understand, thank you so much.
@sandhyav410
@sandhyav410 2 роки тому
Wonderful explaination and beautiful animation..thank you🤗
@ghostfjdgcsusvsgsj
@ghostfjdgcsusvsgsj Рік тому
best explanation of dijkstra's algo so far
@CrescentDolluwu
@CrescentDolluwu 11 місяців тому
Besides how great of a job this video explains this concept, The absolute best part is the little blue robot blinking and looking around.
@bonadio60
@bonadio60 25 днів тому
Just fantastic! Thanks so much.
@cheenu2064
@cheenu2064 Рік тому
Great visuals and explanantion well done mann!!! 😄
@juanmauriciomugni5783
@juanmauriciomugni5783 2 роки тому
Thank you!! Greetings from Argentina, excellent video!
@micokun8433
@micokun8433 2 роки тому
very clear and informative
@dannywei6933
@dannywei6933 9 місяців тому
Excellent video!
@SimonTheDankOne
@SimonTheDankOne Рік тому
I have a shortest path problem that I am currently working on, and even though I am familiar with the Dijkstra algorithm this somehow just made me instantly realise of my mistake in code. Gracias
@jessojohn9226
@jessojohn9226 10 місяців тому
i never subscribed a channel just watching one video before..You are so good
@nguyennhi8524
@nguyennhi8524 Рік тому
so much easy to understand, thank team alot
@nielsdaemen
@nielsdaemen 3 місяці тому
Best explanation of Dijkstra's Algorithm!
@shufflecat3334
@shufflecat3334 Рік тому
Very well explained! The only feedback I can provide is that I personally found the background music annoying. The wind instrument (flute?) seemed a bit obnoxious and interrupted my focus on the concepts being presented pretty often. Kind of hard to know that sort of thing ahead of time, but that's just my personal experience of the video. :)
@fosatech
@fosatech 5 місяців тому
The music makes me want to kms
@hairold5680
@hairold5680 4 місяці тому
Agreed, itd be better without it
@srushtiharyan2033
@srushtiharyan2033 2 роки тому
This is really helpful..Thanks a lot✨
@koomky
@koomky 10 місяців тому
I used the Dantzig method to do this. Now I understand a new method, thanks
@huugoandlearn
@huugoandlearn 6 місяців тому
Great explanation !
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
Spanning Tree
Переглядів 136 тис.
The hidden beauty of the A* algorithm
19:22
polylog
Переглядів 802 тис.
Піхотинець - про рутину на фронті
00:46
Суспільне Новини
Переглядів 765 тис.
Піхотинці - про потребу у людях
00:57
Суспільне Новини
Переглядів 899 тис.
😱СНЯЛ СУПЕР КОТА НА КАМЕРУ⁉
00:37
OMG DEN
Переглядів 1,7 млн
python 41-2 4 lesson
1:50:57
geektech front03
Переглядів 8
AES: How to Design Secure Encryption
15:37
Spanning Tree
Переглядів 110 тис.
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
What Is the Pigeonhole Principle?
8:23
Spanning Tree
Переглядів 3,3 млн
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Переглядів 969 тис.
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Переглядів 1,3 млн
Naming Things in Code
7:25
CodeAesthetic
Переглядів 1,9 млн
Mastering Dynamic Programming - How to solve any interview problem (Part 1)
19:41
P vs. NP: The Biggest Puzzle in Computer Science
19:44
Quanta Magazine
Переглядів 646 тис.
What Is a Binary Heap?
8:45
Spanning Tree
Переглядів 173 тис.