Hello,
Thank you sword_fish,and Jinx for your suggestions.Here is the algorithm to find the 2nd shortest path.Once you find the shortest path by Dijkstra's algorithm (or Bellman-Ford also),
make the last edge of the path equal to infinity, thus cutting it off from the graph.Then run the dijkstra's algorithm again.Restore that edge,and make the second edge=infinity,and continue so on for all edges.The shortest path amongst the collection of all those, will be the 2nd shortest path in the graph.