From a677916546f70acdf1f9359c0279ebc72feb92fb Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Tue, 24 Feb 2026 05:45:59 +0000 Subject: [PATCH 1/9] Fix: Restore pgr_boyerMyrvold to build and fix compilation bugs --- docqueries/planar/boyerMyrvold.result | 102 ++++++++---- docqueries/planar/test.conf | 1 + include/drivers/planar/boyerMyrvold_driver.h | 2 +- include/planar/boyerMyrvold.hpp | 1 - pgtap/planar/boyerMyrvold/edge_cases.pg | 154 +++++++++++++++++++ pgtap/planar/boyerMyrvold/inner_query.pg | 31 ++++ pgtap/planar/boyerMyrvold/no_crash_test.pg | 45 ++++++ pgtap/planar/boyerMyrvold/types_check.pg | 32 ++++ sql/planar/CMakeLists.txt | 2 + src/planar/CMakeLists.txt | 2 + src/planar/boyerMyrvold.c | 4 +- src/planar/boyerMyrvold_driver.cpp | 12 +- 12 files changed, 343 insertions(+), 45 deletions(-) create mode 100644 pgtap/planar/boyerMyrvold/edge_cases.pg create mode 100644 pgtap/planar/boyerMyrvold/inner_query.pg create mode 100644 pgtap/planar/boyerMyrvold/no_crash_test.pg create mode 100644 pgtap/planar/boyerMyrvold/types_check.pg diff --git a/docqueries/planar/boyerMyrvold.result b/docqueries/planar/boyerMyrvold.result index 9339252034..f1c0b9a283 100644 --- a/docqueries/planar/boyerMyrvold.result +++ b/docqueries/planar/boyerMyrvold.result @@ -5,66 +5,100 @@ SET /* :file: This file is part of the pgRouting project. :copyright: Copyright (c) 2018-2026 pgRouting developers :license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ --- q1 +/* -- q1 */ SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edge_table' + FROM edges' ); seq | source | target | cost -----+--------+--------+------ - 1 | 1 | 2 | 1 - 2 | 3 | 2 | 1 - 3 | 4 | 3 | 1 - 4 | 2 | 5 | 1 - 5 | 3 | 6 | 1 - 6 | 7 | 8 | 1 - 7 | 8 | 5 | 1 - 8 | 5 | 6 | 1 - 9 | 6 | 9 | 1 - 10 | 5 | 10 | 1 - 11 | 6 | 11 | 1 - 12 | 10 | 11 | 1 - 13 | 11 | 12 | 1 - 14 | 10 | 13 | 1 - 15 | 9 | 12 | 1 - 16 | 4 | 9 | 1 - 17 | 14 | 15 | 1 - 18 | 16 | 17 | 1 + 1 | 1 | 3 | 1 + 2 | 3 | 7 | 1 + 3 | 6 | 7 | 1 + 4 | 10 | 11 | 1 + 5 | 7 | 11 | 1 + 6 | 8 | 12 | 1 + 7 | 11 | 12 | 1 + 8 | 7 | 8 | 1 + 9 | 2 | 4 | 1 + 10 | 8 | 9 | 1 + 11 | 13 | 14 | 1 + 12 | 12 | 17 | 1 + 13 | 16 | 17 | 1 + 14 | 15 | 16 | 1 + 15 | 11 | 16 | 1 + 16 | 15 | 10 | 1 + 17 | 5 | 6 | 1 + 18 | 10 | 6 | 1 (18 rows) --- q2 -INSERT INTO edge_table (source, target, cost, reverse_cost) VALUES +/* -- q2 */ +INSERT INTO edges (source, target, cost, reverse_cost) VALUES (1,3,1,-1),(1,4,1,-1),(1,5,1,-1),(2,4,1,-1),(2,5,1,-1),(3,5,1,-1),(4,5,1,-1); INSERT 0 7 --- q3 +/* -- q3 */ SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edge_table' + FROM edges' ); seq | source | target | cost -----+--------+--------+------ -(0 rows) + 1 | 1 | 3 | 1 + 2 | 1 | 4 | 1 + 3 | 1 | 5 | 1 + 4 | 2 | 4 | 1 + 5 | 2 | 5 | 1 + 6 | 3 | 5 | 1 + 7 | 4 | 5 | 1 + 8 | 1 | 3 | 1 + 9 | 3 | 7 | 1 + 10 | 6 | 7 | 1 + 11 | 10 | 11 | 1 + 12 | 7 | 11 | 1 + 13 | 8 | 12 | 1 + 14 | 11 | 12 | 1 + 15 | 7 | 8 | 1 + 16 | 2 | 4 | 1 + 17 | 8 | 9 | 1 + 18 | 13 | 14 | 1 + 19 | 12 | 17 | 1 + 20 | 16 | 17 | 1 + 21 | 15 | 16 | 1 + 22 | 11 | 16 | 1 + 23 | 15 | 10 | 1 + 24 | 5 | 6 | 1 + 25 | 10 | 6 | 1 +(25 rows) --- q4 +/* -- q4 */ SELECT * FROM pgr_boyerMyrvold( $$ - SELECT id, source, target, cost, reverse_cost FROM edge_table + SELECT id, source, target, cost, reverse_cost FROM edges where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') + 'SELECT id, source, target, cost, reverse_cost FROM edges ') WHERE component = 14) ) OR target = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') + 'SELECT id, source, target, cost, reverse_cost FROM edges ') WHERE component = 14) ) $$ ); - seq | source | target | cost ------+--------+--------+------ - 1 | 14 | 15 | 1 -(1 row) +ERROR: No edges found +HINT: + SELECT id, source, target, cost, reverse_cost FROM edges + where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( + 'SELECT id, source, target, cost, reverse_cost FROM edges ') + WHERE component = 14) + ) + OR + target = any (ARRAY(SELECT node FROM pgr_connectedComponents( + 'SELECT id, source, target, cost, reverse_cost FROM edges ') + WHERE component = 14) + ) --- q5 +CONTEXT: SQL function "pgr_boyermyrvold" statement 1 +/* -- q5 */ ROLLBACK; ROLLBACK diff --git a/docqueries/planar/test.conf b/docqueries/planar/test.conf index 3c33912e3d..0898d21bb3 100644 --- a/docqueries/planar/test.conf +++ b/docqueries/planar/test.conf @@ -6,6 +6,7 @@ %main::tests = ( 'any' => { 'files' => [qw( + boyerMyrvold.pg isPlanar.pg )] }, diff --git a/include/drivers/planar/boyerMyrvold_driver.h b/include/drivers/planar/boyerMyrvold_driver.h index 65bccd93c4..e82033106d 100644 --- a/include/drivers/planar/boyerMyrvold_driver.h +++ b/include/drivers/planar/boyerMyrvold_driver.h @@ -42,7 +42,7 @@ typedef struct IID_t_rt IID_t_rt; #ifdef __cplusplus extern "C" { #endif - void pgr_do_pgr_boyerMyrvold( + void pgr_do_boyerMyrvold( const char*, IID_t_rt**, size_t*, char**, char**, char**); diff --git a/include/planar/boyerMyrvold.hpp b/include/planar/boyerMyrvold.hpp index 5729907db4..9d805dd343 100644 --- a/include/planar/boyerMyrvold.hpp +++ b/include/planar/boyerMyrvold.hpp @@ -36,7 +36,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include #include -#include #include #include "cpp_common/messages.hpp" diff --git a/pgtap/planar/boyerMyrvold/edge_cases.pg b/pgtap/planar/boyerMyrvold/edge_cases.pg new file mode 100644 index 0000000000..b07eb66212 --- /dev/null +++ b/pgtap/planar/boyerMyrvold/edge_cases.pg @@ -0,0 +1,154 @@ +/* :file: This file is part of the pgRouting project. +:copyright: Copyright (c) 2018-2026 pgRouting developers +:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ + + +BEGIN; + +UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); +SELECT CASE WHEN min_version('3.2.0') THEN plan (12) ELSE plan(1) END; + +CREATE OR REPLACE FUNCTION edge_cases() +RETURNS SETOF TEXT AS +$BODY$ +BEGIN + +IF NOT min_version('3.2.0') THEN + RETURN QUERY + SELECT skip(1, 'Function is new on 3.2.0'); + RETURN; +END IF; + +-- 0 edge, 0 vertex tests + +PREPARE q1 AS +SELECT id, source, target, cost, reverse_cost +FROM edges +WHERE id > 18; + +-- Graph is empty - it has 0 edge and 0 vertex +RETURN QUERY +SELECT is_empty('q1', 'q1: Graph with 0 edge and 0 vertex'); + +-- boyerMyrvold throws "No edges found" error for empty input +PREPARE zeroEdgeTest2 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id > 18'); + +RETURN QUERY +SELECT throws_ok('zeroEdgeTest2', NULL, '2: Empty graph throws error'); + + +-- vertex not present in graph test + +PREPARE q3 AS +SELECT id, source, target, cost, reverse_cost +FROM edges WHERE source = 50; + +RETURN QUERY +SELECT is_empty('q3','3: Vertex 50 does not exist in sample data'); + +PREPARE vertexNotPresent4 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, target, cost, reverse_cost FROM edges WHERE source = 50'); + +RETURN QUERY +SELECT throws_ok('vertexNotPresent4', NULL, '4: Vertex not present -> throws error'); + + +-- 1 vertex test (self-loop) + +PREPARE q5 AS +SELECT id, source, source AS target, cost, reverse_cost +FROM edges +WHERE id = 9; + +-- Graph with only vertex 9 (self-loop) +RETURN QUERY +SELECT set_eq('q5', $$VALUES (9, 11, 11, 1, 1)$$, 'q5: source<->source'); + +PREPARE oneVertexTest6 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, source AS target, cost, reverse_cost FROM edges WHERE id = 9'); + +-- Self-loop: planar, returns rows in embedding +RETURN QUERY +SELECT isnt_empty('oneVertexTest6', '6: source-source: planar, returns rows'); + + +-- 2 vertices tests + +PREPARE q9 AS +SELECT id, source, target, cost, reverse_cost +FROM edges +WHERE id = 1; + +RETURN QUERY +SELECT set_eq('q9', $$VALUES (1, 5, 6, 1, 1)$$, 'q9: u<->v'); + +PREPARE twoVerticesTest10 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id = 1'); + +RETURN QUERY +SELECT isnt_empty('twoVerticesTest10', '10: simple edge: planar, returns rows'); + + +-- Full sample graph (planar) +PREPARE fullGraphTest11 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, target, cost, reverse_cost FROM edges'); + +RETURN QUERY +SELECT isnt_empty('fullGraphTest11', '11: sample graph is planar, must return rows'); + + +-- Non-planar graph (K5: complete graph on 5 vertices) +-- K5 has nodes 1-5 and all (5 choose 2) = 10 edges +PREPARE k5Test12 AS +SELECT * FROM pgr_boyerMyrvold( +$$SELECT row_number() OVER () AS id, + a AS source, b AS target, + 1.0 AS cost, 1.0 AS reverse_cost + FROM generate_series(1,5) a, generate_series(1,5) b + WHERE a < b$$ +); + +RETURN QUERY +SELECT is_empty('k5Test12', '12: K5 is NOT planar -> 0 rows (no embedding possible)'); + + +-- 4 vertices cyclic (planar) + +PREPARE q13 AS +SELECT id, source, target, cost, reverse_cost +FROM edges +WHERE id IN (8, 10, 11, 12); + +RETURN QUERY +SELECT set_eq('q13', + $$VALUES + (8, 7, 11, 1, 1), + (10, 7, 8, 1, 1), + (11, 11, 12, 1, -1), + (12, 8, 12, 1, -1) + $$, + 'q13: 8<->7<->11->12->8' +); + +PREPARE fourVerticesCyclicTest14 AS +SELECT * +FROM pgr_boyerMyrvold('SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (8, 10, 11, 12)'); + +RETURN QUERY +SELECT isnt_empty('fourVerticesCyclicTest14', '14: cyclic 4-vertex planar graph returns rows'); + + +END; +$BODY$ +LANGUAGE plpgsql; + +SELECT edge_cases(); + +SELECT * FROM finish(); +ROLLBACK; diff --git a/pgtap/planar/boyerMyrvold/inner_query.pg b/pgtap/planar/boyerMyrvold/inner_query.pg new file mode 100644 index 0000000000..395ce23711 --- /dev/null +++ b/pgtap/planar/boyerMyrvold/inner_query.pg @@ -0,0 +1,31 @@ +/* :file: This file is part of the pgRouting project. +:copyright: Copyright (c) 2020-2026 pgRouting developers +:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ + + +BEGIN; + +UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); +SELECT CASE WHEN min_version('3.2.0') THEN plan (54) ELSE plan(1) END; + +CREATE OR REPLACE FUNCTION inner_query() +RETURNS SETOF TEXT AS +$BODY$ +BEGIN + +IF NOT min_version('3.2.0') THEN + RETURN QUERY + SELECT skip(1, 'Function is new on 3.2.0'); + RETURN; +END IF; + +RETURN QUERY SELECT style_dijkstra('pgr_boyermyrvold(', ')'); + +END; +$BODY$ +LANGUAGE plpgsql; + +SELECT inner_query(); + +SELECT finish(); +ROLLBACK; diff --git a/pgtap/planar/boyerMyrvold/no_crash_test.pg b/pgtap/planar/boyerMyrvold/no_crash_test.pg new file mode 100644 index 0000000000..d8c2584de3 --- /dev/null +++ b/pgtap/planar/boyerMyrvold/no_crash_test.pg @@ -0,0 +1,45 @@ +/* :file: This file is part of the pgRouting project. +:copyright: Copyright (c) 2018-2026 pgRouting developers +:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ + + +BEGIN; + +UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); +SELECT CASE WHEN min_version('3.2.0') THEN plan (5) ELSE plan(1) END; + +PREPARE edges AS +SELECT id, source, target, cost, reverse_cost FROM edges; + +CREATE OR REPLACE FUNCTION test_function() +RETURNS SETOF TEXT AS +$BODY$ +DECLARE +params TEXT[]; +subs TEXT[]; +BEGIN + IF NOT min_version('3.2.0') THEN + RETURN QUERY + SELECT skip(1, 'Function is new on 3.2.0'); + RETURN; + END IF; + + RETURN QUERY + SELECT isnt_empty('edges', 'Should not be empty true to tests be meaningful'); + + params = ARRAY['$$SELECT id, source, target, cost, reverse_cost FROM edges$$']::TEXT[]; + subs = ARRAY[ + 'NULL' + ]::TEXT[]; + + RETURN QUERY + SELECT * FROM no_crash_test('pgr_boyermyrvold', params, subs); + +END +$BODY$ +LANGUAGE plpgsql VOLATILE; + + +SELECT * FROM test_function(); +SELECT finish(); +ROLLBACK; diff --git a/pgtap/planar/boyerMyrvold/types_check.pg b/pgtap/planar/boyerMyrvold/types_check.pg new file mode 100644 index 0000000000..9ec4f7dc9d --- /dev/null +++ b/pgtap/planar/boyerMyrvold/types_check.pg @@ -0,0 +1,32 @@ +/* :file: This file is part of the pgRouting project. +:copyright: Copyright (c) 2018-2026 pgRouting developers +:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ + + +BEGIN; + +SELECT CASE WHEN min_version('3.2.0') THEN plan (3) ELSE plan(1) END; + +CREATE OR REPLACE FUNCTION types_check() +RETURNS SETOF TEXT AS +$BODY$ +BEGIN + +IF NOT min_version('3.2.0') THEN + RETURN QUERY + SELECT skip(1, 'Function is new on 3.2.0'); + RETURN; +END IF; + +RETURN QUERY SELECT has_function('pgr_boyermyrvold'); +RETURN QUERY SELECT has_function('pgr_boyermyrvold', ARRAY['text']); +RETURN QUERY SELECT function_returns('pgr_boyermyrvold', ARRAY['text'], 'setof record'); + +END; +$BODY$ +LANGUAGE plpgsql; + +SELECT types_check(); + +SELECT * FROM finish(); +ROLLBACK; diff --git a/sql/planar/CMakeLists.txt b/sql/planar/CMakeLists.txt index 44a7574d29..8685533366 100644 --- a/sql/planar/CMakeLists.txt +++ b/sql/planar/CMakeLists.txt @@ -3,6 +3,8 @@ # License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE set(LOCAL_FILES + _boyerMyrvold.sql + boyerMyrvold.sql _isPlanar.sql isPlanar.sql ) diff --git a/src/planar/CMakeLists.txt b/src/planar/CMakeLists.txt index a7187b065e..5b204599cc 100644 --- a/src/planar/CMakeLists.txt +++ b/src/planar/CMakeLists.txt @@ -2,6 +2,8 @@ # Copyright (c) 2020-2026 pgRouting developers # License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE ADD_LIBRARY(planar OBJECT + boyerMyrvold.c + boyerMyrvold_driver.cpp isPlanar.c isPlanar_driver.cpp ) diff --git a/src/planar/boyerMyrvold.c b/src/planar/boyerMyrvold.c index 2ec2f65044..2a04f9f1e1 100644 --- a/src/planar/boyerMyrvold.c +++ b/src/planar/boyerMyrvold.c @@ -127,8 +127,8 @@ PGDLLEXPORT Datum _pgr_boyermyrvold(PG_FUNCTION_ARGS) { } values[0] = Int32GetDatum((int32_t)funcctx->call_cntr + 1); - values[1] = Int64GetDatum(result_tuples[funcctx->call_cntr].source); - values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].target); + values[1] = Int64GetDatum(result_tuples[funcctx->call_cntr].from_vid); + values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].to_vid); values[3] = Float8GetDatum(result_tuples[funcctx->call_cntr].cost); tuple = heap_form_tuple(tuple_desc, values, nulls); diff --git a/src/planar/boyerMyrvold_driver.cpp b/src/planar/boyerMyrvold_driver.cpp index 624d586f4d..3c7df6e4ef 100644 --- a/src/planar/boyerMyrvold_driver.cpp +++ b/src/planar/boyerMyrvold_driver.cpp @@ -33,13 +33,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include -#include "cpp_common/pgr_alloc.hpp" -#include "cpp_common/pgr_assert.hpp" +#include "cpp_common/alloc.hpp" +#include "cpp_common/assert.hpp" #include "cpp_common/pgdata_getters.hpp" #include "c_types/iid_t_rt.h" -#include "planar/pgr_boyerMyrvold.hpp" -#include "cpp_common/pgr_base_graph.hpp" +#include "planar/boyerMyrvold.hpp" +#include "cpp_common/base_graph.hpp" @@ -71,8 +71,6 @@ pgr_do_boyerMyrvold( std::vector results; std::string logstr; - graphType gType = UNDIRECTED; - hint = edges_sql; auto edges = get_edges(std::string(edges_sql), true, true); @@ -82,7 +80,7 @@ pgr_do_boyerMyrvold( hint = nullptr; log << "Working with Undirected Graph\n"; - pgrouting::UndirectedGraph undigraph(directed); + pgrouting::UndirectedGraph undigraph; undigraph.insert_edges(edges); pgrouting::functions::Pgr_boyerMyrvold fn_boyerMyrvold; results = fn_boyerMyrvold.boyerMyrvold(undigraph); From 9fda6519c00b65a38be4e18ae5bfd0232b7d6a59 Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Tue, 24 Feb 2026 06:28:32 +0000 Subject: [PATCH 2/9] Fix: resolve CI issues - update signature file, restore result file, fix finish() call --- docqueries/planar/boyerMyrvold.result | 102 +++++++-------------- pgtap/planar/boyerMyrvold/no_crash_test.pg | 2 +- sql/sigs/pgrouting--4.1.sig | 2 + 3 files changed, 37 insertions(+), 69 deletions(-) diff --git a/docqueries/planar/boyerMyrvold.result b/docqueries/planar/boyerMyrvold.result index f1c0b9a283..9339252034 100644 --- a/docqueries/planar/boyerMyrvold.result +++ b/docqueries/planar/boyerMyrvold.result @@ -5,100 +5,66 @@ SET /* :file: This file is part of the pgRouting project. :copyright: Copyright (c) 2018-2026 pgRouting developers :license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ -/* -- q1 */ +-- q1 SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edges' + FROM edge_table' ); seq | source | target | cost -----+--------+--------+------ - 1 | 1 | 3 | 1 - 2 | 3 | 7 | 1 - 3 | 6 | 7 | 1 - 4 | 10 | 11 | 1 - 5 | 7 | 11 | 1 - 6 | 8 | 12 | 1 - 7 | 11 | 12 | 1 - 8 | 7 | 8 | 1 - 9 | 2 | 4 | 1 - 10 | 8 | 9 | 1 - 11 | 13 | 14 | 1 - 12 | 12 | 17 | 1 - 13 | 16 | 17 | 1 - 14 | 15 | 16 | 1 - 15 | 11 | 16 | 1 - 16 | 15 | 10 | 1 - 17 | 5 | 6 | 1 - 18 | 10 | 6 | 1 + 1 | 1 | 2 | 1 + 2 | 3 | 2 | 1 + 3 | 4 | 3 | 1 + 4 | 2 | 5 | 1 + 5 | 3 | 6 | 1 + 6 | 7 | 8 | 1 + 7 | 8 | 5 | 1 + 8 | 5 | 6 | 1 + 9 | 6 | 9 | 1 + 10 | 5 | 10 | 1 + 11 | 6 | 11 | 1 + 12 | 10 | 11 | 1 + 13 | 11 | 12 | 1 + 14 | 10 | 13 | 1 + 15 | 9 | 12 | 1 + 16 | 4 | 9 | 1 + 17 | 14 | 15 | 1 + 18 | 16 | 17 | 1 (18 rows) -/* -- q2 */ -INSERT INTO edges (source, target, cost, reverse_cost) VALUES +-- q2 +INSERT INTO edge_table (source, target, cost, reverse_cost) VALUES (1,3,1,-1),(1,4,1,-1),(1,5,1,-1),(2,4,1,-1),(2,5,1,-1),(3,5,1,-1),(4,5,1,-1); INSERT 0 7 -/* -- q3 */ +-- q3 SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edges' + FROM edge_table' ); seq | source | target | cost -----+--------+--------+------ - 1 | 1 | 3 | 1 - 2 | 1 | 4 | 1 - 3 | 1 | 5 | 1 - 4 | 2 | 4 | 1 - 5 | 2 | 5 | 1 - 6 | 3 | 5 | 1 - 7 | 4 | 5 | 1 - 8 | 1 | 3 | 1 - 9 | 3 | 7 | 1 - 10 | 6 | 7 | 1 - 11 | 10 | 11 | 1 - 12 | 7 | 11 | 1 - 13 | 8 | 12 | 1 - 14 | 11 | 12 | 1 - 15 | 7 | 8 | 1 - 16 | 2 | 4 | 1 - 17 | 8 | 9 | 1 - 18 | 13 | 14 | 1 - 19 | 12 | 17 | 1 - 20 | 16 | 17 | 1 - 21 | 15 | 16 | 1 - 22 | 11 | 16 | 1 - 23 | 15 | 10 | 1 - 24 | 5 | 6 | 1 - 25 | 10 | 6 | 1 -(25 rows) +(0 rows) -/* -- q4 */ +-- q4 SELECT * FROM pgr_boyerMyrvold( $$ - SELECT id, source, target, cost, reverse_cost FROM edges + SELECT id, source, target, cost, reverse_cost FROM edge_table where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edges ') + 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') WHERE component = 14) ) OR target = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edges ') + 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') WHERE component = 14) ) $$ ); -ERROR: No edges found -HINT: - SELECT id, source, target, cost, reverse_cost FROM edges - where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edges ') - WHERE component = 14) - ) - OR - target = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edges ') - WHERE component = 14) - ) + seq | source | target | cost +-----+--------+--------+------ + 1 | 14 | 15 | 1 +(1 row) -CONTEXT: SQL function "pgr_boyermyrvold" statement 1 -/* -- q5 */ +-- q5 ROLLBACK; ROLLBACK diff --git a/pgtap/planar/boyerMyrvold/no_crash_test.pg b/pgtap/planar/boyerMyrvold/no_crash_test.pg index d8c2584de3..c35c6b82d8 100644 --- a/pgtap/planar/boyerMyrvold/no_crash_test.pg +++ b/pgtap/planar/boyerMyrvold/no_crash_test.pg @@ -41,5 +41,5 @@ LANGUAGE plpgsql VOLATILE; SELECT * FROM test_function(); -SELECT finish(); +SELECT * FROM finish(); ROLLBACK; diff --git a/sql/sigs/pgrouting--4.1.sig b/sql/sigs/pgrouting--4.1.sig index 2e8a3eb33b..ab05e1fc9b 100644 --- a/sql/sigs/pgrouting--4.1.sig +++ b/sql/sigs/pgrouting--4.1.sig @@ -63,6 +63,8 @@ pgr_binarybreadthfirstsearch(text,text,boolean) _pgr_bipartite(text) pgr_bipartite(text) _pgr_boost_version() +_pgr_boyermyrvold(text) +pgr_boyermyrvold(text) pgr_boykovkolmogorov(text,anyarray,anyarray) pgr_boykovkolmogorov(text,anyarray,bigint) pgr_boykovkolmogorov(text,bigint,anyarray) From 8972614fbbce7435dbb76a522b93316f86126665 Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Tue, 24 Feb 2026 06:37:02 +0000 Subject: [PATCH 3/9] Regenerate boyerMyrvold.result against current sample data --- docqueries/planar/boyerMyrvold.result | 102 +++++++++++++++++--------- 1 file changed, 68 insertions(+), 34 deletions(-) diff --git a/docqueries/planar/boyerMyrvold.result b/docqueries/planar/boyerMyrvold.result index 9339252034..f1c0b9a283 100644 --- a/docqueries/planar/boyerMyrvold.result +++ b/docqueries/planar/boyerMyrvold.result @@ -5,66 +5,100 @@ SET /* :file: This file is part of the pgRouting project. :copyright: Copyright (c) 2018-2026 pgRouting developers :license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 */ --- q1 +/* -- q1 */ SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edge_table' + FROM edges' ); seq | source | target | cost -----+--------+--------+------ - 1 | 1 | 2 | 1 - 2 | 3 | 2 | 1 - 3 | 4 | 3 | 1 - 4 | 2 | 5 | 1 - 5 | 3 | 6 | 1 - 6 | 7 | 8 | 1 - 7 | 8 | 5 | 1 - 8 | 5 | 6 | 1 - 9 | 6 | 9 | 1 - 10 | 5 | 10 | 1 - 11 | 6 | 11 | 1 - 12 | 10 | 11 | 1 - 13 | 11 | 12 | 1 - 14 | 10 | 13 | 1 - 15 | 9 | 12 | 1 - 16 | 4 | 9 | 1 - 17 | 14 | 15 | 1 - 18 | 16 | 17 | 1 + 1 | 1 | 3 | 1 + 2 | 3 | 7 | 1 + 3 | 6 | 7 | 1 + 4 | 10 | 11 | 1 + 5 | 7 | 11 | 1 + 6 | 8 | 12 | 1 + 7 | 11 | 12 | 1 + 8 | 7 | 8 | 1 + 9 | 2 | 4 | 1 + 10 | 8 | 9 | 1 + 11 | 13 | 14 | 1 + 12 | 12 | 17 | 1 + 13 | 16 | 17 | 1 + 14 | 15 | 16 | 1 + 15 | 11 | 16 | 1 + 16 | 15 | 10 | 1 + 17 | 5 | 6 | 1 + 18 | 10 | 6 | 1 (18 rows) --- q2 -INSERT INTO edge_table (source, target, cost, reverse_cost) VALUES +/* -- q2 */ +INSERT INTO edges (source, target, cost, reverse_cost) VALUES (1,3,1,-1),(1,4,1,-1),(1,5,1,-1),(2,4,1,-1),(2,5,1,-1),(3,5,1,-1),(4,5,1,-1); INSERT 0 7 --- q3 +/* -- q3 */ SELECT * FROM pgr_boyerMyrvold( 'SELECT id, source, target, cost, reverse_cost - FROM edge_table' + FROM edges' ); seq | source | target | cost -----+--------+--------+------ -(0 rows) + 1 | 1 | 3 | 1 + 2 | 1 | 4 | 1 + 3 | 1 | 5 | 1 + 4 | 2 | 4 | 1 + 5 | 2 | 5 | 1 + 6 | 3 | 5 | 1 + 7 | 4 | 5 | 1 + 8 | 1 | 3 | 1 + 9 | 3 | 7 | 1 + 10 | 6 | 7 | 1 + 11 | 10 | 11 | 1 + 12 | 7 | 11 | 1 + 13 | 8 | 12 | 1 + 14 | 11 | 12 | 1 + 15 | 7 | 8 | 1 + 16 | 2 | 4 | 1 + 17 | 8 | 9 | 1 + 18 | 13 | 14 | 1 + 19 | 12 | 17 | 1 + 20 | 16 | 17 | 1 + 21 | 15 | 16 | 1 + 22 | 11 | 16 | 1 + 23 | 15 | 10 | 1 + 24 | 5 | 6 | 1 + 25 | 10 | 6 | 1 +(25 rows) --- q4 +/* -- q4 */ SELECT * FROM pgr_boyerMyrvold( $$ - SELECT id, source, target, cost, reverse_cost FROM edge_table + SELECT id, source, target, cost, reverse_cost FROM edges where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') + 'SELECT id, source, target, cost, reverse_cost FROM edges ') WHERE component = 14) ) OR target = any (ARRAY(SELECT node FROM pgr_connectedComponents( - 'SELECT id, source, target, cost, reverse_cost FROM edge_table ') + 'SELECT id, source, target, cost, reverse_cost FROM edges ') WHERE component = 14) ) $$ ); - seq | source | target | cost ------+--------+--------+------ - 1 | 14 | 15 | 1 -(1 row) +ERROR: No edges found +HINT: + SELECT id, source, target, cost, reverse_cost FROM edges + where source = any (ARRAY(SELECT node FROM pgr_connectedComponents( + 'SELECT id, source, target, cost, reverse_cost FROM edges ') + WHERE component = 14) + ) + OR + target = any (ARRAY(SELECT node FROM pgr_connectedComponents( + 'SELECT id, source, target, cost, reverse_cost FROM edges ') + WHERE component = 14) + ) --- q5 +CONTEXT: SQL function "pgr_boyermyrvold" statement 1 +/* -- q5 */ ROLLBACK; ROLLBACK From b0a3da493f388c403dd689eb137fb7417057f869 Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Tue, 24 Feb 2026 06:53:26 +0000 Subject: [PATCH 4/9] Update min_version to 4.1.0 for boyerMyrvold tests --- pgtap/planar/boyerMyrvold/edge_cases.pg | 6 +++--- pgtap/planar/boyerMyrvold/inner_query.pg | 6 +++--- pgtap/planar/boyerMyrvold/no_crash_test.pg | 6 +++--- pgtap/planar/boyerMyrvold/types_check.pg | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pgtap/planar/boyerMyrvold/edge_cases.pg b/pgtap/planar/boyerMyrvold/edge_cases.pg index b07eb66212..6b6b330832 100644 --- a/pgtap/planar/boyerMyrvold/edge_cases.pg +++ b/pgtap/planar/boyerMyrvold/edge_cases.pg @@ -6,16 +6,16 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan (12) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.1.0') THEN plan (12) ELSE plan(1) END; CREATE OR REPLACE FUNCTION edge_cases() RETURNS SETOF TEXT AS $BODY$ BEGIN -IF NOT min_version('3.2.0') THEN +IF NOT min_version('4.1.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.2.0'); + SELECT skip(1, 'Function is new on 4.1.0'); RETURN; END IF; diff --git a/pgtap/planar/boyerMyrvold/inner_query.pg b/pgtap/planar/boyerMyrvold/inner_query.pg index 395ce23711..e6d57518ce 100644 --- a/pgtap/planar/boyerMyrvold/inner_query.pg +++ b/pgtap/planar/boyerMyrvold/inner_query.pg @@ -6,16 +6,16 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan (54) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.1.0') THEN plan (54) ELSE plan(1) END; CREATE OR REPLACE FUNCTION inner_query() RETURNS SETOF TEXT AS $BODY$ BEGIN -IF NOT min_version('3.2.0') THEN +IF NOT min_version('4.1.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.2.0'); + SELECT skip(1, 'Function is new on 4.1.0'); RETURN; END IF; diff --git a/pgtap/planar/boyerMyrvold/no_crash_test.pg b/pgtap/planar/boyerMyrvold/no_crash_test.pg index c35c6b82d8..525eecc095 100644 --- a/pgtap/planar/boyerMyrvold/no_crash_test.pg +++ b/pgtap/planar/boyerMyrvold/no_crash_test.pg @@ -6,7 +6,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan (5) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.1.0') THEN plan (5) ELSE plan(1) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -18,9 +18,9 @@ DECLARE params TEXT[]; subs TEXT[]; BEGIN - IF NOT min_version('3.2.0') THEN + IF NOT min_version('4.1.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.2.0'); + SELECT skip(1, 'Function is new on 4.1.0'); RETURN; END IF; diff --git a/pgtap/planar/boyerMyrvold/types_check.pg b/pgtap/planar/boyerMyrvold/types_check.pg index 9ec4f7dc9d..8289e71fbb 100644 --- a/pgtap/planar/boyerMyrvold/types_check.pg +++ b/pgtap/planar/boyerMyrvold/types_check.pg @@ -5,16 +5,16 @@ BEGIN; -SELECT CASE WHEN min_version('3.2.0') THEN plan (3) ELSE plan(1) END; +SELECT CASE WHEN min_version('4.1.0') THEN plan (3) ELSE plan(1) END; CREATE OR REPLACE FUNCTION types_check() RETURNS SETOF TEXT AS $BODY$ BEGIN -IF NOT min_version('3.2.0') THEN +IF NOT min_version('4.1.0') THEN RETURN QUERY - SELECT skip(1, 'Function is new on 3.2.0'); + SELECT skip(1, 'Function is new on 4.1.0'); RETURN; END IF; From e25f0ccdc93ed81261a845198dec63f7279ce7fd Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Mon, 2 Mar 2026 03:26:47 +0000 Subject: [PATCH 5/9] Add documentation, update SQL version to v4.1, register in experimental --- doc/_static/page_history.js | 2 + doc/planar/CMakeLists.txt | 1 + doc/planar/pgr_boyerMyrvold.rst | 137 ++++++++++++++++++++++++++++++++ doc/src/experimental.rst | 2 + sql/planar/_boyerMyrvold.sql | 2 +- sql/planar/boyerMyrvold.sql | 2 +- 6 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 doc/planar/pgr_boyerMyrvold.rst diff --git a/doc/_static/page_history.js b/doc/_static/page_history.js index f158646394..10e638be10 100644 --- a/doc/_static/page_history.js +++ b/doc/_static/page_history.js @@ -16,6 +16,8 @@ var titles = [ var newpages = [ + {v: '4.1', pages: ['pgr_boyerMyrvold']}, + {v: '4.0', pages: ['pgr_bandwidth', 'pgr_kingOrdering', 'pgr_sloanOrdering']}, {v: '3.8', pages: ['pgr_contractionDeadEnd', 'pgr_contractionLinear', 'pgr_separateCrossing', diff --git a/doc/planar/CMakeLists.txt b/doc/planar/CMakeLists.txt index d9b910d35e..9b1da29452 100644 --- a/doc/planar/CMakeLists.txt +++ b/doc/planar/CMakeLists.txt @@ -3,6 +3,7 @@ # License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE set(LOCAL_FILES + pgr_boyerMyrvold.rst pgr_isPlanar.rst ) diff --git a/doc/planar/pgr_boyerMyrvold.rst b/doc/planar/pgr_boyerMyrvold.rst new file mode 100644 index 0000000000..d4a939030e --- /dev/null +++ b/doc/planar/pgr_boyerMyrvold.rst @@ -0,0 +1,137 @@ +:file: This file is part of the pgRouting project. +:copyright: Copyright (c) 2020-2026 pgRouting developers +:license: Creative Commons Attribution-Share Alike 3.0 https://creativecommons.org/licenses/by-sa/3.0 + +.. index:: + single: Planar Family ; pgr_boyerMyrvold + single: boyerMyrvold - Experimental on v4.1 + +| + +``pgr_boyerMyrvold`` - Experimental +=============================================================================== + +``pgr_boyerMyrvold`` — Returns the planar embedding of a graph, if the graph is +planar. + +.. include:: experimental.rst + :start-after: warning-begin + :end-before: end-warning + +.. rubric:: Availability + +* Version 4.1.0 + + * New experimental function. + + +Description +------------------------------------------------------------------------------- + +A planar embedding of a graph is a mapping of the graph onto a plane such that +no two edges cross. Given a graph, the Boyer-Myrvold planarity testing algorithm +can produce a planar embedding if the graph is planar, or identify a Kuratowski +subgraph (a subdivision of :math:`K_5` or :math:`K_{3,3}`) if it is not. + +This function returns the edges of the planar embedding when the graph is planar. + +The main characteristics are: + +* This implementation uses the Boyer-Myrvold Planarity Testing. +* It will return the edges of the planar embedding when the graph is planar. +* If the graph is not planar, it returns an empty set. +* Applicable only for **undirected** graphs. +* The algorithm does not consider traversal costs in the calculations. +* Running time: :math:`O(|V|)` + +|Boost| Boost Graph Inside + +Signatures +------------------------------------------------------------------------------- + +.. rubric:: Summary + +.. admonition:: \ \ + :class: signatures + + | pgr_boyerMyrvold(`Edges SQL`) + + | RETURNS SETOF |result-edge| + +:Example: Get the planar embedding of the graph + +.. literalinclude:: boyerMyrvold.queries + :start-after: -- q1 + :end-before: -- q2 + +Parameters +------------------------------------------------------------------------------- + +.. include:: pgRouting-concepts.rst + :start-after: only_edge_param_start + :end-before: only_edge_param_end + +Inner Queries +------------------------------------------------------------------------------- + +Edges SQL +............................................................................... + +.. include:: pgRouting-concepts.rst + :start-after: basic_edges_sql_start + :end-before: basic_edges_sql_end + +Result columns +------------------------------------------------------------------------------- + +Returns set of ``(seq, source, target, cost)`` + +============== =========== ========================================== +Column Type Description +============== =========== ========================================== +``seq`` ``BIGINT`` Sequential value starting from :math:`1`. +``source`` ``BIGINT`` Identifier of the source vertex. +``target`` ``BIGINT`` Identifier of the target vertex. +``cost`` ``FLOAT`` Cost of the edge. +============== =========== ========================================== + +Additional Examples +------------------------------------------------------------------------------- + +.. contents:: + :local: + +Making a non planar graph ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +Adding extra edges to create a :math:`K_5` subgraph. + +.. literalinclude:: boyerMyrvold.queries + :start-after: -- q2 + :end-before: -- q3 + +The graph is no longer planar, so the result is empty: + +.. literalinclude:: boyerMyrvold.queries + :start-after: -- q3 + :end-before: -- q4 + +Using with pgr_connectedComponents ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +.. literalinclude:: boyerMyrvold.queries + :start-after: -- q4 + :end-before: -- q5 + +See Also +------------------------------------------------------------------------------- + +* :doc:`pgr_isPlanar` +* :doc:`sampledata` +* `Boost: Boyer Myrvold + `__ + +.. rubric:: Indices and tables + +* :ref:`genindex` +* :ref:`search` diff --git a/doc/src/experimental.rst b/doc/src/experimental.rst index d6ca4f7c09..74354cfe26 100644 --- a/doc/src/experimental.rst +++ b/doc/src/experimental.rst @@ -125,11 +125,13 @@ Experimental Functions .. rubric:: Planar Family +- :doc:`pgr_boyerMyrvold` - :doc:`pgr_isPlanar` .. toctree:: :hidden: + pgr_boyerMyrvold pgr_isPlanar .. rubric:: Miscellaneous Algorithms diff --git a/sql/planar/_boyerMyrvold.sql b/sql/planar/_boyerMyrvold.sql index 21ed70037d..89459aa48c 100644 --- a/sql/planar/_boyerMyrvold.sql +++ b/sql/planar/_boyerMyrvold.sql @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ------------------------- ------------------------- ---v3.2 +--v4.1 CREATE FUNCTION _pgr_boyerMyrvold( TEXT, -- edges_sql (required) diff --git a/sql/planar/boyerMyrvold.sql b/sql/planar/boyerMyrvold.sql index 450fb4d07e..dc76d1c531 100644 --- a/sql/planar/boyerMyrvold.sql +++ b/sql/planar/boyerMyrvold.sql @@ -30,7 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- pgr_boyerMyrvold ------------------ ---v3.2 +--v4.1 CREATE FUNCTION pgr_boyerMyrvold( TEXT, -- edges_sql (required) OUT seq BIGINT, From c15d993fb91a35dc0a96b83f0780bbf06f05e2c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 2 Mar 2026 03:28:01 +0000 Subject: [PATCH 6/9] Update locale: commit 1af6c0232 --- .../en/LC_MESSAGES/pgrouting_doc_strings.po | 96 +++++++++++++++---- locale/pot/pgrouting_doc_strings.pot | 80 +++++++++++++--- 2 files changed, 146 insertions(+), 30 deletions(-) diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 8edb97b173..32a8c8621f 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -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-02 03:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3446,6 +3446,9 @@ msgstr "" msgid "Planar Family" msgstr "" +msgid ":doc:`pgr_boyerMyrvold`" +msgstr "" + msgid ":doc:`pgr_isPlanar`" msgstr "" @@ -3961,11 +3964,6 @@ msgid "" "tree: create and use a process and driver" msgstr "" -msgid "" -"`#3086 `__: MaxFlow: " -"create and use a process and driver" -msgstr "" - msgid "All releases" msgstr "" @@ -8678,6 +8676,81 @@ msgid "" "Bipartite_graph>`__" msgstr "" +msgid "``pgr_boyerMyrvold`` - Experimental" +msgstr "" + +msgid "" +"``pgr_boyerMyrvold`` — Returns the planar embedding of a graph, if the graph " +"is planar." +msgstr "" + +msgid "Version 4.1.0" +msgstr "" + +msgid "" +"A planar embedding of a graph is a mapping of the graph onto a plane such " +"that no two edges cross. Given a graph, the Boyer-Myrvold planarity testing " +"algorithm can produce a planar embedding if the graph is planar, or identify " +"a Kuratowski subgraph (a subdivision of :math:`K_5` or :math:`K_{3,3}`) if " +"it is not." +msgstr "" + +msgid "" +"This function returns the edges of the planar embedding when the graph is " +"planar." +msgstr "" + +msgid "This implementation uses the Boyer-Myrvold Planarity Testing." +msgstr "" + +msgid "" +"It will return the edges of the planar embedding when the graph is planar." +msgstr "" + +msgid "If the graph is not planar, it returns an empty set." +msgstr "" + +msgid "Applicable only for **undirected** graphs." +msgstr "" + +msgid "The algorithm does not consider traversal costs in the calculations." +msgstr "" + +msgid "Running time: :math:`O(|V|)`" +msgstr "" + +msgid "pgr_boyerMyrvold(`Edges SQL`)" +msgstr "" + +msgid "RETURNS SETOF |result-edge|" +msgstr "" + +msgid "Get the planar embedding of the graph" +msgstr "" + +msgid "Returns set of ``(seq, source, target, cost)``" +msgstr "" + +msgid "Identifier of the source vertex." +msgstr "" + +msgid "Identifier of the target vertex." +msgstr "" + +msgid "Cost of the edge." +msgstr "" + +msgid "Adding extra edges to create a :math:`K_5` subgraph." +msgstr "" + +msgid "The graph is no longer planar, so the result is empty:" +msgstr "" + +msgid "" +"`Boost: Boyer Myrvold `__" +msgstr "" + msgid "``pgr_boykovKolmogorov``" msgstr "``pgr_boykovKolmogorov``" @@ -12072,15 +12145,9 @@ msgid "" "It will return a boolean value depending upon the planarity of the graph." msgstr "" -msgid "Applicable only for **undirected** graphs." -msgstr "" - msgid "The algorithm does not considers traversal costs in the calculations." msgstr "" -msgid "Running time: :math:`O(|V|)`" -msgstr "" - msgid "pgr_isPlanar(`Edges SQL`)" msgstr "" @@ -12110,11 +12177,6 @@ msgid "" "blue represent :math:`K_5` subgraph." msgstr "" -msgid "" -"`Boost: Boyer Myrvold `__" -msgstr "" - msgid "``pgr_johnson``" msgstr "``pgr_johnson``" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index e4721ccc0b..64c6804222 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -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-02 03:27+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3121,6 +3121,9 @@ msgstr "" msgid "Planar Family" msgstr "" +msgid ":doc:`pgr_boyerMyrvold`" +msgstr "" + msgid ":doc:`pgr_isPlanar`" msgstr "" @@ -3550,9 +3553,6 @@ msgstr "" msgid "`#3075 `__: Spanning tree: create and use a process and driver" msgstr "" -msgid "`#3086 `__: MaxFlow: create and use a process and driver" -msgstr "" - msgid "All releases" msgstr "" @@ -7528,6 +7528,69 @@ msgstr "" msgid "`Wikipedia: bipartite graph `__" msgstr "" +msgid "``pgr_boyerMyrvold`` - Experimental" +msgstr "" + +msgid "``pgr_boyerMyrvold`` — Returns the planar embedding of a graph, if the graph is planar." +msgstr "" + +msgid "Version 4.1.0" +msgstr "" + +msgid "A planar embedding of a graph is a mapping of the graph onto a plane such that no two edges cross. Given a graph, the Boyer-Myrvold planarity testing algorithm can produce a planar embedding if the graph is planar, or identify a Kuratowski subgraph (a subdivision of :math:`K_5` or :math:`K_{3,3}`) if it is not." +msgstr "" + +msgid "This function returns the edges of the planar embedding when the graph is planar." +msgstr "" + +msgid "This implementation uses the Boyer-Myrvold Planarity Testing." +msgstr "" + +msgid "It will return the edges of the planar embedding when the graph is planar." +msgstr "" + +msgid "If the graph is not planar, it returns an empty set." +msgstr "" + +msgid "Applicable only for **undirected** graphs." +msgstr "" + +msgid "The algorithm does not consider traversal costs in the calculations." +msgstr "" + +msgid "Running time: :math:`O(|V|)`" +msgstr "" + +msgid "pgr_boyerMyrvold(`Edges SQL`)" +msgstr "" + +msgid "RETURNS SETOF |result-edge|" +msgstr "" + +msgid "Get the planar embedding of the graph" +msgstr "" + +msgid "Returns set of ``(seq, source, target, cost)``" +msgstr "" + +msgid "Identifier of the source vertex." +msgstr "" + +msgid "Identifier of the target vertex." +msgstr "" + +msgid "Cost of the edge." +msgstr "" + +msgid "Adding extra edges to create a :math:`K_5` subgraph." +msgstr "" + +msgid "The graph is no longer planar, so the result is empty:" +msgstr "" + +msgid "`Boost: Boyer Myrvold `__" +msgstr "" + msgid "``pgr_boykovKolmogorov``" msgstr "" @@ -10336,15 +10399,9 @@ msgstr "" msgid "It will return a boolean value depending upon the planarity of the graph." msgstr "" -msgid "Applicable only for **undirected** graphs." -msgstr "" - msgid "The algorithm does not considers traversal costs in the calculations." msgstr "" -msgid "Running time: :math:`O(|V|)`" -msgstr "" - msgid "pgr_isPlanar(`Edges SQL`)" msgstr "" @@ -10369,9 +10426,6 @@ msgstr "" msgid "The new graph is not planar because it has a :math:`K_5` subgraph. Edges in blue represent :math:`K_5` subgraph." msgstr "" -msgid "`Boost: Boyer Myrvold `__" -msgstr "" - msgid "``pgr_johnson``" msgstr "" From a47330d5b4dcfd1a4126b09cc21b00aff8ebf56c Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Mon, 2 Mar 2026 03:43:53 +0000 Subject: [PATCH 7/9] Fix: remove version from index entry, deduplicate description text --- doc/planar/pgr_boyerMyrvold.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/planar/pgr_boyerMyrvold.rst b/doc/planar/pgr_boyerMyrvold.rst index d4a939030e..889b205215 100644 --- a/doc/planar/pgr_boyerMyrvold.rst +++ b/doc/planar/pgr_boyerMyrvold.rst @@ -4,7 +4,7 @@ .. index:: single: Planar Family ; pgr_boyerMyrvold - single: boyerMyrvold - Experimental on v4.1 + single: boyerMyrvold | @@ -33,12 +33,10 @@ no two edges cross. Given a graph, the Boyer-Myrvold planarity testing algorithm can produce a planar embedding if the graph is planar, or identify a Kuratowski subgraph (a subdivision of :math:`K_5` or :math:`K_{3,3}`) if it is not. -This function returns the edges of the planar embedding when the graph is planar. - The main characteristics are: * This implementation uses the Boyer-Myrvold Planarity Testing. -* It will return the edges of the planar embedding when the graph is planar. +* Returns the edges of the planar embedding when the graph is planar. * If the graph is not planar, it returns an empty set. * Applicable only for **undirected** graphs. * The algorithm does not consider traversal costs in the calculations. From d3109289c75869bcd81a9e77c5784632d4bceb6c Mon Sep 17 00:00:00 2001 From: Mohit242-bit Date: Tue, 3 Mar 2026 04:40:20 +0000 Subject: [PATCH 8/9] Fix: --- doc/planar/pgr_boyerMyrvold.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/planar/pgr_boyerMyrvold.rst b/doc/planar/pgr_boyerMyrvold.rst index 889b205215..9d697fef40 100644 --- a/doc/planar/pgr_boyerMyrvold.rst +++ b/doc/planar/pgr_boyerMyrvold.rst @@ -100,7 +100,7 @@ Additional Examples :local: Making a non planar graph -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +............................................................................... Adding extra edges to create a :math:`K_5` subgraph. @@ -115,7 +115,7 @@ The graph is no longer planar, so the result is empty: :end-before: -- q4 Using with pgr_connectedComponents -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +............................................................................... .. literalinclude:: boyerMyrvold.queries :start-after: -- q4 From d55f66ab367e8c10cdf656821eefb5daa166cda9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 3 Mar 2026 04:43:47 +0000 Subject: [PATCH 9/9] Update locale: commit d3109289c --- .../en/LC_MESSAGES/pgrouting_doc_strings.po | 22 ++++++++++++------- locale/pot/pgrouting_doc_strings.pot | 16 +++++++++----- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 32a8c8621f..31233589cb 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-02 03:27+0000\n" +"POT-Creation-Date: 2026-03-03 04:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3964,6 +3964,11 @@ msgid "" "tree: create and use a process and driver" msgstr "" +msgid "" +"`#3086 `__: MaxFlow: " +"create and use a process and driver" +msgstr "" + msgid "All releases" msgstr "" @@ -8695,16 +8700,10 @@ msgid "" "it is not." msgstr "" -msgid "" -"This function returns the edges of the planar embedding when the graph is " -"planar." -msgstr "" - msgid "This implementation uses the Boyer-Myrvold Planarity Testing." msgstr "" -msgid "" -"It will return the edges of the planar embedding when the graph is planar." +msgid "Returns the edges of the planar embedding when the graph is planar." msgstr "" msgid "If the graph is not planar, it returns an empty set." @@ -8740,12 +8739,19 @@ msgstr "" msgid "Cost of the edge." msgstr "" +msgid "Making a non planar graph" +msgstr "" + msgid "Adding extra edges to create a :math:`K_5` subgraph." msgstr "" msgid "The graph is no longer planar, so the result is empty:" msgstr "" +#, fuzzy +msgid "Using with pgr_connectedComponents" +msgstr "pgr_connectedComponents" + msgid "" "`Boost: Boyer Myrvold `__" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index 64c6804222..4d9e052449 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-03-02 03:27+0000\n" +"POT-Creation-Date: 2026-03-03 04:43+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3553,6 +3553,9 @@ msgstr "" msgid "`#3075 `__: Spanning tree: create and use a process and driver" msgstr "" +msgid "`#3086 `__: MaxFlow: create and use a process and driver" +msgstr "" + msgid "All releases" msgstr "" @@ -7540,13 +7543,10 @@ msgstr "" msgid "A planar embedding of a graph is a mapping of the graph onto a plane such that no two edges cross. Given a graph, the Boyer-Myrvold planarity testing algorithm can produce a planar embedding if the graph is planar, or identify a Kuratowski subgraph (a subdivision of :math:`K_5` or :math:`K_{3,3}`) if it is not." msgstr "" -msgid "This function returns the edges of the planar embedding when the graph is planar." -msgstr "" - msgid "This implementation uses the Boyer-Myrvold Planarity Testing." msgstr "" -msgid "It will return the edges of the planar embedding when the graph is planar." +msgid "Returns the edges of the planar embedding when the graph is planar." msgstr "" msgid "If the graph is not planar, it returns an empty set." @@ -7582,12 +7582,18 @@ msgstr "" msgid "Cost of the edge." msgstr "" +msgid "Making a non planar graph" +msgstr "" + msgid "Adding extra edges to create a :math:`K_5` subgraph." msgstr "" msgid "The graph is no longer planar, so the result is empty:" msgstr "" +msgid "Using with pgr_connectedComponents" +msgstr "" + msgid "`Boost: Boyer Myrvold `__" msgstr ""