working dijkstra with preferences and times