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

Identify duplicate simple pathways #35

Open
nuclearkatie opened this issue Dec 28, 2020 · 0 comments
Open

Identify duplicate simple pathways #35

nuclearkatie opened this issue Dec 28, 2020 · 0 comments
Assignees
Milestone

Comments

@nuclearkatie
Copy link
Member

NetworkX's all_simple_paths will find duplicate paths when there are multiple paths between a pair of nodes. For example, the following graph

Source Target
A B
B C
B C
C D

would produce two pathways from A to D: (A, B, C, D), and (A, B, C, D). As a pathway, they would be identical, although they include two different edges that are treated differently within NetworkX.

Currently acquisition_pathways just places pathways in a set, which destroys duplicate pathways without accounting for them in any way.

The question is, should duplicate pathways be noted separately, perhaps in a list, but then the pathways be returned as a set (no duplicates)? Or should the pathways list contain duplicates within it? If so, it cannot remain a set. It could be a list (ordered, though does it matter?), or potentially a collections.Counter, which is as close as python gets to a multiset

@nuclearkatie nuclearkatie self-assigned this Dec 28, 2020
@nuclearkatie nuclearkatie added this to the APA milestone Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant