1
votes

I have a text file with a list of airport codes and times between each formatted like this:

AER,KZN,1.8835

Where this stands for first airport, second airport, time in hours between them (not bidirectional).

I'm assuming there's a 2 hour delay on every stopover, and trying to figure out how many airports are reachable from Boston (BOS) within 10 hours. I know if I put all the nodes into Dijkstra's I can find shortest paths between each node, but can I also use it to solve this problem?

1
Well, sure. Just add 2 to every number where the first airport is something other than BOS. - svinja

1 Answers

1
votes

Yes you can: start Dijkstra at BOS and stop (early abort) when the next airport reached has a longer path than the 10 hours.