Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Iterative Deepening Search #3084

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mohdkashif93
Copy link
Contributor

Addresses #1909. I have added the initial logic for Iterative Deepening Search (also known as Iterative Deepening DFS). I have following question about the implementation

  1. Here I am returning True or False depending on whether the target node is reachable from the source node or not. Is the correct way or do you want me to return the path from source to target?

TODO:

  1. Add examples in docstrings
  2. Add tests

@dschult
Copy link
Member

dschult commented Jul 24, 2018

Returning True or False isn't very useful here (as I guess you figured out). BFS would work better for discovering if two nodes are connected. So we have to figure out what service we are providing...

Since IDS is essentially like breadth-first-search, we should probably create a similar module to breadth_first_search.py with functions that yield edges, predecessors, successors, etc all using the same basic algorithm. I may be missing the point here, so think about it yourself too. What do people want to use IDS for? Are there general uses that we should provide?

@mohdkashif93
Copy link
Contributor Author

From what I understand about the algorithm, it is more useful in a scenario when we have say large graphs, in which traditional BFS/DFS would run out of memory(it makes the assumption that the branching factor is finite). So we can make use of IDS for large graphs, like if a path exists between two nodes, path between the said nodes. I am not sure if predecessors/successors and tree methods will be useful here since one will be using this for large graphs, the output from these 3 methods might make the program run out of memory? (And in case if it does not run out memory, then traditional BFS would work as well, I mean that's the whole point of IDS -- to increase the depth gradually till we reach our goal). So I am thinking of changing the return type as the following: List of edges between source and target if a path exists, None otherwise.

Please let me know your thoughts on this. :)

Apologies for the delay in response.

Base automatically changed from master to main March 4, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants