Name: Anonymous 2009-01-30 15:51
If you have an undirected, unweighted graph G, and a marked subset of points called 'Firehouses,' is there an O(n+m) algorithm to find every vertex's closes firehouse?
I can only come up with O(n^2) stuff. Although I do like the idea of repeatedly raising the adjacency matrix to a power n, until every vertex has a nonzero entry :P
I can only come up with O(n^2) stuff. Although I do like the idea of repeatedly raising the adjacency matrix to a power n, until every vertex has a nonzero entry :P