Add BellmanFord tests for unreachable node relaxation#1250
Merged
williamfiset merged 3 commits intomasterfrom Mar 5, 2026
Merged
Add BellmanFord tests for unreachable node relaxation#1250williamfiset merged 3 commits intomasterfrom
williamfiset merged 3 commits intomasterfrom
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
BellmanFordAdjacencyListTestwith 3 tests covering the unreachable node relaxation edge caseBUILDfileTests added
unreachableNodeDoesNotPolluteCostOfReachableNeighbor— an unreachable node with a cheaper edge must not update a reachable neighbour's distancenodeReachableOnlyThroughUnreachableIntermediaryStaysUnreachable— a node only reachable via an unreachable intermediary must remain at+InfunreachableNegativeCycleDoesNotTaintReachableNode— an unreachable negative cycle must not mark reachable nodes as-Infduring the cycle-detection passTest plan
bazel test //src/test/java/com/williamfiset/algorithms/graphtheory:BellmanFordAdjacencyListTest— all 3 tests pass🤖 Generated with Claude Code