WeBeginners-Community / DocBook

Documentations of Html to every open source technologies. It's a low-code repository
30 stars 54 forks source link

Title: BellmanFord Algorithm #152

Closed shailja2727 closed 1 year ago

shailja2727 commented 1 year ago

Is your feature request related to a problem? Please describe.

BellmanFord Algorithm

It is a single source shortest path algorithm. Dijkstra’s algorithm is a Greedy algorithm and the time complexity is O((V+E)LogV) (with the use of the Fibonacci heap). Dijkstra doesn’t work for Graphs with negative weights, Bellman-Ford works for such graphs. Bellman-Ford is also simpler than Dijkstra and suites well

Applications:

It can be used to detect negative cycles in the graph.

Describe the solution you'd like.

It can deal with negative weights by iterating over the edges for N-1 times,where N is the number of vertices.

Describe alternatives you've considered.

N.A.

Add any other context or screenshots about the feature request here.

OUTPUT:

image