Got routing travel time Inf during simulation while in real case, any two locations are reachable from one to another

Hi. I hope this is a right question to ask here. I’m doing a simulation of vehicle transportation. So during each round, I need to use shortest-path-algorithm to find the route with the shortest traveling time. In this process, there are cases where the shortest travel time found is Inf, while in real case, it is rather rare, right? Or maybe if one location is in an island, and the other one is in the other island, then they are not reachable from one another? Or maybe it’s because the map data is limited, and if one or two locations are near the boundary, then they are not reachable from each other? I was thinking to ignore this travel-time-being-Infinity cases, and re-choose either the round locations or the route. Are there any better suggestions then?