Implementation of Dijkstras Shortest Path algorithm.