Please let me know if my question isn't phrased clearly and I'll try my best to rephrase!
We are given a large road-network (>1,000,000 nodes, >3,000,000 edges), this graph is unweighted and undirected. In this graph, we will select 1000 random nodes as 'police stations'.
To find the distance to the nearest police station from each node, I was able to solve it by implementing a multi-source BFS, where the police station nodes are added to the queue at the start. The complexity is then O(V+E) compared to O(V(V+E)) when running the normal BFS V times.
However, I can't think of a way to modify this algorithm to find the distance to the k-nearest police stations from each node, instead of just the nearest one.
I'd really really appreciate if you guys could suggest a suitable algorithm or point me in the right direction!