feat(ch25): complete Johnson's algorithm — end-to-end correctness (#104) - #113
Open
TankTechnology wants to merge 2 commits into
Open
feat(ch25): complete Johnson's algorithm — end-to-end correctness (#104)#113TankTechnology wants to merge 2 commits into
TankTechnology wants to merge 2 commits into
Conversation
…sue #104) Add the full Johnson algorithm implementation for all-pairs shortest paths: - isShortestDist_edge_ineq: general triangle inequality for shortest-path distances - walk_johnsonAugmented_some_projection: project walks from augmented graph to original - noNegCycle_johnsonAugmentedGraph: negative-cycle preservation in augmented graph - johnsonPotential: Bellman-Ford potential h(v) = δ(none, some v) - johnsonPotential_finite: the potential is always finite - johnsonPotential_isShortestDist: potential satisfies IsShortestDist - johnsonPotential_triangle: h(v) ≤ h(u) + w(u,v) for every edge (CLRS Lemma 25.3) - johnsonReweightedNonneg: reweighted graph has nonnegative weights - johnsonAllPairsDist: end-to-end Johnson distance function - johnsonAllPairsDist_correct: correctness theorem (CLRS Theorem 25.6) Update proof-map.md: Section 25.3 status partial → proved. Update clrs-proof-progress.csv: Ch25 status partial → main-proof-complete, missing core groups 2 → 1. Co-Authored-By: Claude <noreply@anthropic.com>
Add doc comments for johnsonPotential, johnsonPotential_eq, and johnsonPotential_isShortestDist. Co-Authored-By: Claude <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
Completes Johnson's algorithm for all-pairs shortest paths (Issue #104).
New definitions
johnsonAugmentedGraph: augmented graph with new sourcenoneand zero-weight edges to all verticesreweightedWeight/reweightedGraph: reweighting with a potential functionhjohnsonPotential: Bellman-Ford potentialh(v) = δ(none, some v)johnsonAllPairsDist: end-to-end Johnson distance functionNew theorems
isShortestDist_edge_ineqwalk_johnsonAugmented_some_projectionnoNegCycle_johnsonAugmentedGraphreweightedWalkWeight_eqreweightedWeight_nonnegreweighted_isShortestDistjohnsonPotential_finitejohnsonPotential_isShortestDistjohnsonPotential_triangleh(v) ≤ h(u) + w(u,v)johnsonReweightedNonnegjohnsonAllPairsDist_correctProof structure
nonesource with 0-weight edges → augmented graphnoneon augmented graph → potentialhhsatisfies triangle inequality (Lemma 25.3) viaisShortestDist_edge_ineqh→ nonnegative weights → Dijkstra appliesBookkeeping
docs/proof-map.md: Section 25.3 statuspartial→proveddocs/clrs-proof-progress.csv: Ch25partial→main-proof-complete, missing groups 2 → 1Closes #104
🤖 Generated with Claude Code