Skip to content
This repository was archived by the owner on May 24, 2025. It is now read-only.
This repository was archived by the owner on May 24, 2025. It is now read-only.

filtergraph.py filtering is nondeterministic #26

@Notgnoshi

Description

@Notgnoshi
(includegraph) nots@bedlam ~/Documents/includegraph (ag/filter) $ ./filtergraph.py -i foo.tgf -f '*bar*' >/dev/null
2022-07-26 13:36:09,880 - filtergraph - INFO - Parsed 1123 nodes
2022-07-26 13:36:09,880 - filtergraph - INFO - Filtering graph...
2022-07-26 13:36:09,906 - filtergraph - INFO - Removed 798 nodes
(includegraph) nots@bedlam ~/Documents/includegraph (ag/filter) $ ./filtergraph.py -i foo.tgf -f '*bar*' >/dev/null
2022-07-26 13:36:30,296 - filtergraph - INFO - Parsed 1123 nodes
2022-07-26 13:36:30,296 - filtergraph - INFO - Filtering graph...
2022-07-26 13:36:30,322 - filtergraph - INFO - Removed 829 nodes
(includegraph) nots@bedlam ~/Documents/includegraph (ag/filter) $ ./filtergraph.py -i foo.tgf -f '*bar*' >/dev/null
2022-07-26 13:36:49,054 - filtergraph - INFO - Parsed 1123 nodes
2022-07-26 13:36:49,054 - filtergraph - INFO - Filtering graph...
2022-07-26 13:36:49,079 - filtergraph - INFO - Removed 819 nodes
(includegraph) nots@bedlam ~/Documents/includegraph (ag/filter) $ ./filtergraph.py -i foo.tgf -f '*bar*' >/dev/null
2022-07-26 13:36:50,459 - filtergraph - INFO - Parsed 1123 nodes
2022-07-26 13:36:50,459 - filtergraph - INFO - Filtering graph...
2022-07-26 13:36:50,483 - filtergraph - INFO - Removed 833 nodes
(includegraph) nots@bedlam ~/Documents/includegraph (ag/filter) $ ./filtergraph.py -i foo.tgf -f '*bar*' >/dev/null
2022-07-26 13:36:51,887 - filtergraph - INFO - Parsed 1123 nodes
2022-07-26 13:36:51,887 - filtergraph - INFO - Filtering graph...
2022-07-26 13:36:51,912 - filtergraph - INFO - Removed 824 nodes

This is because set iteration order is nondeterministic, so each BFS searches starting at a random node.

But even with random iteration order, the number of nodes filtered should be the same.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions