This is a simple dijkstra algorithm implementation. It counts the shortest path between nodes in a weighted graph. It returns the actual path from the starting node to the end.
The actual path can be returned only if there is a possible way between the nodes.