
7 Mar
2012
7 Mar
'12
3:25 p.m.
On Wed, 7 Mar 2012, Gordon Woodhull wrote:
On Mar 7, 2012, at 8:27 AM, Leo Hidd
wrote: and how do I create this "super source" vertex? The dijkstra_shortest_paths function takes only one vertex_descriptor, not an array of it (isn't it?).
I meant, just add a special vertex to your graph and connect it with zero-weight edges to all the sources you want, and specify that as the source. Requires a little bit of detective work at the end to see which source a path goes through, but it should get you your answer.
Even that isn't too hard -- keep a predecessor map, then walk up it from each vertex until you reach one of the source vertices; that will be the closest one. -- Jeremiah Willcock