Dijkstra's algorithm in 3 minutes

  Рет қаралды 1,350,583

Michael Sambol

Michael Sambol

9 жыл бұрын

Step by step instructions showing how to run Dijkstra's algorithm on a graph.
Code: github.com/msambol/dsa/blob/m... (different than video, I added this retroactively)
Source: Algorithms by S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani [www.amazon.com/Algorithms-San...]
LinkedIn: / michael-sambol

Пікірлер: 352
@rahulsonwalkar3663
@rahulsonwalkar3663 7 жыл бұрын
When you had an entire semester to study but you delay it till the last hour.
@ObradovacPower
@ObradovacPower 6 жыл бұрын
SO TRUE HAHAHA!!!!! lmao
@BiancaDianaT
@BiancaDianaT 6 жыл бұрын
On point ._.
@haoranlou155
@haoranlou155 5 жыл бұрын
气死我了,被抓包了
@JHmuniz1
@JHmuniz1 5 жыл бұрын
30 min*
@phylmath
@phylmath 5 жыл бұрын
So damn true, my exam is in twenty minutes lol.
@LevyaFox
@LevyaFox 2 жыл бұрын
I just learned more in that 3 minutes than the last 2 weeks of my programming class. Thanks a lot! :)
@coolbildzlego
@coolbildzlego Жыл бұрын
same lol
@christopherrondeau9829
@christopherrondeau9829 Жыл бұрын
Fucking same, fuck uni teachers
@burstfireno1617
@burstfireno1617 7 ай бұрын
same here :D
@ilyasviel731
@ilyasviel731 5 ай бұрын
same here :D@@burstfireno1617
@adamnavratil2350
@adamnavratil2350 4 ай бұрын
That's weird honestly
@ThisClark
@ThisClark 9 жыл бұрын
mikey, keep it up. you're cutting the other videos down by minutes - it's super efficient to study with you
@MichaelSambol
@MichaelSambol 9 жыл бұрын
James Clark Thanks, James. More coming soon.
@psibarpsi
@psibarpsi 6 ай бұрын
An implication of Parkinson's Law.
@Tombalino
@Tombalino 8 жыл бұрын
Finally a clear, short and simple explanation :) On behalf of everyone, thankyou and good job
@tiannawrona9269
@tiannawrona9269 4 жыл бұрын
I've been watching hours of lecture videos talking about these and haven't understood them until your 2-3 minute videos! Thanks! Much less stressed now.
@prasputbest
@prasputbest 2 жыл бұрын
I've been almost a month learning it and still don't understand what it is. Now you can make me understand in 3 minutes. I love you and thank you. God bless you!!
@rayryeng
@rayryeng 3 жыл бұрын
Someone who can actually take on Siraj Rival's mantra of learning something in 3 minutes lol. Very well explained, especially for someone who has seen this before but needed a quick refresher. Thanks so much!
@JonathanRose24
@JonathanRose24 5 жыл бұрын
Getting ready for an interview and this is EXACTLY what I needed. THANK YOU!
@SuperBhavanishankar
@SuperBhavanishankar 4 жыл бұрын
hope you got selected
@BossKing1243
@BossKing1243 Жыл бұрын
Update?
@matejpersic6601
@matejpersic6601 4 жыл бұрын
bro for the last two years I come back to this video every once in a while because I need it for a different class.. Thanks, you're awesome :D
@sumitsapkota3792
@sumitsapkota3792 6 жыл бұрын
What my teacher teach for whole semester I can learn over a night on KZfaq. Why the hell I am paying my semester fee, Instead I should pay for high speed broadband.
@ROFEL
@ROFEL 5 жыл бұрын
what kinda teacher teaches dijkstra's algorithm for a whole semester?
@ramimxss
@ramimxss 4 жыл бұрын
@@ROFEL he meant everything his University or college covered in a semester,he is right though, sometimes
@SuperBhavanishankar
@SuperBhavanishankar 4 жыл бұрын
@@ramimxss s
@loot6
@loot6 3 жыл бұрын
There isn't anything you can't learn faster and more easily at home with the internet - all you need is motivation.
@blazingsniper1239
@blazingsniper1239 3 жыл бұрын
​@@loot6 so true
@antonhall2696
@antonhall2696 9 жыл бұрын
This is great! Short, simple and very easy to follow. I like that you've made the pictures beforehand and don't draw freely during the video. Liked and subscribed :)
@z.m.4331
@z.m.4331 7 жыл бұрын
You're exactly the type of human the internet needs! Thank you!! :D
@Majestic469
@Majestic469 4 жыл бұрын
This is actually legend. I searched up many long videos explaining it but only this short one helped me understand
@ogCharaLM
@ogCharaLM 8 жыл бұрын
Thank you for this. There aren't enough truly concise videos out there, and I was getting desperate.
@MyNguyen-ln1dv
@MyNguyen-ln1dv 7 жыл бұрын
You seriously need to make more videos about algorithm. They help me sooooo much. Thanks a lot
@fitwithrmj
@fitwithrmj 7 жыл бұрын
bro u save me just 13 hrs before my exam...
@pkgamma
@pkgamma 5 жыл бұрын
13 hours is a lot of time dude
@shadowagent3
@shadowagent3 4 жыл бұрын
nice now 3 years later i got an exam tomorrow. Hope i do really well.
@adamplayz-qf8ry
@adamplayz-qf8ry 4 жыл бұрын
Broo....
@martinluther7791
@martinluther7791 4 жыл бұрын
13 hrs. You're like a baby. Watch this S I X H O U R S
@sankalpmahajan443
@sankalpmahajan443 3 жыл бұрын
Nice
@mr.paarthurnax2649
@mr.paarthurnax2649 2 жыл бұрын
This explanation was awesome! So simple and concise. Thanks!
@iizvullok
@iizvullok 7 жыл бұрын
You just needed 7 minutes (actually less) to explain everything I did not understand in more than 3 hours! Thank you!
@AB-ld1rp
@AB-ld1rp 7 жыл бұрын
Excuse me for using your top comment, but I have to let people see this: Sorry, but this algorithm is incomplete and not capable of solving a problem that my professor gave me. It works for the simplest matrices, but that's that. As a proof try to solve this exercise as said in the video: find the shortest route from f to c. The matrix is: . a b c d e f a 0 2 4 0 0 5 b 9 0 0 7 5 0 c 4 3 0 8 0 0 d 0 3 9 0 0 6 e 6 0 0 5 0 0 f 0 5 0 6 3 0 The solution should be 13 (f-e-a-c) but with this algorithm you will never obtain it.
@JoMaFjErynMaLaZOr
@JoMaFjErynMaLaZOr 7 жыл бұрын
worked for me
@VandamePlays
@VandamePlays 6 жыл бұрын
There is an error in this explanation, I actually learnt the base of the algorithm here since the explanation is very simple and I came to find that it wasn't completely right. The error is when he says that we choose the edge with the minimal cost in order to visit a certain node, that's not the case, we have a list of the unvisited nodes and from all those nodes, the algorithm says that the next node to be visited is the node with minimal TOTAL distance to the origin, remember every visited node tries to update the adjacents nodes. You wrote this a long time ago, but I hope new viewers don't fall for the same mistake I did when I only based in this explanation.
@Khaleb_0
@Khaleb_0 6 жыл бұрын
but if that's the case where's his mistake? he always chooses the "cheaper" one realtive to the origin? or are you saying that his wording was poor?
@OrnateOwl
@OrnateOwl 6 жыл бұрын
I believe he's talking about the wording. The lack of explanation about how he did what he did for the sake of simplicity.
@TheJunkieBox
@TheJunkieBox 7 жыл бұрын
Short and sweet. We need more videos like this.
@emresarac2100
@emresarac2100 2 жыл бұрын
It's crazy the fact that a 3 min video teaches me way better than a 1 hour class video of my teacher. Why do teachers always struggle with teaching in a simple way?
@BossKing1243
@BossKing1243 Жыл бұрын
A lot of them become teachers bc they’re really intelligent and hardworking, not because they’re actually good at teaching
@Omenemperor2
@Omenemperor2 8 ай бұрын
@@BossKing1243 Can't agree more, most of them are good at doing research rather than teaching us
@harshsason3725
@harshsason3725 6 ай бұрын
@@BossKing1243 Yup exactly.
@ozancngz
@ozancngz 3 жыл бұрын
It was the most useful 3 minutes in my life . Thank you.
@godsepicgamer3825
@godsepicgamer3825 Жыл бұрын
EVERYONE explains this so hard this REALLY helped me thank you
@forever_stay6793
@forever_stay6793 20 күн бұрын
I showed up an hour late to class and missed the explanation for this. This 3 minute video explained everything I needed to know thank you!
@YouB3anz
@YouB3anz 3 жыл бұрын
This psuedocode rendition is nice, compact, and readable. Much better than a lot of the other ones you see.
@farzaadify
@farzaadify 9 жыл бұрын
This is like a quick revision during exams,Thank you .
@ethandenson7182
@ethandenson7182 6 жыл бұрын
do you mean review?
@pkgamma
@pkgamma 5 жыл бұрын
why tf do you have access to KZfaq during exam
@tangdexian3323
@tangdexian3323 6 жыл бұрын
I really like your approach, concise and to the point
@danielalvarez9404
@danielalvarez9404 6 жыл бұрын
Dude, I love you
@nawdawg4300
@nawdawg4300 5 жыл бұрын
These 2 min reviews are a god send! Final in 3 hours...
@indianpublic4543
@indianpublic4543 6 жыл бұрын
best videos ever .... to understand data structure in few minutes .. make more videos ..plz
@Bred0nSch00lV2
@Bred0nSch00lV2 5 жыл бұрын
A nice condensed little video. Thank you.
@JamesBrodski
@JamesBrodski Жыл бұрын
Great video! Thank you so much for making it.
@pedroraimundodossantosneto5846
@pedroraimundodossantosneto5846 2 жыл бұрын
Concise and straight to the point. Thanks =)
@E_D___
@E_D___ 10 ай бұрын
most Teachers in Uni are so focused on proving the algorithm works, and is the best way to do 'X' - to the point they dont notice, or care, if the students even understood what the algorithm does or even supposed to do. thank you
@thealiens386
@thealiens386 Жыл бұрын
Even 8 years later you're still saving lives with this
@dirtworm979
@dirtworm979 Жыл бұрын
Thank you! I fell asleep during my lecture, this was a lifesaver!!
@MichaelSambol
@MichaelSambol Жыл бұрын
Happens to the best of us 😴
@leonellbais1659
@leonellbais1659 3 жыл бұрын
you deserve a plenty of likes dude. i like how you shorten the video for us ❤️
@kevinzhang7228
@kevinzhang7228 7 жыл бұрын
Your videos are great!
@kevinqagish2287
@kevinqagish2287 6 ай бұрын
Alter Geile Meile ich bin die Ganze Zeit am versuchen die Funktion Anhand meiner Vorlesungsmaterialen zu verstehen und komm 0% vorwärts ... Ich gehe auf KZfaq schaue mir ein 3 Minuten Video and und verstehe es direkt! Vielen Dank!! Das Video is sau stark !!!
@MichaelSambol
@MichaelSambol 6 ай бұрын
Danke fürs zuschauen!
@jordancleeve7548
@jordancleeve7548 8 жыл бұрын
Awesome video thanks!
@sarveshpandey1125
@sarveshpandey1125 6 жыл бұрын
It's such a perfect explanation.
@semoreyad2933
@semoreyad2933 6 жыл бұрын
good , simple and clear explanation , thank you :D
@digvijayandhorikar936
@digvijayandhorikar936 8 жыл бұрын
GOod..fantastic.It was like the fastest way..PErfect man keep it up!!!!!!
@Yawneazy
@Yawneazy Жыл бұрын
thank you so much for this! Life changing
@brandoncazares8452
@brandoncazares8452 Жыл бұрын
Thanks, Michael this video's very helpful.
@ManhTran-ry9ux
@ManhTran-ry9ux 4 жыл бұрын
OMG, finally all my semester can wrap up by approximately 3 minutes =)))
@kaliferguson2232
@kaliferguson2232 Жыл бұрын
Very clear explanation. Thank you!
@gedeonandrasmusic
@gedeonandrasmusic 6 жыл бұрын
Very great, thanks for your help!
@epiclasersharks1866
@epiclasersharks1866 2 жыл бұрын
your videos are the best. Nobody wants to watch a 20 minute video just to pass their exam
@houssemdhiab7337
@houssemdhiab7337 8 жыл бұрын
thank you dude for saving my life :D
@jimkash7133
@jimkash7133 6 жыл бұрын
a truly inspired work 10/10
@davidboublil
@davidboublil 8 жыл бұрын
thank you so much!!! You saved my life (again)
@abrar-zahin
@abrar-zahin 8 жыл бұрын
thanks! this really helped me a lot!
@Shkencetari
@Shkencetari 6 жыл бұрын
Great tutorial. Thank you very much.
@audiomac
@audiomac 6 ай бұрын
My textbook never told me what "cost" was. It randomly started using that term. Thanks!
@chiminim424
@chiminim424 4 ай бұрын
Bro u truly are the best keep up 🔥
@matthewblom1620
@matthewblom1620 Жыл бұрын
Incredible video. Thank you you hero. So many videos of 20 minutes + that cannot get to the point.
@MichaelSambol
@MichaelSambol Жыл бұрын
💪🏼❤️
@andywei5518
@andywei5518 4 жыл бұрын
unsw trimester is very busy, but thanks, you saved me a lot of time ~ ! ! !
@davidwong666
@davidwong666 Ай бұрын
Gonna have my final exam in 15 mins and I am here reivising the last topic taught in the lecture. Thanks!
@lalwho
@lalwho 8 жыл бұрын
cool video series for a quick recap before the exams...
@mrsword6493
@mrsword6493 2 жыл бұрын
I like how those videos are 2-3 minutes but it always take me 15+ minutes to watch them to the end
@MidnightBloomDev
@MidnightBloomDev 4 жыл бұрын
When you have 30 minutes before final semester exam but you didn't study at all
@calebkrauter4027
@calebkrauter4027 Жыл бұрын
This is so good. Thanks!
@dulithfernando3241
@dulithfernando3241 7 жыл бұрын
Nice work bro. i understood very well. your totally an awesome teacher. way to go man. thank you very much this was really helpful. keep up the good work. :) (Y) Tc.
@daannii48
@daannii48 6 жыл бұрын
this was so helpful! thanks
@josemunguia5660
@josemunguia5660 6 жыл бұрын
Great video! Thanks!
@elitiacandy1540
@elitiacandy1540 7 жыл бұрын
Very helpful. Keep going :)
@AACVOMMIDHARANI
@AACVOMMIDHARANI 11 ай бұрын
Thank you soomuch yaar you made my day much better
@djbr0812
@djbr0812 Жыл бұрын
watching your videos is like "preparing your final in 3 minutes" :)
@easyas-is
@easyas-is 4 ай бұрын
2024 here and you are a genius for explaining the algo so clear
@cantorbernoulli4407
@cantorbernoulli4407 2 жыл бұрын
my man thanks for saving me time
@li-pingho1441
@li-pingho1441 3 жыл бұрын
The best tutorial ever
@thanasulas08111994
@thanasulas08111994 9 жыл бұрын
Simple and well explained. Thank you very much! It would be really great if you could make a video for Bellman-Ford algorithm too.
@MichaelSambol
@MichaelSambol 9 жыл бұрын
thanasulas08111994 ***** Working on it now!
@MichaelSambol
@MichaelSambol 9 жыл бұрын
kzfaq.info/get/bejne/pciHi82lzJawZmg.html
@spinningninja2
@spinningninja2 5 жыл бұрын
*_BLESS THIS MAN_*
@georgeoneal3641
@georgeoneal3641 Жыл бұрын
Thanks a whole lot. However, from 1:41 why do we use the weight 3 instead of weight 1? That is the only thing I do not seem to understand. Thank you in anticipation of your response.
@whannabi
@whannabi 6 ай бұрын
I don't understand what you're asking but one thing to keep in mind for others that might see your comment is that we add the value of the node you're in to the value of the node you want to go to and compare that result to the current value in your node list for the one you want to reach. If it's infinity then you place it but if it's equal or smaller than your sum then don't change it.
@godisgreat9749
@godisgreat9749 2 жыл бұрын
thank you, straight to the point,
@narjesalaa98
@narjesalaa98 5 жыл бұрын
Well, i have just 3 hours before my exam :) thx!
@elvischen6390
@elvischen6390 4 жыл бұрын
I like these well-explained tutorials so much. If you don't mind, I would like to ask your permission to share these tutorials to the other website in China for the embarrassing reason that KZfaq is blocked from accessing in China with translations. Of course, I will give sources of the original link. Appreciated.
@TFTAlecUchiha
@TFTAlecUchiha 3 жыл бұрын
You are such a king
@ChaoZonic
@ChaoZonic 8 жыл бұрын
Thanks for the excellent video: I now know how to pronounce Dijkstra!
@ubaidurrehman4377
@ubaidurrehman4377 6 жыл бұрын
Thanks, good Tutorial
@LioHmusic
@LioHmusic 6 жыл бұрын
Exam saver!! Thanks
@akshaynarasimhan2
@akshaynarasimhan2 Жыл бұрын
wow! Love this video!
@tannerkrebs1343
@tannerkrebs1343 7 жыл бұрын
Great videos. I have a few suggestions if you're open to the ideas? A video on bio-connected components and Articulation vertex. Breadth First search and Depth First Search. Thanks!
@Daniel-iy1ed
@Daniel-iy1ed Жыл бұрын
You are amazing man 🤩🤩
@prantaroy475
@prantaroy475 8 жыл бұрын
Easiest ! Thanks Dude
@Brian-oo3pb
@Brian-oo3pb 5 жыл бұрын
hey, ever thought about doing a video like this on the A* algorithm?
@BharatSingh-zk8lx
@BharatSingh-zk8lx 8 жыл бұрын
You r saving my day😂😂😂
@kautukraj
@kautukraj 4 жыл бұрын
Very helpful!
@grizius4123
@grizius4123 4 жыл бұрын
man u saved my ass for real thanks man i subbed
@vado4003
@vado4003 Жыл бұрын
It was a bit hard to grasp this but we use a queue because we want to process a node by the fastest way we got to that node, i.e., if we could get to A with 5 and there is an option later to get there with 7, 5 is always preferred
@mohsendehbashi8629
@mohsendehbashi8629 6 жыл бұрын
Isn't there a better implementation for priority queue used in pseudocode? First pushing source node to queue then after relxing edges push adjacent nodes inside queue ... hom?
@deepaksinghpana5097
@deepaksinghpana5097 6 жыл бұрын
Thank you soo much dude..
@Kubaguette
@Kubaguette 5 жыл бұрын
You are my Hero
@lolejunior3168
@lolejunior3168 3 жыл бұрын
My g saving people life right now
@andrejtrozic9476
@andrejtrozic9476 2 жыл бұрын
Sir...thank you very much!
@zenadineallan5220
@zenadineallan5220 3 жыл бұрын
You have a new SUBSCRIBER
@Siigrit
@Siigrit 14 күн бұрын
Exam in 1 hour, thanks for this!
@24Ship
@24Ship 2 ай бұрын
you're an angel
@skelswap
@skelswap Ай бұрын
had to catch up after not going to a lecture, but i cant imagine how tf it took an entire lecture to explain this and one other algorithm
@abidux
@abidux 4 ай бұрын
Great video
Bellman-Ford in 4 minutes - Theory
3:57
Michael Sambol
Рет қаралды 305 М.
Final increíble 😱
00:39
Juan De Dios Pantoja 2
Рет қаралды 35 МЛН
WHY DOES SHE HAVE A REWARD? #youtubecreatorawards
00:41
Levsob
Рет қаралды 41 МЛН
WHY IS A CAR MORE EXPENSIVE THAN A GIRL?
00:37
Levsob
Рет қаралды 18 МЛН
Prim's algorithm in 2 minutes
2:17
Michael Sambol
Рет қаралды 1,1 МЛН
Merge sort in 3 minutes
3:03
Michael Sambol
Рет қаралды 1,1 МЛН
microsoft's new AI feature is an absolute dumpster fire
9:34
Low Level Learning
Рет қаралды 37 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,3 МЛН
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН
Bellman-Ford in 5 minutes - Step by step example
5:10
Michael Sambol
Рет қаралды 1,3 МЛН
Heap sort in 4 minutes
4:13
Michael Sambol
Рет қаралды 939 М.
Final increíble 😱
00:39
Juan De Dios Pantoja 2
Рет қаралды 35 МЛН