Further optimization of shortest path caching