DM's speedup of shortest path by shortcut

This significantly speeds up a use case where there are very few shortest paths