Skip to content

Dag shortestpath using the shortest path process and driver#3061

Merged
cvvergara merged 3 commits into
pgRouting:developfrom
cvvergara:dagShortestpath-using-the-shortestPath-process-and-driver
Feb 7, 2026
Merged

Dag shortestpath using the shortest path process and driver#3061
cvvergara merged 3 commits into
pgRouting:developfrom
cvvergara:dagShortestpath-using-the-shortestPath-process-and-driver

Conversation

@cvvergara
Copy link
Copy Markdown
Member

@cvvergara cvvergara commented Feb 7, 2026

Fixes #3060

Changes proposed in this pull request:

  • Makes pgr_dagShortestPath to use the shortest_path driver/process
  • Removes unused code of pgr_dagShortestPath because of the change
  • Updates news and release notes about the change

@pgRouting/admins

Summary by CodeRabbit

Release Notes

  • Enhancements

    • dagShortestPath now uses the shortest_path process and driver for improved consistency and algorithm handling.
  • Documentation

    • Updated release notes for pgRouting 4.1.0.
    • Enhanced localization support for dagShortestPath documentation.

@cvvergara cvvergara added this to the Release 4.1.0 milestone Feb 7, 2026
@cvvergara cvvergara added the DAG label Feb 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Feb 7, 2026

Walkthrough

The PR refactors dagShortestPath to standardize its implementation by adopting the shared shortest_path process and driver architecture. This involves adding a DAGSP enum value, creating a public function wrapper, removing the algorithm-specific driver implementation, and integrating dagShortestPath dispatch cases into the unified shortestPath_driver.

Changes

Cohort / File(s) Summary
Documentation & Release Notes
NEWS.md, doc/src/release_notes.rst, locale/en/LC_MESSAGES/pgrouting_doc_strings.po, locale/pot/pgrouting_doc_strings.pot
Added release notes and localization entries documenting that dagShortestPath now uses the shortest_path process and driver (issue #3060).
Enum Enhancement
include/c_common/enums.h
Added DAGSP enum member to the Which enumeration after EDWARDMOORE, enabling the unified driver dispatch mechanism.
Public API & Headers
include/dagShortestPath/dagShortestPath.hpp
Added a new public template function dagShortestPath as a wrapper around the underlying Pgr_dag::dag logic, delegating graph computation and returning results.
Driver Consolidation
include/drivers/dagShortestPath/dagShortestPath_driver.h, src/dagShortestPath/dagShortestPath_driver.cpp
Removed the algorithm-specific driver header and C++ implementation, consolidating functionality into the shared shortest_path process.
Core Implementation
src/dagShortestPath/dagShortestPath.c
Refactored to invoke pgr_process_shortestPath instead of the removed pgr_do_dagShortestPath, passing appropriate arguments (DAGSP enum, configuration flags); removed old static helper and adjusted includes.
Build Configuration
src/dagShortestPath/CMakeLists.txt
Removed dagShortestPath_driver.cpp from the library sources, leaving only dagShortestPath.c.
Unified Driver Integration
src/cpp_common/utilities.cpp, src/dijkstra/shortestPath_driver.cpp
Extended get_name and estimate_drivingSide utilities to handle DAGSP; added DAGSP cases in shortestPath_driver.cpp to dispatch dagShortestPath calls for both directed and undirected graphs.
Test Enhancement
pgtap/others/dagShortestPath/no_crash_test.pg
Updated version target and added error-path test coverage for empty edges scenario.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

Enhancement, C/C++, Function/Internal, Remove

Suggested reviewers

  • robe2
  • sanak

Poem

🐰 A rabbit hops with glee and cheer,
As drivers merge and paths are clear,
With DAGSP now unified and bright,
The shortest paths shine day and night!

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: refactoring dagShortestPath to use the shortest_path process and driver.
Linked Issues check ✅ Passed All code changes align with issue #3060: dagShortestPath now uses the shortest_path process/driver, removing old implementation.
Out of Scope Changes check ✅ Passed All changes are in scope: refactoring dagShortestPath, adding DAGSP enum, updating documentation, and modifying related files per the objective.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@include/dagShortestPath/dagShortestPath.hpp`:
- Around line 221-234: The dagShortestPath wrapper's combinations parameter is
mutable but Pgr_dag<G>::dag expects a const std::map& and peer wrappers like
edwardMoore use const; change the signature of dagShortestPath to accept const
std::map<int64_t, std::set<int64_t>> &combinations (and update any local uses
accordingly) so the call to fn_dag.dag(graph, combinations, only_cost) matches
the const-correct API of Pgr_dag::dag and keeps the wrapper consistent with
edwardMoore.

Comment thread include/dagShortestPath/dagShortestPath.hpp
@robe2 robe2 self-requested a review February 7, 2026 20:39
@cvvergara cvvergara merged commit 38f3750 into pgRouting:develop Feb 7, 2026
64 checks passed
@cvvergara cvvergara deleted the dagShortestpath-using-the-shortestPath-process-and-driver branch February 7, 2026 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dagShortestPath: use the shortest_path process and driver

2 participants