[8.0] Bellman Ford Shortest Path Algorithm in Python

Поділитися
Вставка
  • Опубліковано 5 жов 2024

КОМЕНТАРІ • 21

  • @ThinkXAcademy
    @ThinkXAcademy  2 роки тому

    Correction:
    Change this line (2 occurrences) : node_data[neighbor]['pred'] = node_data[neighbor]['pred'] + list(itr)
    to this -> node_data[neighbor]['pred'] = node_data[itr]['pred'] + [itr]
    [Note: Code is updated on our website and android app)

  • @averrousazharrafiqi-2346
    @averrousazharrafiqi-2346 2 роки тому

    where i can find next tutorial ? i need to know next line of program to know Graph contains negative weight cycle. thanks! nice explanation

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      Here: ua-cam.com/video/-WlOCaSdfUE/v-deo.html

  • @jpkanimes2719
    @jpkanimes2719 2 роки тому

    Please do a video on jhonspn algorithm

  • @JayeshDhandha
    @JayeshDhandha 2 роки тому

    Hi,
    Good job brother.
    I wanted to use this algorithm to find best currency conversion from the list of given json data which contains array of elements like fromCountry, toCountry & exchangeRate. There might be multiple route to exchange but I want to get path which gives me maximum rate after conversion. I'm really stuck brother, can you please help me in any way?
    Thanks for your good work!

    • @ThinkXAcademy
      @ThinkXAcademy  Рік тому

      Thanks😄 Share our channel with other students to help them too💫

  • @Buracodogalo
    @Buracodogalo 2 роки тому

    I could not understand the if noda_data['cost'] == inf part. I don't this this ever happens.

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      Hi, cost of the node is assigned to infinite which logically implies that node is not visited yet.

    • @sreshthabhatt2187
      @sreshthabhatt2187 2 роки тому

      @@ThinkXAcademy sir you are already in loop for that particular neighbour and also above this line you have already changed the cost node_data[neighbor]['cost'] = cost when cost < node_data[neighbor]['cost']. why will it be infinite then?

  • @fariullahomid8423
    @fariullahomid8423 2 роки тому

    Hello Dear !
    I applied a network with 24 node and 76 links, based on your algorithm but it doesn't work, i think there is something more about the, predecessors because in result, when i see the iterations, in links there is one predecessor for each link. its not correct because in networks with more node and links there is more predecessor for each link. if you find out please share with me.
    I tried to find your email but couldn't.

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      Thanks for pointing out the mistake. I have resolved it in code on our website and have mentioned that in the pinned comment.

  • @Toropigeon
    @Toropigeon 2 роки тому

    Would this code work with negative cycles/loops in graph?

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      For negative cycles consider this video: ua-cam.com/video/-WlOCaSdfUE/v-deo.html

    • @Toropigeon
      @Toropigeon 2 роки тому

      @@ThinkXAcademy Thank you, you are very nice person! Really help me

  • @issatangara9870
    @issatangara9870 2 роки тому

    It's possible to have the .py file ?

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      You can find the code on the website: www.thinkxacademy.com

    • @issatangara9870
      @issatangara9870 2 роки тому

      @@ThinkXAcademy thank you

  • @criminalcuenta2268
    @criminalcuenta2268 2 роки тому

    where do i find the code?

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      www.thinkxacademy.com/Data%20Structures%20in%20Python/

    • @ThinkXAcademy
      @ThinkXAcademy  2 роки тому

      Under this course you will see this video just click on it and you will see the code.