Skip to content

Identify duplicate simple pathways #35

@nuclearkatie

Description

@nuclearkatie

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions