Node frontiers generator using depth-first search

Hi

Thank you for this great tool. I noticed that there is a function that produces the edge frontiers generator using depth-first-search (DFS), i.e. dgl.traversal.dfs_edges_generator. However, it seems that there is not such a function that produces the node frontiers using DFS, only those with BFS (dgl.traversal.bfs_nodes_generator). I am curious why there is not such a function. Also, is it possible to implement it using current APIs? Thanks!

Best,

Could you use dfs_edges_generator then with find_edges to find the node you are visiting?

1 Like

Hi @BarclayII

Thank you for the reply! I truly appreciate it. That might be an optional solution. I will have a try. But I am still curious why there is not such a function that produces the node frontiers using DFS. Are there any potential issues for this function? Thanks!

Best,

The reason is that we did not find a model that requires using dfs_nodes_generator at the point of developing these traversal functions. bfs_nodes_generator, bfs_edges_generator and dfs_edges_generator all have their usages (JTNN in particular - though it’s rewritten). I agree that adding one dfs_nodes_generator should be easy, though it may be of low priority.

1 Like

Hi @BarclayII

Thank you for the response! Now I understand the whole thing. Thanks!

Best,

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.