community
directory
books
authors
images
encyclopedia

Email:
Password:
Register

Knowledgerush Search

 

Google
  Web knowledgerush


Search for images of Bellman-Ford algorithm


Message boards   Post comment

Bellman-Ford algorithm

Bellman-Ford algorithm computes single-source shortest paths in a weighted graph (where some of the edge weights may be negative). Dijkstra's algorithm accomplishes the same problem with a lower running time, but requires edges to be non-negative. Thus, Bellman-Ford is usually used only when there are negative edge weights.

Bellman Ford runs in O(VE) time, where V and E are the number of vertices and edges.

Here is a sample algorithm of Bellman-Ford

BF(G,w,s) // G = Graph, w = weight, s=source Determine Single Source(G,s); set Distance(s) = 0; Predecessor(s) = nil; for each vertex v in G other than s, set Distance(v) = infinity, Predecessor(v) = nil; for i <- 1 to |V(G)| - 1 do //|V(G)| Number of vertices in the graph for each edge (u,v) in G do if Distance(v) > Distance(u) + w(u,v) then set Distance(v) = Distance(u) + w(u,v), Predecessor(v) = u; for each edge (u,r) in G do if Distance(r) > Distance(u) + w(u,r); return false; return true;

Proof of the Algorithm

  • TODO

See also: List of algorithms

Referenced By

List of algorithms | List of graph theory topics | List of mathematical proofs | List of mathematical topics | List of mathematical topics (A-C) | List of mathematics topics | List of proofs

 

Compose Your Message

Your Email Address or Pen Name (optional):
Subject:
Your Message:
 

 

 

 

 

 

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Bellman-Ford algorithm".

 

Contact UsPrivacy Statement & Terms of Use

 
Copyright © 1999-2003 Knowledgerush.com. All rights reserved.