Which algorithm do I use and how much does it cost if I have to:
Calculate all distances in an undirected and unweighted graph from two sources to all nodes.
I think the most appropriate algorithm is a BFS(G,s) with cost T(n)= O(V+E) where V= (number of nodes) and E=(number of arcs). The algorithm is the one in the figure. In this algorithm, however, only one source is considered. So it wouldn't answer the question. What would be the right answer and what the cost?