Template Function ADS::multiSourceDistance

Function Documentation

template<Graph G>
std::pair<std::vector<int>, std::vector<int>> ADS::multiSourceDistance(const G &g, const std::vector<int> &S)

multiSourceDistance(): the distance from the nearest node of S, INF if none reaches it, and the parents in the forest of the shortest paths, NIL for the nodes of S and those not reached

Pre:

the items of S are nodes

Post:

0 on S, and each node reached but those of S one edge farther than its parent, with no edge from a reached node farther (audit)