The Bellman-Ford algorithm is descibed as a method for finding the least-cost path through a partially-connected network. Using the C programming language, write a UNIX program which implements the Bellman-Ford algorithm to compute (i) the least-cost and (ii) the least cost path between any two nodes in a switched network. Input data for your program will be stored in a text file which describes the link and link costs for all your nodes in the network (upto a maximum of 12 nodes). The input has the following format:-
Alternatively, the user may be prompted to input data into the program.
The output of the program should display a table similar to:
h D2 Path D3 Path D4 Path D5 Path D6 Path