Shortest Path Algorithms (Dijkstra and Bellman-Ford) - Simplified

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ม.ค. 2025

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

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

    in last part of the video sir asked for feedback, here it is
    Those who are new to sir let me tell you he is a "legend", he can make even a dumber guy understand these DAA algos
    trust me he is such a legend.

  • @mukeshmahadev7419
    @mukeshmahadev7419 5 ปีที่แล้ว +7

    It's really really helpful. Thanks you Sir, finally understood Bellman Ford and Dijkstra's algorithm completely with comparison. You have covered all the possible doubts that I had got while understanding, that's the best part.
    Thanks a lot again.

  • @prashantkamble898
    @prashantkamble898 7 ปีที่แล้ว +15

    awesome explanation. much better than engineering colleges.

  • @saprra1
    @saprra1 3 หลายเดือนก่อน +2

    Sir without you my DSA =0 i was breaking my head , could nt understand anything.
    Thanks for making coding easy

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

    Hi +Abdul Bari sir - Why we have taken d vertex first when we deal with negative vertex in bellmanford algorithm (15:38) .
    We could start with (a,c) (c,d)(d,b) (a,b) rather we selected (d,b) (c,d) (a,c) (a,b) . Can you please explain once again why ?

  • @subhrenduchattopadhyay
    @subhrenduchattopadhyay 5 หลายเดือนก่อน +3

    Complexity analysis of bellman-ford (19:35): O(V times E ) -> O(V^3) as |E| can be v*(v-1) for completely connected graph/clique.

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

      You are over counting.
      Each edge from each vertex will be connected to another vertex hence max |E| = v(v-1)/2.

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

      @prodbyjaswant551 The complexity remains the same. O(v^3).

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

    Abdul Bari >>>> university professors
    Best teacher!

  • @aishwaryaratnam154
    @aishwaryaratnam154 7 ปีที่แล้ว +5

    Sir your explanation was like a cutting edge . thank you so much

  • @Malik-bx6qg
    @Malik-bx6qg 6 ปีที่แล้ว +3

    You have a mistake sir, in the first example (time: 6:35), you said that the shortest path from P to T is "7", it is not !. It is 5, from P > Q > R > U > T (1+1+1+2=5). Please check this

    • @Malik-bx6qg
      @Malik-bx6qg 6 ปีที่แล้ว +1

      Aaa, now I know. Thank you for the explanation. My comment is useful though.

    • @javariamalik8475
      @javariamalik8475 3 หลายเดือนก่อน

      Where is the explanation. I'm not able to understand it ​@@Malik-bx6qg

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

    Sir please come back to TH-cam, world needs you!!!

  • @aradhyajain9575
    @aradhyajain9575 7 ปีที่แล้ว +2

    very good explanation....watched a lot of videos and finally got yours one.....thanks!!

  • @MastAdmiLive
    @MastAdmiLive 2 ปีที่แล้ว +15

    Our teachers gave us 150slides of ppt

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

    How are you so greatly simplifying the algorithms?? Thank you sir>>>>

  • @debarkasengupta4500
    @debarkasengupta4500 7 ปีที่แล้ว +2

    Extremely well described. Very good teaching skills.

    • @tasmiyamuazzam8972
      @tasmiyamuazzam8972 6 ปีที่แล้ว

      Sir.. lekin fr kya krenge agr negative cycle exist kregi to..

  • @haneulkim4902
    @haneulkim4902 5 ปีที่แล้ว +2

    Thanks for the video! @13:32 you say that once shortest path has been found it cannot be updated hence dijkstra algorithm sometimes fail with negative weight edges. However replacing 1-4 edge with 10 and 3-4 edge with 2, it will do the same thing as having 1-4 edge = 1 , 3-4edge = -6. Does that mean it sometimes doesn't work for positive weight edges too?

    • @haneulkim4902
      @haneulkim4902 5 ปีที่แล้ว +1

      @@abdul_bari But you said once vertex is relaxed it cannot be relaxed again that is why it failed with negative weights.

  • @mayanktripathi3666
    @mayanktripathi3666 5 ปีที่แล้ว +1

    Ans of dijkstra algorithm of this diagram with path my ans is a->b->c->d->e->f.

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

    Thank you, that helped me a lot!

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

    I am gonna watch these videos till I master the theory well and I will buy your c++/c data structure course you are amazing

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

      Hlo bro did u buy the courses

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

    What should we do if the arrows are not mentioned in the question? How should we proceed then?

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

    SIR THERE IS ONE REQUEST PLEASE SWITCH BACK TO TEACHING ON BOARD AS THOSE VIDEO'S WERE MORE INTRESTING THAN THIS. LOVE YOUR VIDEOS

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

    at 25:00 the cost should be -2, but thanks for the amazing video otherwise!

  • @SamaaSeif
    @SamaaSeif 8 หลายเดือนก่อน

    when you pick edges for bellman theory, why do u put d-b first?
    what makes it be in that order

  • @IcyIndia
    @IcyIndia 5 ปีที่แล้ว

    Sir please recheck at 5:45 time in this video ... point T should be 5 not 7 .

    • @zouhairghazi3541
      @zouhairghazi3541 5 ปีที่แล้ว +1

      No, it shouldn't. The graph is in fact oriented so you cant travel from vertex U to vertex T.

  • @muezabebe5669
    @muezabebe5669 5 ปีที่แล้ว +1

    your tutorial is very inteested

  • @mahoorkhan630
    @mahoorkhan630 7 ปีที่แล้ว +1

    In bellman ford algo why have u taken d vertex first?

  • @TheRealBoroNut
    @TheRealBoroNut 7 ปีที่แล้ว +2

    While you're checking for the shortest route I'm already in the pub on my second pint.

  • @c.danielpremkumar8495
    @c.danielpremkumar8495 6 ปีที่แล้ว +1

    Can't we add 6 to all the edges so that we can deal with all positive values which would make the negative edge equal to 0 ? If it is OK - then nodes 3 and 4 would become a single node. What would this mean ?

  • @edwinthomas9174
    @edwinthomas9174 7 ปีที่แล้ว +1

    best explanation ever !!!!

  • @lilj1702
    @lilj1702 7 ปีที่แล้ว +1

    Isnt F in the second graph actually 7?

  • @rahimkorbo8158
    @rahimkorbo8158 7 ปีที่แล้ว

    What if the arrows on the edges are not mentioned for bellman ford algorithm for list of edges?
    What to do in that situation?

  • @noyonrongon6292
    @noyonrongon6292 5 ปีที่แล้ว

    awesome explanation.

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

    25:01 1+3 - 6 = -2

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

    amazing sir amazing💕😍

  • @muhammadaltafhussain3084
    @muhammadaltafhussain3084 11 หลายเดือนก่อน

    25:00 1+ 3 -6 = -2 ,

  • @Amitsa299
    @Amitsa299 7 ปีที่แล้ว +1

    You are gem

  • @shubhampathak3770
    @shubhampathak3770 7 ปีที่แล้ว +1

    awesome

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

    Thank you sir

  • @c.danielpremkumar8495
    @c.danielpremkumar8495 6 ปีที่แล้ว +1

    What is the practical meaning for a NEGAFIVE edge ?

    • @Kitty-Corn-3
      @Kitty-Corn-3 6 ปีที่แล้ว

      Don't limit you thinking about edges just in terms of water flowing through the pipes .. or packets through the network wire ..
      Think of a case when you're google and sending traffic to a website when customer clicks an ad .. and the edge value is the money you charge ..

    • @evelynross1043
      @evelynross1043 5 ปีที่แล้ว

      In real scenarios , it can represent a transaction which can be both positive and negative .

  • @abuibrahym1182
    @abuibrahym1182 6 ปีที่แล้ว

    Thanks
    That was good

  • @ahmadshirazi4757
    @ahmadshirazi4757 ปีที่แล้ว

    Perfect💯

  • @saurabhmittal2504
    @saurabhmittal2504 6 ปีที่แล้ว

    1+3-6 = -3😊
    don't point it out ,it's a simple mistake

  • @gameslife9179
    @gameslife9179 ปีที่แล้ว

    Great

  • @shareefudin2164
    @shareefudin2164 7 ปีที่แล้ว

    thanku

  • @radnustech7762
    @radnustech7762 6 ปีที่แล้ว +1

    Best

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

    Thanks a lot!

  • @vineetchauhan8192
    @vineetchauhan8192 5 ปีที่แล้ว

    eeeeee