Is there an efficient manner to use pg_routing to do an all-pairs shortest path search but only up to a certain distance? My use-case is large road network but I only want to search for shortest paths from one node to another where the path doesn't exceed ~2000m.
At the moment I don't see the option to set a threshold on the all-pairs or non-all-pairs shortest path functions.
The only method that comes to mind is along these lines:
iterate all nodes;
create a spatial buffer based on the threshold with the node as a centrepoint;
clip the network to the buffer;
then compute the shortest paths;
discard destinations where the network path is greater than the threshold;
write the results to a table aggregating the results;
repeat for each node.
This won't be very efficient for my purposes. Is there another approach to do so using pgrouting? (Without having to replicate the graph outside the database and doing the analysis elsewhere?)