Dijkstra algorithm | Single source shortest path algorithm

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
    @davngo4 жыл бұрын

    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
    @mayankgupta87154 жыл бұрын

    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
    @nikhilaourpally89052 жыл бұрын

    Thank you man for all the effort you put into this!

  • @karankhara1312
    @karankhara13122 жыл бұрын

    One of the best explanation + implementation on Dijkstra. Thanks!

  • @aryankumar87771
    @aryankumar877713 жыл бұрын

    waah sir kya baat h , itne kam time me itne clearly dry run karke samjha diya aapne... RESPECT

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Thanks

  • @akashbeura4701
    @akashbeura47014 жыл бұрын

    Really. Your channel is one of the hidden gems of KZread :).

  • @techdose4u

    @techdose4u

    4 жыл бұрын

    Thanks bro.

  • @sahilpradhan877
    @sahilpradhan8773 жыл бұрын

    Watched many different videos but understood well in this video. His way of teaching is great

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Thanks :)

  • @shree1365
    @shree13653 жыл бұрын

    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 :)

  • @Samir-ll3kj
    @Samir-ll3kj3 жыл бұрын

    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.

  • @mradulagrawal1579
    @mradulagrawal15793 жыл бұрын

    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 ❤️

  • @simantapatowary748
    @simantapatowary7483 жыл бұрын

    You guys keep increasing the beauty of KZread day by day❤️

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    ❤️

  • @prestoX
    @prestoX3 жыл бұрын

    Awesome,new channel and best graphical repersentation making understanding easier.

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Thanks :)

  • @sivarampatamsetti2262
    @sivarampatamsetti22623 жыл бұрын

    Graph playlists are really helpful Thank you 🙏🙏

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Welcome :)

  • @impatientgaming9868
    @impatientgaming98686 ай бұрын

    Good one

  • @patonslaught
    @patonslaught3 жыл бұрын

    Really great video, enjoyed it a lot. @techdose - What software are you using for writing in the black board ?? Just curious :)

  • @pramodsharma4508
    @pramodsharma45083 жыл бұрын

    This man has amazing teaching skills...

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    😅 Thanks

  • @jaydeepmahajan6598
    @jaydeepmahajan65983 жыл бұрын

    Your decision to make graph playlist is successful 🙏🏻

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Nice to hear this :)

  • @kunalsoni7681
    @kunalsoni76814 жыл бұрын

    Really such a beautiful and helpful explanation 😊 Thanking you so much sir 😊☺️

  • @techdose4u

    @techdose4u

    4 жыл бұрын

    Welcome bro :)

  • @Codetuber
    @Codetuber3 жыл бұрын

    Awesome work buddy

  • @YashSharma-vz6mu
    @YashSharma-vz6mu2 жыл бұрын

    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
    @konakandlarohith66813 жыл бұрын

    What an explanation sir really awesome.Your videos are helping a lot for my preparation.Thankyou sir.

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Welcome :)

  • @mwshubham
    @mwshubham2 жыл бұрын

    Great video. By the end of this year I might complete watching most of the video. Only few left 😅☺️

  • @techdose4u

    @techdose4u

    2 жыл бұрын

    Great ❤️

  • @dilipsunar99
    @dilipsunar993 жыл бұрын

    Damn ..his explaination

  • @levodiemhang2000
    @levodiemhang20003 жыл бұрын

    I understood it so well!

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Nice :)

  • @theghostwhowalk
    @theghostwhowalk4 жыл бұрын

    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 😅

  • @9888622400
    @98886224003 жыл бұрын

    Thanks bro;! Amazing...!!!!

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Welcome :)

  • @farhanbajwa4954
    @farhanbajwa49546 ай бұрын

    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.

  • @saurabhgupta4082
    @saurabhgupta40823 жыл бұрын

    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.

  • @vishalwaghmare3130
    @vishalwaghmare31303 жыл бұрын

    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.

  • @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.

  • @rahulchudasama9363
    @rahulchudasama93633 жыл бұрын

    Other than increasing cost, I think prims algo and Dijkstra looks very similar.

  • @chetannikam8129
    @chetannikam81293 жыл бұрын

    Nicely explained 👍

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Thanks

  • @venuvenu2719
    @venuvenu27194 жыл бұрын

    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.

  • @g-luu
    @g-luu3 жыл бұрын

    This is an amazing explanation. Quick question - can this algorithm still work from any source to destination specified by user input for example?

  • @NikhilSharma-mv8hq
    @NikhilSharma-mv8hq2 жыл бұрын

    hello sir , may u plz tell me from where I can get code for this

  • @sivamunnaluri2263
    @sivamunnaluri22633 жыл бұрын

    Video is very nice . I didn't find the Code link for this algorithm

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Check description

  • @kirtigera2225
    @kirtigera22254 жыл бұрын

    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 :)

  • @spiderman7170
    @spiderman71702 жыл бұрын

    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)

  • @kainaatmakhani6550
    @kainaatmakhani65502 жыл бұрын

    sir plzz yeh dijkstras algorithm ke notes aur coding send karde takhe mein apne paas download kar sakhun plzz?

  • @Usurperhk
    @Usurperhk3 жыл бұрын

    Explanation :- Awesome since forever.

  • @techdose4u

    @techdose4u

    3 жыл бұрын

    Thanks 😊

  • @GauravKumar-dw2ml
    @GauravKumar-dw2ml2 жыл бұрын

    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

  • @ankursoni3400
    @ankursoni34003 жыл бұрын

    Please give code using priority queue because adding new nodes to priority queue will increase the time complexity

  • @shutdahellup69420
    @shutdahellup69420 Жыл бұрын

    This subject is wild man. Like seriously wtf is even going on 😂

  • @rishijha9860
    @rishijha98604 жыл бұрын

    Wow . Middle of the night

  • @techdose4u

    @techdose4u

    4 жыл бұрын

    Haha 😂 Just completed editing.

  • @mrudulaahire1360
    @mrudulaahire13603 жыл бұрын

    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!!

  • @HimanshuKumar-xz5tk
    @HimanshuKumar-xz5tk3 жыл бұрын

    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?

Келесі