added general c++ implementation of Dijkstra