Enforce a certain signature of shortest_way