moved Dijkstra from Java to C#