Dijkstr's Algorithm is a graph search algorithm that solves the single-source shortest path problem for a graph with non-negative edge path costs, producing a shortest path tree. This algorithm is often used in routing and as a subroutine in other graph algorithms.
input.text contains the test cases for the program. First line implies the no: pf vertices and second one implies the no: of edges. Then the edges with is specified.