Skip to content
Merged
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 @@ -15,6 +15,8 @@ To see all issues & pull requests closed by this release see the
**Code enhancements**

* [#3049](https://github.com/pgRouting/pgrouting/issues/3049): Use enumeration on drivers and process.
* [#3054](https://github.com/pgRouting/pgrouting/issues/3054): Change error message when edges_sql is empty
* [#3055](https://github.com/pgRouting/pgrouting/issues/3055): bdDijkstra: use the shortest_path process and driver
Comment thread
cvvergara marked this conversation as resolved.

## 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 @@ -40,6 +40,8 @@ To see all issues & pull requests closed by this release see the
.. rubric:: Code enhancements

* :issue:`3049`: Use enumeration on drivers and process.
* :issue:`3054`: Change error message when edges_sql is empty
* :issue:`3055`: bdDijkstra: use the shortest_path process and driver

pgRouting 4.0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
32 changes: 32 additions & 0 deletions include/bdDijkstra/bdDijkstra.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#include <vector>
#include <limits>
#include <functional>
#include <set>
#include <map>
#include <deque>


#include "cpp_common/bidirectional.hpp"
Expand Down Expand Up @@ -141,6 +144,35 @@ class Pgr_bdDijkstra : public Pgr_bidirectional<G> {
};

} // namespace bidirectional

namespace algorithms {

template <class G>
std::deque<pgrouting::Path>
bdDijkstra(
G &graph,
const std::map<int64_t, std::set<int64_t>> &combinations,
bool only_cost) {
using pgrouting::Path;

pgrouting::bidirectional::Pgr_bdDijkstra<G> fn_bdDijkstra(graph);
std::deque<Path> paths;

for (const auto &comb : combinations) {
auto source = comb.first;
if (!graph.has_vertex(source)) continue;

for (const auto &target : comb.second) {
if (!graph.has_vertex(target)) continue;
fn_bdDijkstra.clear();

paths.push_back(fn_bdDijkstra.pgr_bdDijkstra(graph.get_V(source), graph.get_V(target), only_cost));
}
}
return paths;
}

} // namespace algorithms
} // namespace pgrouting

#endif // INCLUDE_BDDIJKSTRA_BDDIJKSTRA_HPP_
2 changes: 1 addition & 1 deletion include/c_common/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ enum Which {
/** directed graph + results: vertex id */
TOPOSORT = 11,
/** shortest_paths */
DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS,
DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, BDDIJKSTRA,
Comment thread
coderabbitai[bot] marked this conversation as resolved.
/** allpairs **/
FLOYD = 31, JOHNSON,
/** metrics **/
Expand Down
76 changes: 0 additions & 76 deletions include/drivers/bdDijkstra/bdDijkstra_driver.h

This file was deleted.

12 changes: 11 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-02-01 00:30+0000\n"
"POT-Creation-Date: 2026-02-05 18:16+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 @@ -3931,6 +3931,16 @@ msgid ""
"enumeration on drivers and process."
msgstr ""

msgid ""
"`#3054 <https://github.com/pgRouting/pgrouting/issues/3054>`__: Change error "
"message when edges_sql is empty"
msgstr ""

msgid ""
"`#3055 <https://github.com/pgRouting/pgrouting/issues/3055>`__: bdDijkstra: "
"use the shortest_path process and driver"
msgstr ""

msgid "All releases"
msgstr ""

Expand Down
8 changes: 7 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-02-01 00:30+0000\n"
"POT-Creation-Date: 2026-02-05 18:16+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 @@ -3532,6 +3532,12 @@ msgstr ""
msgid "`#3049 <https://github.com/pgRouting/pgrouting/issues/3049>`__: Use enumeration on drivers and process."
msgstr ""

msgid "`#3054 <https://github.com/pgRouting/pgrouting/issues/3054>`__: Change error message when edges_sql is empty"
msgstr ""

msgid "`#3055 <https://github.com/pgRouting/pgrouting/issues/3055>`__: bdDijkstra: use the shortest_path process and driver"
msgstr ""

msgid "All releases"
msgstr ""

Expand Down
3 changes: 2 additions & 1 deletion pgtap/allpairs/floydWarshall/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT plan(5);
SELECT plan(6);

PREPARE edges AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand All @@ -32,6 +32,7 @@ LANGUAGE plpgsql VOLATILE;


SELECT * FROM test_function();
SELECT throw_on_empty_edges_sql('pgr_floydWarshall', '');

SELECT finish();
ROLLBACK;
3 changes: 2 additions & 1 deletion pgtap/allpairs/johnson/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT plan(5);
SELECT plan(6);

PREPARE edges AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand All @@ -33,6 +33,7 @@ LANGUAGE plpgsql VOLATILE;


SELECT * FROM test_function();
SELECT throw_on_empty_edges_sql('pgr_johnson', '');

SELECT finish();
ROLLBACK;
4 changes: 3 additions & 1 deletion pgtap/bdDijkstra/bdDijkstra/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ BEGIN;


UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN min_version('3.2.0') THEN plan(97) ELSE plan(84) END;
SELECT CASE WHEN min_version('3.2.0') THEN plan(98) ELSE plan(85) END;


SELECT general_no_crash('pgr_bdDijkstra');
SELECT throw_on_empty_edges_sql('pgr_bdDijkstra', ',1,2');

SELECT finish();
ROLLBACK;
4 changes: 3 additions & 1 deletion pgtap/bdDijkstra/bdDijkstraCost/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ BEGIN;


UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN min_version('3.2.0') THEN plan(97) ELSE plan(84) END;
SELECT CASE WHEN min_version('3.2.0') THEN plan(98) ELSE plan(85) END;


SELECT general_no_crash('pgr_bdDijkstraCost');
SELECT throw_on_empty_edges_sql('pgr_bdDijkstraCost', ',1,2');

SELECT finish();
ROLLBACK;

3 changes: 2 additions & 1 deletion pgtap/bdDijkstra/bdDijkstraCostMatrix/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT plan(14);
SELECT plan(15);

PREPARE edges AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand Down Expand Up @@ -45,6 +45,7 @@ LANGUAGE plpgsql VOLATILE;


SELECT * FROM test_function();
SELECT throw_on_empty_edges_sql('pgr_bdDijkstraCostMatrix', ',ARRAY[1,2]');

SELECT finish();
ROLLBACK;
4 changes: 3 additions & 1 deletion pgtap/dijkstra/dijkstra/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ BEGIN;


UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN min_version('3.1.0') THEN plan(81) ELSE plan(68) END;
SELECT CASE WHEN min_version('3.1.0') THEN plan(82) ELSE plan(69) END;

SELECT no_crash_dijkstra('pgr_dijkstra');
SELECT throw_on_empty_edges_sql('pgr_dijkstra', ',1,2');

SELECT finish();

ROLLBACK;
5 changes: 3 additions & 2 deletions pgtap/dijkstra/dijkstraCost/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ BEGIN;


UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN min_version('3.1.0') THEN plan(81) ELSE plan(68) END;
SELECT CASE WHEN min_version('3.1.0') THEN plan(82) ELSE plan(69) END;

SELECT no_crash_dijkstra('pgr_dijkstraCost');
SELECT finish();
SELECT throw_on_empty_edges_sql('pgr_dijkstraCost', ',1,2');

SELECT finish();
ROLLBACK;
3 changes: 2 additions & 1 deletion pgtap/dijkstra/dijkstraCostMatrix/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT plan(14);
SELECT plan(15);

PREPARE edges AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand Down Expand Up @@ -45,6 +45,7 @@ LANGUAGE plpgsql VOLATILE;


SELECT * FROM test_function();
SELECT throw_on_empty_edges_sql('pgr_dijkstraCostMatrix', ',ARRAY[1,2]');

SELECT finish();
ROLLBACK;
3 changes: 2 additions & 1 deletion pgtap/dijkstra/dijkstraNear/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

BEGIN;

SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(126) END;
SELECT CASE WHEN min_version('3.2.0') THEN plan(127) ELSE plan(1) END;
SET client_min_messages TO WARNING;
UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);

Expand Down Expand Up @@ -136,6 +136,7 @@ BEGIN
RETURN query SELECT * FROM no_crash_test('pgr_dijkstraNear', params1, subs2);
RETURN query SELECT * FROM no_crash_test('pgr_dijkstranear', params2, subs1);
RETURN query SELECT * FROM no_crash_test('pgr_dijkstraNear', params2, subs2);
RETURN query SELECT throw_on_empty_edges_sql('pgr_dijkstranear', ',1,ARRAY[5,6]');
END
$BODY$
LANGUAGE plpgsql VOLATILE;
Expand Down
4 changes: 3 additions & 1 deletion pgtap/dijkstra/dijkstraNearCost/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

BEGIN;

SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(126) END;
SELECT CASE WHEN min_version('3.2.0') THEN plan(127) ELSE plan(1) END;
SET client_min_messages TO WARNING;

UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id;
Expand Down Expand Up @@ -142,11 +142,13 @@ SELECT is_empty('null_comb', 'Should be empty to tests be meaningful');
RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params1, subs2);
RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params2, subs1);
RETURN query SELECT * FROM no_crash_test('pgr_dijkstranearcost', params2, subs2);
RETURN query SELECT throw_on_empty_edges_sql('pgr_dijkstranearcost', ',1,ARRAY[5,6]');
END
$BODY$
LANGUAGE plpgsql VOLATILE;


