Originally Posted by
4eFFWNW
Okay now say i have a world map containing x number of cities and i want to find the shortest path between cities A and B in country A. Now if i were to run the algorithm all the time the user selects two cities it will not be practical as there are a huge no of cities , it would take a long time to give the result. So how do i really overcome this problem?
Do i have to run the shortest path algorithm on all the combinations and save the result in a table so the next time the user selects two cities the table value is retrieved instead of recalculating?