
15 Nov
2004
15 Nov
'04
9:17 a.m.
Hi David.
I have a directed BGL graph. Given two vertices U and V, I want to know whether there is a path from U to V. I don't care what path it is; I just want to know whether one exists or not. It looks like I might be able to use the BFS or DFS to do this, but that seems like attacking a mosquito with a tank.
Hmmm... I do not think you can do better than BFS unless your particular graph has some special knowledge in it that we are not aware of. Also... with BFS you do get the shortest path available and I believe you can force it to solve your 'more complicated' problem as well... HTH, Jurko Gospodnetiæ