Repository navigation
Add hyper_wiener_index function - #8184
Merged
Merged
Conversation
rossbar
reviewed
Aug 12, 2025
rossbar
left a comment
Contributor
There was a problem hiding this comment.
I'm personally dubious of the value of all these named indices, especially when they boil down to one-liners like this. That said there are already several other "generalizations" so there's precedent for adding more.
This commit introduces the `hyper_wiener_index`. The function is added to `networkx/algorithms/wiener.py` for consistency with related indices. It is defined for simple, connected, undirected graphs and handles edge weights. Comprehensive unit tests are included, covering correctness for standard graphs (path, cycle, complete), error handling for unsupported graph types, and behavior with trivial graphs and weighted edges. Closes networkx#8182
ilvallod
force-pushed
the
feat/hyper-wiener-index-8182
branch
from
August 13, 2025 14:42
57dfe18 to
83ba216
Compare
Contributor
Author
|
Thanks @rossbar for the feedback! I've made the changes you suggested. Is there anything else we need? |
alfred-mikhael
pushed a commit
to alfred-mikhael/networkx
that referenced
this pull request
Sep 3, 2025
* Add hyper_wiener_index function This commit introduces the `hyper_wiener_index`. The function is added to `networkx/algorithms/wiener.py` for consistency with related indices. It is defined for simple, connected, undirected graphs and handles edge weights. Comprehensive unit tests are included, covering correctness for standard graphs (path, cycle, complete), error handling for unsupported graph types, and behavior with trivial graphs and weighted edges. Closes networkx#8182 * Trigger CI * Formatting nits and add to reference docs. --------- Co-authored-by: Ross Barnowski <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces the
hyper_wiener_index.The function is added to
networkx/algorithms/wiener.pyfor consistency with related indices. It is defined for simple, connected, undirected graphs and handles edge weights.Comprehensive unit tests are included, covering correctness for standard graphs (path, cycle, complete), error handling for unsupported graph types, and behavior with trivial graphs and weighted edges.
Closes #8182