SELECT * FROM no_crash();

SELECT finish();
ROLLBACK;
3 changes: 2 additions & 1 deletion pgtap/metrics/bandwidth/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN min_version('4.0.0') THEN plan(4) ELSE plan(1) END;
SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(1) END;

PREPARE edges_q AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand Down Expand Up @@ -38,6 +38,7 @@ BEGIN
]::TEXT[];

RETURN query SELECT * FROM no_crash_test('pgr_bandwidth', params, subs);
RETURN query SELECT throw_on_empty_edges_sql('pgr_bandwidth', '');

END
$BODY$
Expand Down
3 changes: 2 additions & 1 deletion pgtap/ordering/cuthillMckeeOrdering/no_crash_test.pg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN;

UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost);
SELECT CASE WHEN NOT min_version('3.4.0') THEN plan(1) ELSE plan(7) END;
SELECT CASE WHEN min_version('3.4.0') THEN plan(8) ELSE plan(1) END;

PREPARE edges AS
SELECT id, source, target, cost, reverse_cost FROM edges;
Expand Down Expand Up @@ -48,6 +48,7 @@ BEGIN
]::TEXT[];

RETURN query SELECT * FROM no_crash_test('pgr_cuthillMckeeOrdering', params, subs);
RETURN query SELECT throw_on_empty_edges_sql('pgr_cuthillMckeeOrdering', '');

END
$BODY$
Expand Down
Loading