Dijkstra Algorithm Example

Поділитися
Вставка
  • Опубліковано 7 лис 2024

КОМЕНТАРІ • 174

  • @kajalsharma8760
    @kajalsharma8760 8 років тому +77

    yes this is one of the best explaining video on UA-cam ..other videos just messed me up

  • @hotbananas
    @hotbananas 10 років тому +18

    So far the best explanation I've seen of this algorithm on UA-cam as most people leave out the fact that you need to store the best parent node of how you got to the node, then follow the parents backwards from the end to the beginning to actually find the path you wanted. Good work.

  • @rickandmorty6504
    @rickandmorty6504 4 роки тому +4

    The best explanation I have seen so far. Much better than many other lengthen and cumbersome tutorials.

  • @barngrader
    @barngrader  10 років тому +43

    I have posted a second example of Dijkstra's algorithm, using modified notation that is slightly less cumbersome. : ) It is called "Dijkstra's Algorithm: Another example."

  • @SENSATIONALOOP
    @SENSATIONALOOP 10 років тому +9

    This is absolutely the best example I've come across. Thank you!

  • @milenaspiridonova6478
    @milenaspiridonova6478 3 роки тому +1

    Excellent explanation! What was lacking in the previous videos I checked from different sources is the final explanation of how to backtrack the road from point a to g! Great!

  • @LimeGreenTeknii
    @LimeGreenTeknii 5 років тому +3

    3:19 Thank you for showing that if you find a longer path, you keep the old number instead.

  • @ErfanHossainShoaib
    @ErfanHossainShoaib 9 років тому

    Really there has no doubt on that it is the best explanation on the Dijkstra's Algorithm. Thanks

  • @AlieDenno
    @AlieDenno 8 років тому +1

    Thanks, such a great explanation.
    Wish if youtube brings this video as a first result when searching for Dijkstra-Algorithm because it concludes everything.

  • @sudipto80
    @sudipto80 10 років тому

    I watched a lot of videos to understand this algo. I found this one to be the most clear and concise. Very nice. Please post more!

  • @maddisoncase1452
    @maddisoncase1452 10 років тому +3

    You are a wonderful human being. I thank you enormously for this. Stay well!

  • @ShanesDominoez
    @ShanesDominoez 8 років тому +23

    Very well done. Explained clearly. Thank you! :D

  • @menukawarushavithana6287
    @menukawarushavithana6287 7 років тому

    This is the best explanation I found after a lot of searching.

  • @tryingtocorrect
    @tryingtocorrect 8 років тому +3

    Best one, if wants an algorithm for this and make a quick code solving
    it. I just create my C++ implementation using this and works well. Was
    easy to implement because you described it the way computer thinks.
    Thanks.

  • @JungeApfel
    @JungeApfel 8 років тому +3

    The best explanation I could find. Thank you

  • @kenchen3902
    @kenchen3902 10 місяців тому

    Thank you so much! This example is great. I was wondering what to do if the path isn't continuous.

  • @lensssle
    @lensssle 5 років тому +1

    I've seen many Dijkstra's algorithm tutorials on youtube and this is by far the best in my opinion :) thanks!

  • @robocu4
    @robocu4 7 років тому

    Thanks for the pick me up, nothing I was looking at was outlining this as well as your example did.

  • @shashank6721
    @shashank6721 8 років тому

    thanks a lot sir you explained in such an easy way i was not able to understand it in my class thanks a lot sir you made my day

  • @JacksonMiller55
    @JacksonMiller55 8 років тому +1

    Thank you so much for posting such a great, easy to follow, and very clear interpretation of Dikra's Algorithm! This was very useful in studying for tests!

  • @aaronm3467
    @aaronm3467 7 років тому

    Thank you for this. Has completely de-mystified the whole algorithm for me.

  • @canadianrepublican1185
    @canadianrepublican1185 8 років тому +11

    This is a much better way to explain this in comparison to my Comp Sci classes way.. Thanks!

    • @JS-bo7qk
      @JS-bo7qk 7 років тому +6

      CanadianRepublican shut up

  • @teteecheng4599
    @teteecheng4599 10 років тому +2

    omg so helpful!!! I have been looking for this kind of teaching video for few hours and this one is the most helpful one!! clear and really really helpful!! thank you!

  • @metalskulkbanepl161
    @metalskulkbanepl161 4 роки тому

    Finally a smooth explanation. Why every other video as to look so messy?

  • @deviloflove195
    @deviloflove195 6 років тому

    Finally someone who showed how to find the shortest path!

  • @TheQueader
    @TheQueader 10 років тому

    Best explanation on UA-cam!

  • @AegisOfFreedom
    @AegisOfFreedom 9 років тому +1

    barngrader Thank you! THANK YOU!! Nice pace and very clear.

  • @swethajeyagopal5922
    @swethajeyagopal5922 6 років тому

    very well explained sir... thank you.... helps for last minute preparations.. best one

  • @ed7731-s4s
    @ed7731-s4s 10 років тому

    Thanks Man, i think this is the best explanation ive come across so far. Great job !

  • @Graskian
    @Graskian 10 років тому +1

    Good job man! Really nice video. Beautiful explanation of Dijkstra!

  • @srijitbhattacharya6770
    @srijitbhattacharya6770 9 років тому

    this was the simplest explanation one can hope for. thanx :-)

  • @TheFinalStand7
    @TheFinalStand7 6 років тому

    Just helped me get another 5 marks in my final exams. Cheers bro!

  • @sukhanjotsingh9281
    @sukhanjotsingh9281 4 роки тому +2

    bro where are e and g gone

  • @Yanca
    @Yanca 8 років тому +3

    thank you for the clear explanation! did my homework using your examples and they're a bigger help compared to the book! ^^

  • @rubberlung1
    @rubberlung1 6 років тому

    Clear explanation and nice voice.

  • @e_kalonji
    @e_kalonji 5 років тому

    Thanks a lot!!!
    Short,clear,concise!!!

  • @ruhitaj4826
    @ruhitaj4826 8 років тому

    The best explanation for dijkstra's!

  • @godzabomni4148
    @godzabomni4148 4 роки тому

    Nice tutorial just plain simple and easy to understand!

  • @summerlamb7890
    @summerlamb7890 10 років тому +1

    God bless you Sir and this is the best and most helpful for this algorithm thank you very much for the help

  • @mona716
    @mona716 5 років тому

    This explanation was amazing! So clear and easy.

  • @w1ndro1d
    @w1ndro1d 5 років тому

    Excellent method and notations.
    However, does this method have a limitation? By this method I can know that there exist multiple shortest paths in some examples but I can determine just one of them by backtracking from destination. I am able to find their length too but just one path is resulted. Am I missing something?

    • @barngrader
      @barngrader  5 років тому +1

      The algorithm finds the shortest (minimum weight) path, but it does not find multiple paths. As you go along, you may find places where alternate paths also of minimum length are indicated, but you are right that only one path results from the algorithm as it stands.

    • @w1ndro1d
      @w1ndro1d 5 років тому

      @@barngrader exactly what I was thinking. Thanks!

  • @MrCooladam17
    @MrCooladam17 8 років тому

    How are you weighting them? Are the weight numbers arbitrary or is there a method to determine the weight of said numbers?

  • @cristianouzumaki2455
    @cristianouzumaki2455 9 років тому

    Your video was too good, i learned a lot, Thanks for ur efforts!

  • @Gabriel38196
    @Gabriel38196 6 років тому

    my man thanks for this

  • @SpaceMarine113
    @SpaceMarine113 7 років тому

    insanely good explnation skills

  • @TheJoshNguyen
    @TheJoshNguyen 8 років тому

    Excellent and clear explanation. Thank you!

  • @mewaelzere4430
    @mewaelzere4430 8 років тому

    Precise and clear. Very helpful video. Thanks sir!

  • @albertbuenavidez6415
    @albertbuenavidez6415 7 років тому

    how to creat an animation like that ? what app did you used ?

  • @ilyamofidian1288
    @ilyamofidian1288 9 років тому

    So useful.Thank you very much! In a very simple way explained.

  • @manavbirdhillon1116
    @manavbirdhillon1116 10 років тому

    its fantastic way of explanation

  • @maria777rawr
    @maria777rawr 8 років тому

    best explanation on youtube. thanks!

  • @melissavollebergh7353
    @melissavollebergh7353 7 років тому

    this is SOOOO clear; thanks very much!

  • @133major7
    @133major7 9 років тому

    sorry , i can`t understand last step that you explaining how to reach from a to other nodes

    • @barngrader
      @barngrader  9 років тому

      ***** Try watching my other video about the same algorithm. If that doesn't help, post here again and maybe I can try to explain....

    • @133major7
      @133major7 9 років тому

      OK my friend iam mohamed atallah and iam 29 years old from Egypt
      i see your two examples but i can`t understand how you finally reach from node to other node?

    • @barngrader
      @barngrader  8 років тому

      +133major
      The algorithm must be repeated to find minimum paths from a different starting point. Once through the algorithm only works for a specified starting point. As for how to get from specified start to specified end, watch the very end of the video about how to compute the path and the length....

  • @pudasainianjan
    @pudasainianjan 7 років тому

    wow...so nice way to explain....Thanks...

  • @kokoskox7792
    @kokoskox7792 5 років тому

    Hello.
    Sir, why do you do not have "e" at vertices column?
    You have vertices as follows: a,b,c,d,f in vertices column, but you do not have "e" there.
    Why it is so?

  • @climbeverest
    @climbeverest 9 років тому

    While I understand the explanation, what would the algorithm do, would it be iterative or recursive, when would it decide it is done, sorry I am starting back into understanding data structures, if this question seems trifle.

  • @rachelstewart9620
    @rachelstewart9620 8 років тому

    This explanation is great!

  • @nardosabraham-w9v
    @nardosabraham-w9v Місяць тому

    All i can say is thank you very much❤

  • @aAlexiOS
    @aAlexiOS 8 років тому

    It's all good, but your algorithm doesn't know when you've found the least cost for all nodes. The algorithm should only stop after having looked at each vertex and thus verifying that it truly is the lowest cost possible. (and for detection of edges with negative costs)

  • @TheRocketsbackagain
    @TheRocketsbackagain 9 років тому +1

    Thank you so much... awesomely explained...cheers

  • @pauleaggymandengue3135
    @pauleaggymandengue3135 4 роки тому

    thank you for this explanation it clear and easy !

  • @gistigistambo
    @gistigistambo 7 років тому

    Very good video, one of the best I have seen on this topic, but it would be helpful if you use a color that is more contrast to black ( instead of blue) because on some screens ( combined with bad eyes ) blue looks like black :)

  • @pravinaparmar4065
    @pravinaparmar4065 5 років тому

    thank u so much, wonderful method for shortest path

  • @sumanthdodda8304
    @sumanthdodda8304 5 років тому

    Such a great explanation thank you very much sir!

  • @samrox687
    @samrox687 9 років тому

    That was awesome. Great work and thanks a ton...............

  • @leandrosatyawirationanda8166
    @leandrosatyawirationanda8166 Рік тому +1

    Legend

  • @xkhokokox
    @xkhokokox 9 років тому +3

    This helped me through. thank you alot buddy! :)

  • @souravkundu9602
    @souravkundu9602 9 років тому +4

    This is a great video, thank you. I'd say it's much better than the other ones. =)

  • @danielsepulveda9768
    @danielsepulveda9768 10 років тому

    It may sound like a stupid question, but shouln´t b/b be = 0, Just like a/a? (1:53) If anyone know the answer, could you please give a brief explanation.
    All the best.

    • @barngrader
      @barngrader  10 років тому +2

      The table we build shows distances to the various vertices starting from vertex a. The left-hand column is not indicating where paths start, but through which vertices the path from vertex a progresses. Of course the shortest distance from b to b is zero, but the table is not going to give us that. If we want distances beginning with vertex b, we would have to make a new table. : )

  • @romeshfernando2959
    @romeshfernando2959 5 років тому

    The best way to reach to G is ACFG. Why did you take ACG ?

    • @barngrader
      @barngrader  5 років тому

      I didn't take ACG.....I took ACFG, which is the best (as you say). Look at the last entry in the last row....The length from A to G that is shortest has weight 9, and the vertex it hits right before G is F.....

  • @francescovanspronsen2377
    @francescovanspronsen2377 6 років тому

    Your voice has an ASMR effect

  • @janah701
    @janah701 7 років тому

    I have question for graph theory Can you help me ?

    • @barngrader
      @barngrader  7 років тому

      I can try....What is your question?

  • @ahmadjarkas4334
    @ahmadjarkas4334 9 років тому +1

    Excellent work Thank you

  • @nikolastamatovic9481
    @nikolastamatovic9481 4 роки тому

    3R ima li nas?

  • @sam.kendrick
    @sam.kendrick 6 років тому

    I appreciate the work!

  • @baz7915
    @baz7915 6 років тому

    this is gold!! thank you so much!

  • @adelalkhafaji4302
    @adelalkhafaji4302 9 років тому

    Thanks a lots, it was really useful explanation

  • @viewtifulviewer7282
    @viewtifulviewer7282 10 років тому

    Wow thank you so much! This was very helpful to me!!!

  • @MaxwellPietsch
    @MaxwellPietsch 9 років тому +2

    I like how you went straight to an example. Another video talked about Dijkstra's Algorithm. Not much to talk about though. I liked your video better. Learn by doing as they say.

  • @PhDPerfect
    @PhDPerfect 7 років тому

    Amazing Explanation!

  • @onieltelies4953
    @onieltelies4953 9 років тому

    Thx dude. It helped me a lot.

  • @rohhaanthambithurai9125
    @rohhaanthambithurai9125 3 роки тому

    Thank you Matthew McConaughey

  • @mikehuter
    @mikehuter 10 років тому

    Great video, perfect solution

  • @tomasfrancisco28
    @tomasfrancisco28 10 років тому +5

    Thank you. It was really usefull :)

  • @TheAgentTexas
    @TheAgentTexas 8 років тому

    Great explanation!

  • @palcente
    @palcente 10 років тому +1

    excellent video

  • @janelain8611
    @janelain8611 Рік тому

    Thank you so much! I think I finally get it

  • @Gvardreptile
    @Gvardreptile 10 років тому

    guys can anyone tell me what's the usage of this alghoritm ,how it helps to code everyday programms and sites

    • @icecubatron
      @icecubatron 10 років тому +1

      its used in the Open Shortest Path First (OSPF) routing protocol

  • @mohamedmody7675
    @mohamedmody7675 10 років тому +3

    That's the best .. Thanks alot

  • @alvesdds
    @alvesdds 10 років тому

    What if I want to travel to A but going through all other points only once

    • @barngrader
      @barngrader  10 років тому +1

      That's not what the Dijkstra Algorithm was built for. You would have to use a different algorithm to answer your question....It also would depend on where you started from. Your question is not specific enough....

    • @ItWasAnAcident
      @ItWasAnAcident 10 років тому

      Prims algorithm

    • @YajurVlog
      @YajurVlog 10 років тому

      barngrader and i think tat one travelling salesman algo

  • @mirat9155
    @mirat9155 8 років тому

    awesome !!!! clear concept !! thank u

  • @alvesdds
    @alvesdds 10 років тому

    Sorry you are right well my question was actually out of context. I was searching for an algorithm to solve a TSP.

  • @007tene
    @007tene 9 років тому

    best explanation on youtube ty :*

  • @mohameera2101
    @mohameera2101 8 років тому

    can u give us the code ?

    • @barngrader
      @barngrader  8 років тому

      +Moh Ameera
      What do you mean by "the code?" I have explained the algorithm; there is no "code"....

    • @mohameera2101
      @mohameera2101 8 років тому

      im just asking if u have a java code for it ?

    • @finestHQ
      @finestHQ 8 років тому

      ... code is problemspecific

  • @amberbdr8168
    @amberbdr8168 6 років тому

    Thank u sooooooooooooooooooooooo much, Crystal clear.....

  • @RojasDesign
    @RojasDesign 9 років тому

    Thanks alot for this usefull video!

  • @xuchenyang3547
    @xuchenyang3547 9 років тому

    Nice and clear, thanks.

  • @ruchit_kadakia
    @ruchit_kadakia 8 років тому

    Too good...Thank you so much :)

  • @pimbolii1000
    @pimbolii1000 8 років тому

    very good explanation!!

    • @thetruereality2
      @thetruereality2 8 років тому

      Is there a reason why he stopped at f, he should have gone all the way to e right?

    • @barngrader
      @barngrader  8 років тому

      The last two rows we could have added (including vertices g and e in the left-hand column) would not change anything in the "f" row, so we decided not to write them in. It would just be a waste of ink, as we already have all the answers we need.

    • @thetruereality2
      @thetruereality2 8 років тому

      Right, but as a part of a algorithm the checking should have taken place right?

    • @barngrader
      @barngrader  8 років тому

      I guess I'm not sure what you're worried about....That last row in the video shows the completion for every destination, starting at point "a"....What is missing? If we wrote the row twice more, we would have three copies of the same row at the end. This seems like a waste of ink to me and unnecessary.

    • @zeroimpetuous
      @zeroimpetuous 8 років тому +1

      you could assign the value of g from d as 5+1 = 6 but you chose 12. why?

  • @thymiosf
    @thymiosf 8 років тому

    Very helpful! Thanks!