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

ความคิดเห็น • 84

  • @mayankgupta8715
    @mayankgupta8715 4 ปีที่แล้ว +32

    Amazing channel.I found this channel in lockdown and now i become fan of this channel....

  • @davngo
    @davngo 4 ปีที่แล้ว +18

    I have spent many many hours trying to understand djikstra, and you just explained it clearly in 12mins. I finally get it now.

  • @aryankumar87771
    @aryankumar87771 3 ปีที่แล้ว +2

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

  • @sahilpradhan877
    @sahilpradhan877 3 ปีที่แล้ว +3

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

  • @akashbeura4701
    @akashbeura4701 4 ปีที่แล้ว +4

    Really. Your channel is one of the hidden gems of TH-cam :).

  • @Samir-ll3kj
    @Samir-ll3kj 3 ปีที่แล้ว +7

    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 ปีที่แล้ว +1

      Thanks. I provided code link.

  • @mradulagrawal1579
    @mradulagrawal1579 4 ปีที่แล้ว +4

    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  4 ปีที่แล้ว

      Thanks bro ❤️

  • @simantapatowary748
    @simantapatowary748 3 ปีที่แล้ว +4

    You guys keep increasing the beauty of TH-cam day by day❤️

  • @shree1365
    @shree1365 4 ปีที่แล้ว +2

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

  • @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👍🏻

  • @sivarampatamsetti2262
    @sivarampatamsetti2262 4 ปีที่แล้ว +3

    Graph playlists are really helpful
    Thank you 🙏🙏

  • @karankhara1312
    @karankhara1312 2 ปีที่แล้ว

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

  • @pramodsharma4508
    @pramodsharma4508 4 ปีที่แล้ว +3

    This man has amazing teaching skills...

  • @prestoX
    @prestoX 3 ปีที่แล้ว +1

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

  • @jaydeepmahajan6598
    @jaydeepmahajan6598 4 ปีที่แล้ว +2

    Your decision to make graph playlist is successful 🙏🏻

    • @techdose4u
      @techdose4u  4 ปีที่แล้ว

      Nice to hear this :)

  • @AlanSchooll
    @AlanSchooll 7 หลายเดือนก่อน

    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.

  • @mwshubham
    @mwshubham 2 ปีที่แล้ว +1

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

  • @konakandlarohith6681
    @konakandlarohith6681 3 ปีที่แล้ว +1

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

  • @nikhilaourpally8905
    @nikhilaourpally8905 2 ปีที่แล้ว

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

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

  • @impatientgaming9868
    @impatientgaming9868 7 หลายเดือนก่อน

    Good one

  • @kunalsoni7681
    @kunalsoni7681 4 ปีที่แล้ว +1

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

  • @levodiemhang2000
    @levodiemhang2000 3 ปีที่แล้ว +1

    I understood it so well!

  • @dilipsunar99
    @dilipsunar99 3 ปีที่แล้ว +1

    Damn ..his explaination

  • @saurabhgupta4082
    @saurabhgupta4082 4 ปีที่แล้ว +1

    sir I really love the way you explain.can you make videos on floyd warshall and bellmanford algorithm

    • @techdose4u
      @techdose4u  4 ปีที่แล้ว +1

      It will come soon.

  • @9888622400
    @9888622400 3 ปีที่แล้ว +1

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

  • @Codetuber
    @Codetuber 3 ปีที่แล้ว

    Awesome work buddy

  • @rahulchudasama9363
    @rahulchudasama9363 3 ปีที่แล้ว +2

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

  • @theghostwhowalk
    @theghostwhowalk 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +2

      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 😅

  • @chetannikam8129
    @chetannikam8129 3 ปีที่แล้ว +1

    Nicely explained 👍

  • @venuvenu2719
    @venuvenu2719 4 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      You can ask me this over chat. I will let you know. Use LinkedIn or Instagram.

  • @sivamunnaluri2263
    @sivamunnaluri2263 3 ปีที่แล้ว +1

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

    • @techdose4u
      @techdose4u  3 ปีที่แล้ว

      Check description

  • @Usurperhk
    @Usurperhk 3 ปีที่แล้ว +1

    Explanation :- Awesome since forever.

  • @vishalwaghmare3130
    @vishalwaghmare3130 3 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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.

  • @patonslaught
    @patonslaught 3 ปีที่แล้ว

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

  • @kirtigera2225
    @kirtigera2225 4 ปีที่แล้ว +1

    Thankew sir ❤❤..sir please upload warshall, Tarjan and kosaraju algos, when you will get time ☺

    • @techdose4u
      @techdose4u  4 ปีที่แล้ว +1

      Yea sure. I will upload them don't worry.

    • @kirtigera2225
      @kirtigera2225 4 ปีที่แล้ว +1

      @@techdose4u thankew sir

    • @techdose4u
      @techdose4u  4 ปีที่แล้ว

      Welcome :)

  • @ankursoni3400
    @ankursoni3400 3 ปีที่แล้ว

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

  • @mrudulaahire1360
    @mrudulaahire1360 3 ปีที่แล้ว +1

    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 2 ปีที่แล้ว

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

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

  • @NikhilSharma-mv8hq
    @NikhilSharma-mv8hq 2 ปีที่แล้ว

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

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

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

  • @kainaatmakhani6550
    @kainaatmakhani6550 2 ปีที่แล้ว

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

  • @rishijha9860
    @rishijha9860 4 ปีที่แล้ว +1

    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?