[BGL] Search Algrorithms' Behavior

Hello, I have an undirected graph with several isolated (unconnected) sub-graphs. For example Vertex {1, 2, 3, 4, 5} Edge {(1,2), (1,3) (4, 5)} I want to know what will be the behavior of the search algorithms (such as DFS, BFS, or undirected_DFS) when I submit a search call with a specified beginning vertex. As a result, all of the verteces will be visited, or just those topologically connected to the input vertex? Any help will be appreciated. Max

Wang Weiwei wrote:
Hello,
I have an undirected graph with several isolated (unconnected) sub-graphs. For example
Vertex {1, 2, 3, 4, 5} Edge {(1,2), (1,3) (4, 5)}
I want to know what will be the behavior of the search algorithms (such as DFS, BFS, or undirected_DFS) when I submit a search call with a specified beginning vertex. DFS or BFS should only find the vertices that are connected to the starting vertex.
-- JDL
participants (2)
-
John D Lamb
-
Wang Weiwei