Two-Levels-Greedy: a generalization of Dijkstra's shortest path algorithm