Dijkstra and Scheduling for Greedy method