Self study: self contained Dijkstra implementation