Implement the Link-State (LS) and the Distance Vector (DV)routing algorithms. The input will be a network data structurestored in a text file. Your program should first ask for the inputfile name, and then read the file, which has the followingformat:
Line 1: <Number of nodes in the network> <space><Number of links>
Line 2: <Name of Node 1> <space> <Name of Node2> … <Name of last node>
Line 3: <Node name 1> <space> <Node name 2><distance of the link between 1 and 2> …
As an example, for the network above, the input file will be:
3 3
X Y Z
X Y 2
Y Z 1
X Z 7
You
PayPal Gateway not configured
PayPal Gateway not configured