Fully implementation of Dijkstra function

With variable source/dest input.