I have a set of geographical points (lat, lon) and I want to compute a directed graph where:
- the nodes are those points
- an edge X->Y (between nodes X and Y) exists if the fastest path between X and Y doesn't pass through another node Z.
I am able to compute the duration of the path between any pair of nodes. Right now, I'm doing the following:
- compute the durations between every pair of nodes
- for every pair of nodes X,Y, there is an edge between X and Y if there is no node Z such that the duration of X->Z plus the duration of Z->Y is the same as the duration of X->Y.
I have tested this approach for a subset of the nodes and it seems to work, but since I have around 2000 nodes and the computation of the duration between nodes is computationally expensive (because it involves calculating the shortest path), I would like to know if there is a better approach.
Some additional (probably not relevant) info:
- The nodes are bus stop locations, taken from a GTFS feed
- I'm calculating the shortest paths durations using http://project-osrm.org/
Any help will be greatly appreciated