Dijkstra algorithm | Single source shortest path algorithm
ฝัง
- เผยแพร่เมื่อ 25 ส.ค. 2024
- In this video,I have explained how to find the shortest path from a given source to all other nodes or vertices in a graph.In this video, i have explained the dijkstra algorithm which is a well known shortest path finding algorithm.This algorithm is also known as single source shortest path algorithm because here we find the shortest path from a vertex to every other vertex.I have explained the process and intuition for all steps of dijkstra algorithm by taking suitable examples.I have explained the time complexity at the end and have also explained where dijkstra algorithm won't work.In the next video,I will show how to code and implement dijkstra algorithm.If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)
========================================================================
Join this channel to get access to perks:
/ @techdose4u
INSTAGRAM : / surya.pratap.k
SUPPORT OUR WORK: / techdose
LinkedIn: / surya-pratap-kahar-47b...
WEBSITE: techdose.co.in/
TELEGRAM Channel LINK: t.me/codewithT...
TELEGRAM Group LINK: t.me/joinchat/...
=======================================================================
USEFUL VIDEOS:-
Spanning Tree (MST): • Spanning Tree | MST | ...
Prims algorithm: • Prims algorithm | MST ...
Kruskals algorithm: • Kruskals algorithm | C...
Kruskal algorithm implementation: • Kruskal algorithm impl...
Amazing channel.I found this channel in lockdown and now i become fan of this channel....
Thanks bro.
me too
same here
I have spent many many hours trying to understand djikstra, and you just explained it clearly in 12mins. I finally get it now.
Nice :)
waah sir kya baat h , itne kam time me itne clearly dry run karke samjha diya aapne...
RESPECT
Thanks
Watched many different videos but understood well in this video. His way of teaching is great
Thanks :)
Really. Your channel is one of the hidden gems of TH-cam :).
Thanks bro.
Please provide links to actual code if possible (preferably in c++). You are an excellent teacher btw. I hope this channel grows to become more famous.
Thanks. I provided code link.
i am going to mark these number of views because there is going to be a time when this channel will become huge and i will be able to remember that i was there when it had mere 2k views.
Thanks bro ❤️
You guys keep increasing the beauty of TH-cam day by day❤️
❤️
i am very thankful sir after after watching your video i decided to read the data structure .. thanks sir for making videos. i can't express my happiness thank you sir : )
Welcome :)
I wanted that if someone could help me in giving the crux behind its working, the video is great and might be helpful for audience, but these are the steps which is being followed more of a "do this to get ans". I am not even getting the info for a lot of things going into this algorithm just because not able to get the "why" of an algorithm, but thanks for the great efforts, you have put in for creating the video👍🏻
Graph playlists are really helpful
Thank you 🙏🙏
Welcome :)
One of the best explanation + implementation on Dijkstra. Thanks!
This man has amazing teaching skills...
😅 Thanks
Awesome,new channel and best graphical repersentation making understanding easier.
Thanks :)
Your decision to make graph playlist is successful 🙏🏻
Nice to hear this :)
differnce between dijkstra and minimum spannin tree is that, In dijkstra you have to minimize distance from starting node to each other node in a graph, while in minimum spanning tree you have to minimize the total cost to cover all the nodes in the graph it does not matter if cost from starting node to any node is munimum or not total cost to visit all the node must be minimum.
Great video. By the end of this year I might complete watching most of the video. Only few left 😅☺️
Great ❤️
What an explanation sir really awesome.Your videos are helping a lot for my preparation.Thankyou sir.
Welcome :)
Thank you man for all the effort you put into this!
Small correction @ 11:55.
The shortest path is NOT DEFINED in case of negative weight cycles. So not only Dijkstra but no algo would work on a graph having a neg cycle. However, Dijkstra may or may not produce the correct answer in case there are Neg Edges unlike Bellman Ford.
Good one
Really such a beautiful and helpful explanation 😊
Thanking you so much sir 😊☺️
Welcome bro :)
I understood it so well!
Nice :)
Damn ..his explaination
sir I really love the way you explain.can you make videos on floyd warshall and bellmanford algorithm
It will come soon.
Thanks bro;! Amazing...!!!!
Welcome :)
Awesome work buddy
Other than increasing cost, I think prims algo and Dijkstra looks very similar.
Big fan of your explanation. Thanks for amazing work. On same topic of Graphs, wonder if you can cover Tarjan algorithm when you get chance...
Famous related question: 1192 Critical connections in n/w.
Thanks. Sure I will cover tarjan's algo. But currently I am just focussing on completing Algorithms. After this I will start with other topics and meanwhile I will keep adding problems on related graph topics to make it fully complete. This way I won't get stuck at just one topic for long. Graph videos takes a lot of pressure 😅
Nicely explained 👍
Thanks
Hi sir,
Please make a video on how to prepare for interview for people with experience in service based company for 2 years. And what roles they can apply for product based companies. Is it required to prepare system designs as well?
You can ask me this over chat. I will let you know. Use LinkedIn or Instagram.
Video is very nice . I didn't find the Code link for this algorithm
Check description
Explanation :- Awesome since forever.
Thanks 😊
Hi,
At 10:08 , How/when did you compute that node 2 will be connected to node 0 and not with node 1, 3 or 4.
Means, I am not getting how are you deciding the parent child relation for the Final Graph
When the node 2 is included in the processed set , then we see how we are reaching node 2 in particular at that snapshot. At the time it is being included in processed set the minimum distance is from node 0 which is 4. There should be another array which stores the link of each node to its connector in terms of minimum weight, but that is not shown here.
Really great video, enjoyed it a lot. @techdose - What software are you using for writing in the black board ?? Just curious :)
Thankew sir ❤❤..sir please upload warshall, Tarjan and kosaraju algos, when you will get time ☺
Yea sure. I will upload them don't worry.
@@techdose4u thankew sir
Welcome :)
Please give code using priority queue because adding new nodes to priority queue will increase the time complexity
Why set data structure is used here?
You can use array as well. Just to mark the nodes which are processed
@@techdose4u Thank you!!
This subject is wild man. Like seriously wtf is even going on 😂
I have a question here, what if the weight from 0 - 1 & 0 - 2 are 1, since both are same, which one has to be picked? if 0 - 2 , the total path will have more weights compared to 0-1 path 🤔
nah If 0-2 is picked then after that 0-1 will be picked as no other candidate will be suitable for the job (candidate will include 2 adjacent nodes)
hello sir , may u plz tell me from where I can get code for this
Can we use simple BFS instead of Dijkstra's algorithm ?
that would work for finding the shortest path based on the number of edges, but if each edge is weighted it wont work
This is an amazing explanation. Quick question - can this algorithm still work from any source to destination specified by user input for example?
sir plzz yeh dijkstras algorithm ke notes aur coding send karde takhe mein apne paas download kar sakhun plzz?
Wow . Middle of the night
Haha 😂 Just completed editing.
Not sure why is it called shortest path. We are actually trying to minimize the path cost :')
What if the weight of the edge represents the distance between two nodes?