[Math] All pairs shortest path with maximum distance

graph theory

I didn't succeed to find an algorithm that finds the shortest path in a weighted non directed graph between all pairs of nodes whose shortest path distance are inferior to a specific number. I think that, especially if the maximum distance is very small, it should significantly improve my algorithm's performance. Do you know such an algorithm ?

For example : let's say I set a maximum distance of 30. If the shortest path between A and B is 10, I want the algorithm to find it (and provide me the distance). If the shortest path between B and C is 50, I don't want the algorithm to find it.

Thanks,

Best Answer

maybe this paper, in which the calculation of the all pairs shortest paths in $O(n^2)$ with high probability is solved, meets your requirements.
Some preconditions about the distribution of edge lengths are made, which you could check against the properties of your problem instances.

Related Question