Dijkstra algorithm | Single source shortest path algorithm

  Рет қаралды 84,665

Techdose

Techdose

4 жыл бұрын

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/codewithTECHDOSE
TELEGRAM Group LINK: t.me/joinchat/SRVOIxWR4sRIVv5...
=======================================================================
USEFUL VIDEOS:-
Spanning Tree (MST): • Spanning Tree | MST | ...
Prims algorithm: • Prims algorithm | MST ...
Kruskals algorithm: • Kruskals algorithm | C...
Kruskal algorithm implementation: • Kruskal algorithm impl...

Пікірлер: 84
@davngo
@davngo 4 жыл бұрын
I have spent many many hours trying to understand djikstra, and you just explained it clearly in 12mins. I finally get it now.
@techdose4u
@techdose4u 4 жыл бұрын
Nice :)
@mayankgupta8715
@mayankgupta8715 4 жыл бұрын
Amazing channel.I found this channel in lockdown and now i become fan of this channel....
@techdose4u
@techdose4u 4 жыл бұрын
Thanks bro.
@MadForCs16
@MadForCs16 3 жыл бұрын
me too
@yihongliu3850
@yihongliu3850 3 жыл бұрын
same here
@nikhilaourpally8905
@nikhilaourpally8905 2 жыл бұрын
Thank you man for all the effort you put into this!
@karankhara1312
@karankhara1312 2 жыл бұрын
One of the best explanation + implementation on Dijkstra. Thanks!
@aryankumar87771
@aryankumar87771 3 жыл бұрын
waah sir kya baat h , itne kam time me itne clearly dry run karke samjha diya aapne... RESPECT
@techdose4u
@techdose4u 3 жыл бұрын
Thanks
@sahilpradhan877
@sahilpradhan877 3 жыл бұрын
Watched many different videos but understood well in this video. His way of teaching is great
@techdose4u
@techdose4u 3 жыл бұрын
Thanks :)
@akashbeura4701
@akashbeura4701 4 жыл бұрын
Really. Your channel is one of the hidden gems of KZfaq :).
@techdose4u
@techdose4u 4 жыл бұрын
Thanks bro.
@Samir-ll3kj
@Samir-ll3kj 3 жыл бұрын
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.
@techdose4u
@techdose4u 3 жыл бұрын
Thanks. I provided code link.
@patonslaught
@patonslaught 3 жыл бұрын
Really great video, enjoyed it a lot. @techdose - What software are you using for writing in the black board ?? Just curious :)
@prestoX
@prestoX 3 жыл бұрын
Awesome,new channel and best graphical repersentation making understanding easier.
@techdose4u
@techdose4u 3 жыл бұрын
Thanks :)
@shree1365
@shree1365 3 жыл бұрын
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 : )
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@sivarampatamsetti2262
@sivarampatamsetti2262 3 жыл бұрын
Graph playlists are really helpful Thank you 🙏🙏
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@kunalsoni7681
@kunalsoni7681 4 жыл бұрын
Really such a beautiful and helpful explanation 😊 Thanking you so much sir 😊☺️
@techdose4u
@techdose4u 4 жыл бұрын
Welcome bro :)
@simantapatowary748
@simantapatowary748 3 жыл бұрын
You guys keep increasing the beauty of KZfaq day by day❤️
@techdose4u
@techdose4u 3 жыл бұрын
❤️
@mradulagrawal1579
@mradulagrawal1579 3 жыл бұрын
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.
@techdose4u
@techdose4u 3 жыл бұрын
Thanks bro ❤️
@Codetuber
@Codetuber 3 жыл бұрын
Awesome work buddy
@YashSharma-vz6mu
@YashSharma-vz6mu 2 жыл бұрын
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👍🏻
@konakandlarohith6681
@konakandlarohith6681 3 жыл бұрын
What an explanation sir really awesome.Your videos are helping a lot for my preparation.Thankyou sir.
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@pramodsharma4508
@pramodsharma4508 3 жыл бұрын
This man has amazing teaching skills...
@techdose4u
@techdose4u 3 жыл бұрын
😅 Thanks
@dilipsunar99
@dilipsunar99 3 жыл бұрын
Damn ..his explaination
@theghostwhowalk
@theghostwhowalk 4 жыл бұрын
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.
@techdose4u
@techdose4u 4 жыл бұрын
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 😅
@jaydeepmahajan6598
@jaydeepmahajan6598 3 жыл бұрын
Your decision to make graph playlist is successful 🙏🏻
@techdose4u
@techdose4u 3 жыл бұрын
Nice to hear this :)
@levodiemhang2000
@levodiemhang2000 3 жыл бұрын
I understood it so well!
@techdose4u
@techdose4u 3 жыл бұрын
Nice :)
@impatientgaming9868
@impatientgaming9868 6 ай бұрын
Good one
@mwshubham
@mwshubham 2 жыл бұрын
Great video. By the end of this year I might complete watching most of the video. Only few left 😅☺️
@techdose4u
@techdose4u 2 жыл бұрын
Great ❤️
@9888622400
@9888622400 3 жыл бұрын
Thanks bro;! Amazing...!!!!
@techdose4u
@techdose4u 3 жыл бұрын
Welcome :)
@saurabhgupta4082
@saurabhgupta4082 3 жыл бұрын
sir I really love the way you explain.can you make videos on floyd warshall and bellmanford algorithm
@techdose4u
@techdose4u 3 жыл бұрын
It will come soon.
@farhanbajwa4954
@farhanbajwa4954 6 ай бұрын
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.
@rahulchudasama9363
@rahulchudasama9363 3 жыл бұрын
Other than increasing cost, I think prims algo and Dijkstra looks very similar.
@NikhilSharma-mv8hq
@NikhilSharma-mv8hq 2 жыл бұрын
hello sir , may u plz tell me from where I can get code for this
@chetannikam8129
@chetannikam8129 3 жыл бұрын
Nicely explained 👍
@techdose4u
@techdose4u 3 жыл бұрын
Thanks
@venuvenu2719
@venuvenu2719 4 жыл бұрын
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?
@techdose4u
@techdose4u 4 жыл бұрын
You can ask me this over chat. I will let you know. Use LinkedIn or Instagram.
@vishalwaghmare3130
@vishalwaghmare3130 3 жыл бұрын
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
@krishnapraveen777
@krishnapraveen777 2 жыл бұрын
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.
@sivamunnaluri2263
@sivamunnaluri2263 3 жыл бұрын
Video is very nice . I didn't find the Code link for this algorithm
@techdose4u
@techdose4u 3 жыл бұрын
Check description
@alapanchatterjee1
@alapanchatterjee1 Жыл бұрын
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.
@g-luu
@g-luu 3 жыл бұрын
This is an amazing explanation. Quick question - can this algorithm still work from any source to destination specified by user input for example?
@kirtigera2225
@kirtigera2225 4 жыл бұрын
Thankew sir ❤❤..sir please upload warshall, Tarjan and kosaraju algos, when you will get time ☺
@techdose4u
@techdose4u 4 жыл бұрын
Yea sure. I will upload them don't worry.
@kirtigera2225
@kirtigera2225 4 жыл бұрын
@@techdose4u thankew sir
@techdose4u
@techdose4u 4 жыл бұрын
Welcome :)
@kainaatmakhani6550
@kainaatmakhani6550 2 жыл бұрын
sir plzz yeh dijkstras algorithm ke notes aur coding send karde takhe mein apne paas download kar sakhun plzz?
@spiderman7170
@spiderman7170 2 жыл бұрын
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 🤔
@rajeshsingh-mv7zn
@rajeshsingh-mv7zn Жыл бұрын
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)
@GauravKumar-dw2ml
@GauravKumar-dw2ml 2 жыл бұрын
Can we use simple BFS instead of Dijkstra's algorithm ?
@bullshitdepartment
@bullshitdepartment Жыл бұрын
that would work for finding the shortest path based on the number of edges, but if each edge is weighted it wont work
@Usurperhk
@Usurperhk 3 жыл бұрын
Explanation :- Awesome since forever.
@techdose4u
@techdose4u 3 жыл бұрын
Thanks 😊
@ankursoni3400
@ankursoni3400 3 жыл бұрын
Please give code using priority queue because adding new nodes to priority queue will increase the time complexity
@mrudulaahire1360
@mrudulaahire1360 3 жыл бұрын
Why set data structure is used here?
@techdose4u
@techdose4u 3 жыл бұрын
You can use array as well. Just to mark the nodes which are processed
@mrudulaahire1360
@mrudulaahire1360 3 жыл бұрын
@@techdose4u Thank you!!
@shutdahellup69420
@shutdahellup69420 Жыл бұрын
This subject is wild man. Like seriously wtf is even going on 😂
@rishijha9860
@rishijha9860 4 жыл бұрын
Wow . Middle of the night
@techdose4u
@techdose4u 4 жыл бұрын
Haha 😂 Just completed editing.
@HimanshuKumar-xz5tk
@HimanshuKumar-xz5tk 3 жыл бұрын
Not sure why is it called shortest path. We are actually trying to minimize the path cost :')
@hritulagrawal
@hritulagrawal 2 жыл бұрын
What if the weight of the edge represents the distance between two nodes?
Dijkstra algorithm | Code implementation
22:28
Techdose
Рет қаралды 88 М.
Bellman Ford Algorithm
17:51
Techdose
Рет қаралды 56 М.
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22
아이스크림으로 체감되는 요즘 물가
00:16
진영민yeongmin
Рет қаралды 63 МЛН
DAD LEFT HIS OLD SOCKS ON THE COUCH…😱😂
00:24
JULI_PROETO
Рет қаралды 15 МЛН
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН
3.6 Dijkstra Algorithm - Single Source Shortest Path - Greedy Method
18:35
The hidden beauty of the A* algorithm
19:22
polylog
Рет қаралды 848 М.
Lec21: Horspool's Algorithm - String /Substring Matching
17:18
Engineering Wing
Рет қаралды 4,4 М.
Floyd Warshall algorithm | All pairs shortest path
25:43
Techdose
Рет қаралды 67 М.
G-41. Bellman Ford Algorithm
27:43
take U forward
Рет қаралды 185 М.
How Dijkstra's Algorithm Works
8:31
Spanning Tree
Рет қаралды 1,3 МЛН
Network Delay Time - Dijkstra's algorithm - Leetcode 743
19:48
Inside Out 2: Who is the strongest? Joy vs Envy vs Anger #shorts #animation
00:22