Repository navigation
Conversation
This branch has not been deployed
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.
Describe your change
PriorityQueue.extract_minleaves an obsolete entry in its backing array and does not update the replacement root's position before heapifying. A five-node graph containing a zero-weight edge can consequently crash withKeyError:Remove the last backing entry, update the replacement root's position, and skip heapifying when the queue becomes empty. The reproducer now returns distances
[0, 1, 2, 3, 1]. The existing doctests remain unchanged.Local validation on Python 3.15.2 free-threaded:
heapqreference pass for four-node undirected graphs with absent/zero/one/three-weight edges and no isolated vertices, from every source.git diff --checkpass.tyreports no source errors and four existing renamed-rule configuration warnings.Regression harnesses were run separately from this code-only patch, following the repository's request to keep implementation and test changes in separate PRs. The legacy parent-index behavior in
decrease_keyis outside this extraction fix.Checklist