-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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