Bi directional dijkstra#7982
Conversation
There was a problem hiding this comment.
Click here to look at the relevant links ⬇️
🔗 Relevant Links
Repository:
Python:
Automated review generated by algorithms-keeper. If there's any problem regarding this review, please open an issue about it.
algorithms-keeper commands and options
algorithms-keeper actions can be triggered by commenting on this PR:
@algorithms-keeper reviewto trigger the checks for only added pull request files@algorithms-keeper review-allto trigger the checks for all the pull request files, including the modified files. As we cannot post review comments on lines not part of the diff, this command will post all the messages in one comment.NOTE: Commands are in beta and so this feature is restricted only to a member or owner of the organization.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| graph_fwd = { | ||
| "B": [["C", 1]], | ||
| "C": [["D", 1]], | ||
| "D": [["F", 1]], | ||
| "E": [["B", 1], ["G", 2]], | ||
| "F": [], | ||
| "G": [["F", 1]], | ||
| } | ||
| graph_bwd = { | ||
| "B": [["E", 1]], | ||
| "C": [["B", 1]], | ||
| "D": [["C", 1]], | ||
| "F": [["D", 1], ["G", 1]], | ||
| "G": [["E", 2]], | ||
| } | ||
| print( | ||
| bidirectional_dij("E", "F", graph_fwd, graph_bwd) | ||
| ) # # E -- 2 --> G -- 1 --> F == 3 | ||
|
|
||
| if __name__ == "__main__": |
There was a problem hiding this comment.
This should be moved within the if name == main
There was a problem hiding this comment.
Cannot put graph_fwd and graph_bwd inside any other scope because it was giving error in the GitHub workflow while running test that graph_fwd is not defined
There was a problem hiding this comment.
It has to stay the global scope, I did moved it inside if __name__ == "__main__ and it is working locally but somehow not passing this GitHub workflow
|
Please fix the checks as well |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
All check blockers are resolved @CaedenPH |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
| graph_fwd = { | ||
| "B": [["C", 1]], | ||
| "C": [["D", 1]], | ||
| "D": [["F", 1]], | ||
| "E": [["B", 1], ["G", 2]], | ||
| "F": [], | ||
| "G": [["F", 1]], | ||
| } | ||
| graph_bwd = { | ||
| "B": [["E", 1]], | ||
| "C": [["B", 1]], | ||
| "D": [["C", 1]], | ||
| "F": [["D", 1], ["G", 1]], | ||
| "E": [[None, np.inf]], | ||
| "G": [["E", 2]], | ||
| } |
There was a problem hiding this comment.
Move this within the doctest - its why it failed earlier
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
* Added Bi-Directional Dijkstra * Added Bi-Directional Dijkstra * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Added doctest and type hints * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Rename Bi_directional_Dijkstra.py to bi_directional_dijkstra.py * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update bi_directional_dijkstra.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.