Imagine we have the location of a person (point) and 100 restaurants (each is a point). My objective is to calculate the path from the person to the nearest restaurant (just one), but I want to avoid calculating 100 shortest paths (which is what pgr_dijkstra one-to-many does), because it is time consuming.
Logically, this should be possible, as Dijkstra's algorithm analyzes cost cumulatively. Therefore, if the algorithm has already reached the first restaurant and the cost is 50, then all paths whose cost is higher than 50 could be dropped.
How can I implement this in PostgreSQL, preferably using pg_routing?