Skip to content

DFS processing finished nodes #80

Description

@zemanpeter

Describe the bug
If a node appears several times on the stack, then it will be processed several times in the else branch.
https://github.com/cheran-senthil/PyRival/blob/master/pyrival/graphs/dfs.py

Expected behaviour
I would expect the implementation to process each node only once after its subtree is finished.
I think it would be suitable to add something like this after line 18:
if finished[start]: continue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions