[BGL] Why there is no special handler for "discover_source_vertex" event in BFS visitor?
Hi there! Current implementation calls vis.discover_vertex(s, g); at this point, the same function being called for all others discovered vertices. I have one small problem wich could be nicely solved with such special handler and I believe that there are others when such handler could be usefull. Any suggestings why things is going exacly in this way? Best regards, --dima
Dmitry wrote:
Hi there! Current implementation calls vis.discover_vertex(s, g); at this point, the same function being called for all others discovered vertices. I have one small problem wich could be nicely solved with such special handler and I believe that there are others when such handler could be usefull. Any suggestings why things is going exacly in this way?
You know the source vertex when you call bfs, don't you? Is it not enough? If not, you can use the simple boolean flag to determine whether the vertex is first or not. -- Regards, Janusz
Janusz Piwowarski wrote:
Dmitry wrote:
Hi there! Current implementation calls vis.discover_vertex(s, g); at this point, the same function being called for all others discovered vertices. I have one small problem wich could be nicely solved with such special handler and I believe that there are others when such handler could be usefull. Any suggestings why things is going exacly in this way?
You know the source vertex when you call bfs, don't you? Is it not enough? If not, you can use the simple boolean flag to determine whether the vertex is first or not.
Yes, it is true. It just looks a litlle bit clumsy for me. Thanks, Dmitry
participants (3)
-
Dmitry
-
Dmitry Bufistov
-
Janusz Piwowarski