Traversing a Relation Graph with DFS
Hello Everyone,
I have created a connected graph, where each node represents some fact. The centre is the point of start. You may think of it as a mind map. I want to search the map in a Depth First Manner. I understand the concept but don't know how to apply it. Here is a pseudocode
dfs(vertex v)
{
visit(v);
for each neighbour w of v
if w is unvisited
{
dfs(w);
add edge vw to tree T
}
}
I am really confused on how to maintain the tree. Please help me do it. Or at least explain me how to apply it.








