Unexpected values in NetworkX to_numpy_array output for parallel edges
0 reputation · 16 Nov 2023, 04:23 UTC
When converting a NetworkX MultiGraph or MultiDiGraph that contains parallel edges to a NumPy array using to_numpy_array with a weight attribute, the resulting matrix may show values that do not match any single edge weight.
The function’s documentation does not state how it combines the weights of parallel edges, so users cannot determine whether the values represent a sum, maximum, first‑encountered weight, or another aggregation.
What aggregation rule does to_numpy_array currently apply to parallel edges?
Is this rule documented or made configurable through a parameter?
Should downstream numeric analyses assume the current behavior, or should users verify the result by alternative means?