Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ To see all issues & pull requests closed by this release see the
* [#3064](https://github.com/pgRouting/pgrouting/issues/3064): Astar: create and use a process and driver for Astar
* [#3075](https://github.com/pgRouting/pgrouting/issues/3075): Spanning tree: create and use a process and driver
* [#3086](https://github.com/pgRouting/pgrouting/issues/3086): MaxFlow: create and use a process and driver
* [#3089](https://github.com/pgRouting/pgrouting/issues/3089): edgeDisjoint and bellmanFord use shortestPath driver and
process

## pgRouting 4.0

Expand Down
2 changes: 2 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ To see all issues & pull requests closed by this release see the
* :issue:`3064`: Astar: create and use a process and driver for Astar
* :issue:`3075`: Spanning tree: create and use a process and driver
* :issue:`3086`: MaxFlow: create and use a process and driver
* :issue:`3089`: edgeDisjoint and bellmanFord use shortestPath driver and
process

pgRouting 4.0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
19 changes: 18 additions & 1 deletion include/bellman_ford/bellman_ford.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include "c_types/ii_t_rt.h"

namespace pgrouting {
namespace algorithms {

template < class G >
class Pgr_bellman_ford : public pgrouting::Pgr_messages {
Expand Down Expand Up @@ -181,7 +182,23 @@ class Pgr_bellman_ford : public pgrouting::Pgr_messages {

//@}
};

} // namespace algorithms

namespace functions {

template <class G>
std::deque<pgrouting::Path>
bellmanFord(
G &graph,
const std::map<int64_t, std::set<int64_t>> &combinations,
bool only_cost = false) {
algorithms::Pgr_bellman_ford<G> fn_bellman_ford;
auto paths = fn_bellman_ford.bellman_ford(graph, combinations, only_cost);
for (auto &p : paths) p.recalculate_agg_cost();
return paths;
}

} // namespace functions
} // namespace pgrouting

#endif // INCLUDE_BELLMAN_FORD_BELLMAN_FORD_HPP_
2 changes: 2 additions & 0 deletions include/c_common/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ enum Which {
/** shortest_paths */
DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, BDDIJKSTRA, EDWARDMOORE,
DAGSP,
BELLMANFORD,
EDGEDISJOINT,
Comment on lines +36 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Verify get_name(Which) coverage for newly added enum values.

BELLMANFORD and EDGEDISJOINT are added here, but src/cpp_common/utilities.cpp (the get_name(Which) overload) appears to fall through to "unknown" for these values. Please confirm whether that overload is reachable in these paths and add cases if needed.

#!/bin/bash
set -euo pipefail

echo "=== get_name(Which) implementation ==="
rg -n -A120 -B5 'get_name\s*\(\s*Which\s+which\s*\)' src/cpp_common/utilities.cpp

echo
echo "=== Call sites using get_name(...) ==="
rg -nP '\bget_name\s*\(' src include

echo
echo "=== New enum usage sites ==="
rg -nP '\bBELLMANFORD\b|\bEDGEDISJOINT\b' src include

Expected result: either (a) no reachable path uses get_name(Which) for these enums, or (b) switch cases are added so it never returns "unknown" for them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@include/c_common/enums.h` around lines 36 - 37, The get_name(Which) overload
in src/cpp_common/utilities.cpp currently returns "unknown" for BELLMANFORD and
EDGEDISJOINT; locate the get_name(Which) function and either (a) confirm no
reachable call sites pass the new enum values by searching call sites that pass
Which, or (b) add explicit switch cases for BELLMANFORD and EDGEDISJOINT in
get_name(Which) so they map to the proper string names (use the enum identifiers
BELLMANFORD and EDGEDISJOINT to find the exact enum and implement the
corresponding case arms), ensuring the function never falls through to "unknown"
for these values.

/** allpairs **/
FLOYD = 31, JOHNSON,
/** metrics **/
Expand Down
7 changes: 1 addition & 6 deletions include/cpp_common/combinations.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@ namespace utilities {


std::map<int64_t, std::set<int64_t>>
get_combinations(
std::deque<Path>&,
const std::vector<pgrouting::trsp::Rule>&);

std::map<int64_t, std::set<int64_t>>
get_combinations(const std::vector<II_t_rt>&);
get_combinations(std::deque<Path>&, const std::vector<pgrouting::trsp::Rule>&);

std::map<int64_t, std::set<int64_t>>
get_combinations(const std::string&, ArrayType*, ArrayType*, bool, bool&);
Expand Down
6 changes: 6 additions & 0 deletions include/cpp_common/to_postgres.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ size_t get_tuples(const std::deque<pgrouting::Path>&, MST_rt*&);
*/
size_t get_tuples(const std::vector<Flow_t>&, Flow_t*&);

/*
* @brief get tuples for Path_rt
*/
size_t
get_tuples(std::vector<Path_rt>&, const std::vector<Edge_t>&, Path_rt*&);

/*
* @brief get tuples for spanning tree driver
*/
Expand Down
76 changes: 0 additions & 76 deletions include/drivers/bellman_ford/bellman_ford_driver.h

This file was deleted.

76 changes: 0 additions & 76 deletions include/drivers/bellman_ford/bellman_ford_neg_driver.h

This file was deleted.

76 changes: 0 additions & 76 deletions include/drivers/max_flow/edge_disjoint_paths_driver.h

This file was deleted.

6 changes: 6 additions & 0 deletions include/max_flow/maxflow.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ class PgrFlowGraph {
};

} // namespace graph

namespace functions {

std::vector<Path_rt> edgeDisjoint(std::vector<Edge_t>, const std::map<int64_t, std::set<int64_t>>&, bool);

} // namespace functions
} // namespace pgrouting

#endif // INCLUDE_MAX_FLOW_MAXFLOW_HPP_
7 changes: 6 additions & 1 deletion locale/en/LC_MESSAGES/pgrouting_doc_strings.po
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pgRouting v4.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-01 21:16+0000\n"
"POT-Creation-Date: 2026-03-04 00:25+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -3966,6 +3966,11 @@ msgid ""
"create and use a process and driver"
msgstr ""

msgid ""
"`#3089 <https://github.com/pgRouting/pgrouting/issues/3089>`__: edgeDisjoint "
"and bellmanFord use shortestPath driver and process"
msgstr ""

msgid "All releases"
msgstr ""

Expand Down
5 changes: 4 additions & 1 deletion locale/pot/pgrouting_doc_strings.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pgRouting v4.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-03-01 21:16+0000\n"
"POT-Creation-Date: 2026-03-04 00:25+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
Expand Down Expand Up @@ -3553,6 +3553,9 @@ msgstr ""
msgid "`#3086 <https://github.com/pgRouting/pgrouting/issues/3086>`__: MaxFlow: create and use a process and driver"
msgstr ""

msgid "`#3089 <https://github.com/pgRouting/pgrouting/issues/3089>`__: edgeDisjoint and bellmanFord use shortestPath driver and process"
msgstr ""

msgid "All releases"
msgstr ""

Expand Down
3 changes: 0 additions & 3 deletions src/bellman_ford/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,5 @@

ADD_LIBRARY(bellman_ford OBJECT
bellman_ford.c
bellman_ford_driver.cpp
#bellman_ford_neg.c
#bellman_ford_neg_driver.cpp
edwardMoore.c
)
Loading