Skip to content

perf(graph): search shortest paths from both ends - #54

Merged
prrao87 merged 1 commit into
mainfrom
fix/bidirectional-shortest-path
Oct 26, 2026
Merged

prrao87 merged 1 commit into
mainfrom
fix/bidirectional-shortest-path

Conversation

@prrao87

@prrao87 prrao87 commented Oct 26, 2026

Copy link
Copy Markdown
Member

Why

#37 was merged into its intermediate base branch (codex/issue-11-bounded-csr) instead of main, so its change never reached main. Merging that branch now conflicts in csr_expand.rs, because it also carries an older copy of #31's first commit, which main already has in squashed form.

What changed

This cherry-picks only #37's own commit onto main, keeping its original author. It contains no other changes.

When one source has exactly one target and reverse adjacency exists, shortest-path search now runs from both ends. It always expands the smaller frontier and stitches the two predecessor graphs together where they meet. All shortest paths and parallel edges are kept. shortestPath may return a different path of the same length than before, which Cypher allows and the docs already mention.

Validation

  • The cherry-pick applied cleanly onto current main.
  • cargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass (600 tests, including perf(graph): search shortest paths from both ends #37's tests that compare against the forward search on every directed three-node graph).
  • In python/: make install, make test (383 passed) and make lint pass.

🤖 Generated with Claude Code

Resolve #17 with complete-layer bidirectional search for single-target CSR queries, preserving all shortest paths and duplicate edges. Keep shared forward search for multiple targets.

Developed by David Hughes with assistance from Codex.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 48a054c
Status: ✅  Deploy successful!
Preview URL: https://15336ac3.lance-csr.pages.dev
Branch Preview URL: https://fix-bidirectional-shortest-p.lance-csr.pages.dev

View logs

@prrao87
prrao87 marked this pull request as ready for review October 26, 2026 16:54
@prrao87
prrao87 merged commit 187a134 into main Oct 26, 2026
8 checks passed
@prrao87
prrao87 deleted the fix/bidirectional-shortest-path branch October 26, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants