reference for the future enhancement to optimize shortestPath