Dijkstra's takes a bit to comprehend but I found it useful to keep in mind your introductory declaration that the aim of Dijkstra's Algo'm is to find the shortest path between two vertices. This implies that every path's distance is calculated and compared. Remembering this helped me understand this video (which I so happened to view several times).
@spleen3879 жыл бұрын
I noticed you didn't keep track of the vertexes/path that you took to each node to give it its score. that makes it a little unclear as to why you traced the path that you did in the end
@aaronsmarrella32398 жыл бұрын
Going backwards from A to G, you look at where the current vertex weight was, since a few vertices had the numbers marked out, that means that that edge is no longer the shortest path. For example, when he went from A, he did not go from A to C because that gave a value of 15, where 13 is less- So B is next, then from B he did not go from B to E because its value was marked as 13 and the lowest was 12-so D. From D the lowest value was 9 not 10 so he went from D to E, not F because D to F was 10, and lastly from E he went to G because it had a value of 7. Again, he did not go from D to F to G because that gave a value of 4 + 6 or 10. and 10 is higher than the value of 9 given to D. So he simply went back the path that gave the lowest number. He didn't keep track of the vertices/path as he was going because it could easily be changed as he went on depending on which edge gave the lower value. He would have to keep on marking it then removing it. It gets easier to follow the final path by looking at the numbers on the vertices and which numbers got marked out so you don't go down the wrong path. I hope that makes sense
@spleen3873 жыл бұрын
@Hortensia Wolfing it's a scam lol dont fall for it
@monoman40833 жыл бұрын
marking not clear for route back at b+d
@fauzytech7 жыл бұрын
should we do trackback in the end?
@89coolsush10 жыл бұрын
Very clear and to the point. Good work.
@senthilkumarb27618 жыл бұрын
way of explanation is fantastic
@Mathispower4u8 жыл бұрын
Thank you for the comment.
@nunosm91069 жыл бұрын
Best tutorial on youtube
@Mathispower4u9 жыл бұрын
+Nuno SM Thank you for the comment and for watching.
@syedmasroorhussain4 жыл бұрын
How did you calculate the last shortest path? The one which is labelled 13? I'm confused because you used all the vertices and chose a different path containing less vertices than the total amount of vertices
@chelseygiot83904 жыл бұрын
Hi, in graph data structure, if average path length is 2π and a longest geodesic of ≥ 6π, how to draw node- link diagram ?
@isabelelsneralmonte55128 жыл бұрын
Hey, what if i have a much large number of vertex? is there a way to do it faster?
@jonathanorozco56898 жыл бұрын
Such a good video. THANK YOU.
@MujeebulHasan9 жыл бұрын
How do you find shortest Path is ABDEG ...
@SlavqBeats9 жыл бұрын
Mujeebul Hasan Yeah, I'm wondering the same thing...
@Imfors4ken9 жыл бұрын
Hi.. I had the same question at first but then I came with a solution ... just add a name of the vertex, which was the starting point for the shortest value (path). So 13-B, 12-D, 9-E, 7-G. What do you guys think ?
@SlavqBeats9 жыл бұрын
I've implemented it and it works when i do something like this: Start from starting vertex (A in this case) and go to neighbor vertex with less edge weight + vertex distance. So in this case, we don't go to C, because 4+11 > 1+12. So we go to B. Then we go to D, because 3+9 (D) is less than 6+7 (E). Then, from D we go to E because 2+7 (E) is less than 4+6 (F) and less than 2+11 (C). And so on, until we reach destination vertex G.
@lucyjenny19879 жыл бұрын
Mujeebul Hasan we have an extra tag for parent node at each node. when a node's distance gets updated because of a previously visited node, its parent node gets updated. for eg, in the above example, when D's distance changed from 10 to 9, its parent change from F to E.
@spleen3879 жыл бұрын
+Lucy Jenny that's how its supposed to be done XD
@sudipsah93957 жыл бұрын
but you have visited vetex F also and you have marked it
@mohammadrostami61255 жыл бұрын
You made my day.
@sensei010110 жыл бұрын
Briliant, just briliant
@amateurbeginner75387 жыл бұрын
It not that some people has some will power and some dont , it is that some people are ready to change and others are not :) :)
@vikasraj94979 жыл бұрын
why shortest path from only a,b,d,e,g.why not a,b,e,g or a,e,f,g.
@slowdown_9 жыл бұрын
+Vicky Torronto first: a,e,f,g is not possible. second a,b,e,g is 14 so its not the shortest ? if u cant simple math then u are wrong here...