Code Examples
  Home arrow Code Examples arrow The Bellman-Ford and Roy-Floyd Algorithms
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
CODE EXAMPLES

The Bellman-Ford and Roy-Floyd Algorithms
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2009-05-28

    Table of Contents:
  • The Bellman-Ford and Roy-Floyd Algorithms
  • The Bellman-Ford Algorithm
  • The-Roy Floyd Technique
  • Printing the road

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    The Bellman-Ford and Roy-Floyd Algorithms


    (Page 1 of 4 )

    Everyone wants to get the most out of their investments. When you make a sacrifice and get yourself involved in something, then most of the time, you want in return every little drop you can stroke out of the situation. When you cannot influence this, it is time to find a way to invest/sacrifice only as much you absolutely need to. If your problem can be summed up as a graph, and the shortest path is your solution, then you came to the right place. This is the ninth article in a 13-part series on graphs and how they can be used for problem solving.

    The problem is simple: why waste time and gasoline when you are traveling by taking a longer route when you have the option to arrive in the same place, and earlier, by way of a different path taken to the destination? This is the second article of my series that specifically covers how to calculate the shortest paths between points.

    During our last article, entitled suggestively "Shortest Path Algorithms in Graphs," we found two solutions for the single-source shortest-path algorithms. The first works only if we have no circle in the graph, as otherwise we cannot topologically sort the vertexes of the graph. The second works as long as we do not have negative edges, as the algorithm is able to ignore the back-pointing edges that formed the circle.

    We may ignore the algorithm, however, only if there are no negative edges, because traveling in the opposite direction, the circle might shorten the distance. Today the Bellman-Ford algorithm is going to help us in situations when we have negative edges inside our graph. However, we cannot have fundamental circles with an overall negative weight sum.

    In this case, the distance between the vertexes is not defined, or they are defined, at minus infinity, as we may circle there infinitely and at every circuit decrease the distance more and more. Afterward we are going to learn a method to calculate the minimal distances between every point of the graph and to find out where this minimal road leads.

    More Code Examples Articles
    More By Gabor Bernat


     

    CODE EXAMPLES ARTICLES

    - Bipartite Graphs
    - Connectivity in Graphs
    - The Ford-Fulkerson Algorithm
    - Critical Paths
    - The Bellman-Ford and Roy-Floyd Algorithms
    - Shortest Path Algorithms in Graphs
    - Minimum Spanning Tree
    - Articulation Edges and Vertexes
    - Circles and Connectivity in Graphs
    - Depth-First Search in Graphs
    - Breadth-First Search in Graphs
    - The Prufer Code and the Floyd-Warshall Algor...
    - An Insight into Graphs
    - Coding a Custom Object with WSC
    - Creating a Custom Object with WSC





    © 2003-2010 by Developer Shed. All rights reserved. DS Cluster 10 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek