Repository navigation
Conversation
A graph has many breadth-first trees. NetworkX's gives a node the parent that reached it first, walking each node's edges in the order they were added, and a matrix does not keep that order. These walk one level at a time, and min_first over a frontier holding each node's own index gives a newly reached node its neighbor on the level above that comes first in node order. Each level is yielded by parent and then by child, so the nodes at each depth are NetworkX's while the tree, and the order within a level, can differ. The backend's notes for both names say so. sort_neighbors is declined, so NetworkX answers it: the order of each node's neighbors is what picks NetworkX's tree. bfs_successors yields (source, []) for a source with no children, as NetworkX does, and an absent source raises NetworkX's error on the first step.
Open
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 10-centrality #110 +/- ##
=================================================
+ Coverage 90.07% 90.28% +0.21%
=================================================
Files 154 154
Lines 8078 8259 +181
Branches 1040 1054 +14
=================================================
+ Hits 7276 7457 +181
Misses 557 557
Partials 245 245 🚀 New features to boost your workflow:
|
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.
Add breadth-first edge and successor generators. The nodes at each depth match NetworkX's; the tree can differ because a matrix does not keep edge insertion order.
bfs_edgesbfs_successorssort_neighborsis declinedStacked on #109.