summaryrefslogtreecommitdiff
path: root/.mypy.ini
diff options
context:
space:
mode:
authorPaarth Madan <paarth.madan@shopify.com>2021-11-17 20:37:23 -0500
committerGitHub <noreply@github.com>2021-11-17 20:37:23 -0500
commit4ebdb5e2ca6c6a1f9fb3bf8c2279f9b857c6d8a7 (patch)
tree44dc2950f418ef7b4580895e5ae10039ae78e738 /.mypy.ini
parentdffe9cd8dd9d30760181a7fa07d422c56824e75a (diff)
downloadnetworkx-4ebdb5e2ca6c6a1f9fb3bf8c2279f9b857c6d8a7.tar.gz
Only compute shortest path lengths when used (#5183)
In the case when alpha is 1, the expression making use of the path_len is nullified by the preeceding factor evaluating to zero. Computing a dictionary of all shortest path lengths is expensive. We should avoid computing this when the result isn't used. 1 is a common enough value for alpha that the added complexity of this optimization is sufficiently justified.
Diffstat (limited to '.mypy.ini')
0 files changed, 0 insertions, 0 deletions