7 Apr
2006
7 Apr
'06
3:35 p.m.
On 4/7/06, Steven Van Ingelgem
What I have is 5000 cities (vertices), 14000 roads (edges) between them (directional roads)... And what I want to know is which roads I have to take to encounter the least cities on my way.
Every edge has a weight of 1... So the documentation points me to using the breadth_first_search algorithm.
But this function - as far as I can see - goes through the entire graph. I don't see any way to stop it (for example when it has discovered my targetcity)??
Is it possible someone can point me where I can have a look at?
Yes, just throw an exception with a bfs visitor when it has discovered your target city. Look at in archive of this mailing list, their are some examples how to do that. Regards, -- Johan