path trace for memoized shortest path works