Refs/heads/coloring using one process and driver#3103
Refs/heads/coloring using one process and driver#3103cvvergara wants to merge 13 commits intopgRouting:developfrom
Conversation
WalkthroughThis PR refactors three coloring algorithms (edge coloring, bipartite, sequential vertex coloring) to share a unified process and driver architecture. Class-based implementations are replaced with free functions, individual algorithm drivers are consolidated into a single dispatch mechanism, and C wrappers are updated to invoke the centralized process. Changes
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
Suggested Labels
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 13
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/update.yml:
- Line 50: The workflow currently sets the GitHub Actions matrix option
fail-fast: true which cancels remaining matrix jobs (including old_pgr entries)
after the first failure; change fail-fast to false (or remove the key) in the
workflow definition so the matrix runs all entries and preserves full signal for
old_pgr jobs—update the fail-fast setting in the job/matrix block where
fail-fast: true is declared.
In `@include/coloring/edgeColoring.hpp`:
- Line 42: The declaration of edgeColoring currently takes
pgrouting::UndirectedGraph by value which causes unnecessary copies; change the
function signature and all matching definitions/overloads to accept a const
reference (const pgrouting::UndirectedGraph& graph) and update any callers to
pass the graph by reference; ensure the header declaration (edgeColoring) and
its implementation use the same const-reference type and rebuild to catch any
mismatched signatures.
In `@include/coloring/sequentialVertexColoring.hpp`:
- Line 40: The declaration of sequentialVertexColoring has inconsistent leading
whitespace; update the function prototype for sequentialVertexColoring(const
pgrouting::UndirectedGraph&) so its indentation matches surrounding declarations
(remove the extra leading spaces before "std::vector<II_t_rt>
sequentialVertexColoring(...)" to align with the file's style).
In `@src/coloring/bipartite.cpp`:
- Line 78: Change the pgr_bipartite function signature to take the graph by
const reference since it is not modified: update the implementation signature
std::vector<II_t_rt> pgr_bipartite(const pgrouting::UndirectedGraph& graph) and
also update the corresponding declaration for pgr_bipartite in the header to
match; ensure any callers still compile (they should) and adjust any non-const
contexts if necessary.
- Around line 58-60: The thrown error message incorrectly references
"boost::edge_coloring" even though this is the bipartite implementation; update
the string passed in the throw (the std::make_pair in bipartite.cpp) to
reference the bipartite implementation (e.g., "INTERNAL: something went wrong
while calling bipartite edge coloring" or similar) so the error accurately names
the failing component while leaving the second element (__PGR_PRETTY_FUNCTION__)
unchanged.
- Around line 78-80: The code currently calls boost::is_bipartite twice (once in
pgr_bipartite and again inside get_bipartition), causing redundant graph
traversal; modify pgr_bipartite and get_bipartition so the bipartiteness result
is computed once and reused—either by changing get_bipartition to accept a
precomputed bool (e.g., add a parameter like bool is_bipartite) or by moving the
partition extraction logic into pgr_bipartite and passing the graph and the
single is_bipartite result to the partition routine; ensure you remove the
internal boost::is_bipartite call from get_bipartition and use the passed flag
to decide whether to return an empty vector or the partition.
In `@src/coloring/coloring_driver.cpp`:
- Around line 103-105: The default error branch concatenates the message and
function name without a separator; update the default case so the err stream
includes a separator before calling get_name(which) (e.g., add a space or ": ")
so the output becomes "Unknown coloring function: EDGECOLORING" when locating
the code around the default branch that writes to err and calls get_name(which).
In `@src/coloring/coloring_process.cpp`:
- Around line 55-56: The using-declaration imports pgr_free but the code calls
pfree directly (see symbols pgr_free and pfree); remove the unused
using-declaration for pgr_free from the top of coloring_process.cpp (keep
to_pg_msg if still used) so there is no dead import, or alternatively replace
calls to pfree with pgr_free if pgr_free is the intended wrapper—ensure
consistency by choosing one symbol (pgr_free or pfree) and updating the using
list and call sites accordingly.
- Around line 57-68: The code asserts edges_sql is non-null via
pgassert(edges_sql) but then uses a defensive ternary edges_sql ? edges_sql : ""
when calling pgrouting::drivers::do_coloring; remove the redundant ternary and
pass edges_sql directly to do_coloring (or conversely remove the pgassert and
keep the ternary if you prefer null-safe behavior) so the checks are
consistent—update the call site in the do_coloring invocation to use edges_sql
and ensure only one null-handling strategy is present.
In `@src/coloring/edgeColoring.c`:
- Around line 3-5: Remove the duplicated header comment "Generated with Template
by:" in src/coloring/edgeColoring.c so it appears only once; edit the
top-of-file comment block (the header around the existing "Generated with
Template by:" lines) to eliminate the redundant line and preserve any
surrounding header text or metadata.
In `@src/coloring/edgeColoring.cpp`:
- Around line 80-85: Fix the comment typo in edgeColoring.cpp: change
"outsatnding" to "outstanding" in the block above the assignment that sets
results[i].d2.value (the comment that references boost and color_map/get). Leave
the code statement (results[i].d2.value = ...) unchanged.
- Around line 48-49: The edgeColoring function currently takes the graph
parameter by value (edgeColoring(pgrouting::UndirectedGraph g)), causing an
unnecessary copy; change the signature to accept a const reference
(edgeColoring(const pgrouting::UndirectedGraph& g)) and update any callers if
needed, ensuring you only read from g inside edgeColoring (or explicitly copy
where mutation is required) and keep references to member functions or iterators
compatible with a const graph.
In `@src/coloring/sequentialVertexColoring.cpp`:
- Around line 104-114: The catch-all handler after calling
boost::sequential_vertex_coloring incorrectly mentions "boost::edge_coloring" in
the thrown error; update the error message text in the throw inside the
catch(...) to reference "boost::sequential_vertex_coloring" (and ensure the
thrown pair still contains the descriptive message plus
__PGR_PRETTY_FUNCTION__), and remove any stray punctuation (extra semicolon) if
present so the exception text correctly identifies the failing function.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ef849f12-4b0b-4875-8445-cc31c475d5e9
📒 Files selected for processing (28)
.github/workflows/update.ymlNEWS.mddoc/coloring/pgr_edgeColoring.rstdoc/src/release_notes.rstdocqueries/coloring/edgeColoring.resultinclude/c_common/enums.hinclude/coloring/bipartite.hppinclude/coloring/bipartite_driver.hppinclude/coloring/edgeColoring.hppinclude/coloring/sequentialVertexColoring.hppinclude/drivers/coloring_driver.hppinclude/process/coloring_process.hlocale/en/LC_MESSAGES/pgrouting_doc_strings.polocale/pot/pgrouting_doc_strings.potpgtap/coloring/edgeColoring/edge_cases.pgsrc/coloring/CMakeLists.txtsrc/coloring/bipartite.csrc/coloring/bipartite.cppsrc/coloring/bipartite_driver.cppsrc/coloring/coloring_driver.cppsrc/coloring/coloring_process.cppsrc/coloring/edgeColoring.csrc/coloring/edgeColoring.cppsrc/coloring/edgeColoring_driver.cppsrc/coloring/sequentialVertexColoring.csrc/coloring/sequentialVertexColoring.cppsrc/coloring/sequentialVertexColoring_driver.cpptools/scripts/code_checker.sh
💤 Files with no reviewable changes (4)
- src/coloring/sequentialVertexColoring_driver.cpp
- src/coloring/bipartite_driver.cpp
- src/coloring/edgeColoring_driver.cpp
- include/coloring/bipartite_driver.hpp
|
|
||
| strategy: | ||
| fail-fast: false | ||
| fail-fast: true |
There was a problem hiding this comment.
Preserve full matrix signal by disabling fail-fast (Line 50).
fail-fast: true will cancel remaining old_pgr matrix entries after the first failure, which hides additional upgrade failures and weakens this workflow’s compatibility coverage.
Suggested change
- fail-fast: true
+ fail-fast: false📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| fail-fast: true | |
| fail-fast: false |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/update.yml at line 50, The workflow currently sets the
GitHub Actions matrix option fail-fast: true which cancels remaining matrix jobs
(including old_pgr entries) after the first failure; change fail-fast to false
(or remove the key) in the workflow definition so the matrix runs all entries
and preserves full signal for old_pgr jobs—update the fail-fast setting in the
job/matrix block where fail-fast: true is declared.
| int64_t get_vertex_id(V v) const; | ||
| int64_t get_edge_id(E e) const; | ||
|
|
||
| std::vector<II_t_rt> edgeColoring(pgrouting::UndirectedGraph); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Check the edgeColoring implementation to see if the graph is modified
rg -n -A 30 'edgeColoring\s*\(' src/coloring/edgeColoring.cpp | head -50Repository: pgRouting/pgrouting
Length of output: 1278
Consider passing UndirectedGraph by const-reference instead of by value.
The implementation reads from the graph but does not modify it. Passing by const& avoids unnecessary copying for large graphs:
Suggested change
-std::vector<II_t_rt> edgeColoring(pgrouting::UndirectedGraph);
+std::vector<II_t_rt> edgeColoring(const pgrouting::UndirectedGraph&);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| std::vector<II_t_rt> edgeColoring(pgrouting::UndirectedGraph); | |
| std::vector<II_t_rt> edgeColoring(const pgrouting::UndirectedGraph&); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@include/coloring/edgeColoring.hpp` at line 42, The declaration of
edgeColoring currently takes pgrouting::UndirectedGraph by value which causes
unnecessary copies; change the function signature and all matching
definitions/overloads to accept a const reference (const
pgrouting::UndirectedGraph& graph) and update any callers to pass the graph by
reference; ensure the header declaration (edgeColoring) and its implementation
use the same const-reference type and rebuild to catch any mismatched
signatures.
| [](const II_t_rt row1, const II_t_rt row2) { | ||
| return row1.d1.id < row2.d1.id; | ||
| }); | ||
| std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph&); |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Minor: Inconsistent indentation.
The function declaration has extra leading whitespace compared to typical style.
♻️ Suggested fix
- std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph&);
+std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph&);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph&); | |
| std::vector<II_t_rt> sequentialVertexColoring(const pgrouting::UndirectedGraph&); |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@include/coloring/sequentialVertexColoring.hpp` at line 40, The declaration of
sequentialVertexColoring has inconsistent leading whitespace; update the
function prototype for sequentialVertexColoring(const
pgrouting::UndirectedGraph&) so its indentation matches surrounding declarations
(remove the extra leading spaces before "std::vector<II_t_rt>
sequentialVertexColoring(...)" to align with the file's style).
| throw std::make_pair( | ||
| std::string("INTERNAL: something went wrong while calling boost::edge_coloring"), | ||
| std::string(__PGR_PRETTY_FUNCTION__));; |
There was a problem hiding this comment.
Incorrect error message references wrong algorithm.
The catch block mentions "boost::edge_coloring" but this is the bipartite implementation.
✏️ Suggested fix
throw std::make_pair(
- std::string("INTERNAL: something went wrong while calling boost::edge_coloring"),
+ std::string("INTERNAL: something went wrong while calling boost::is_bipartite"),
std::string(__PGR_PRETTY_FUNCTION__));;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/bipartite.cpp` around lines 58 - 60, The thrown error message
incorrectly references "boost::edge_coloring" even though this is the bipartite
implementation; update the string passed in the throw (the std::make_pair in
bipartite.cpp) to reference the bipartite implementation (e.g., "INTERNAL:
something went wrong while calling bipartite edge coloring" or similar) so the
error accurately names the failing component while leaving the second element
(__PGR_PRETTY_FUNCTION__) unchanged.
| namespace pgrouting { | ||
| namespace functions { | ||
|
|
||
| std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph &graph ) { |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Parameter could be const reference.
The graph parameter is not modified; consider passing by const reference for clarity.
♻️ Suggested fix
-std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph &graph ) {
+std::vector<II_t_rt> pgr_bipartite(const pgrouting::UndirectedGraph &graph) {Note: This requires updating the header declaration in include/coloring/bipartite.hpp to match.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph &graph ) { | |
| std::vector<II_t_rt> pgr_bipartite(const pgrouting::UndirectedGraph &graph) { |
🧰 Tools
🪛 Cppcheck (2.20.0)
[style] 78-78: The function 'pgr_bipartite' is never used.
(unusedFunction)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/bipartite.cpp` at line 78, Change the pgr_bipartite function
signature to take the graph by const reference since it is not modified: update
the implementation signature std::vector<II_t_rt> pgr_bipartite(const
pgrouting::UndirectedGraph& graph) and also update the corresponding declaration
for pgr_bipartite in the header to match; ensure any callers still compile (they
should) and adjust any non-const contexts if necessary.
| pgassert(edges_sql); | ||
| pgassert(!(*result_tuples)); | ||
| pgassert(*result_count == 0); | ||
| pgr_SPI_connect(); | ||
|
|
||
| std::ostringstream log; | ||
| std::ostringstream err; | ||
| std::ostringstream notice; | ||
|
|
||
| clock_t start_t = clock(); | ||
| pgrouting::drivers::do_coloring( | ||
| edges_sql? edges_sql : "", |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Minor inconsistency: assertion vs defensive null check.
Line 57 asserts edges_sql is non-null, but line 68 defensively handles null with edges_sql? edges_sql : "". The assertion makes the ternary unreachable in debug builds. Consider either:
- Removing the assertion if null should be gracefully handled, or
- Removing the ternary if null is truly a programming error
♻️ Option A: Trust the assertion (remove ternary)
pgrouting::drivers::do_coloring(
- edges_sql? edges_sql : "",
+ edges_sql,♻️ Option B: Allow null (remove assertion)
- pgassert(edges_sql);🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/coloring_process.cpp` around lines 57 - 68, The code asserts
edges_sql is non-null via pgassert(edges_sql) but then uses a defensive ternary
edges_sql ? edges_sql : "" when calling pgrouting::drivers::do_coloring; remove
the redundant ternary and pass edges_sql directly to do_coloring (or conversely
remove the pgassert and keep the ternary if you prefer null-safe behavior) so
the checks are consistent—update the call site in the do_coloring invocation to
use edges_sql and ensure only one null-handling strategy is present.
| Generated with Template by: | ||
|
|
||
| Generated with Template by: |
There was a problem hiding this comment.
Minor: Duplicate comment line.
"Generated with Template by:" appears twice in the header (lines 3 and 5).
✏️ Suggested fix
/*PGR-GNU*****************************************************************
File: edgeColoring.c
-Generated with Template by:
Generated with Template by:
Copyright (c) 2015-2026 pgRouting developers📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Generated with Template by: | |
| Generated with Template by: | |
| /*PGR-GNU***************************************************************** | |
| File: edgeColoring.c | |
| Generated with Template by: | |
| Copyright (c) 2015-2026 pgRouting developers |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/edgeColoring.c` around lines 3 - 5, Remove the duplicated header
comment "Generated with Template by:" in src/coloring/edgeColoring.c so it
appears only once; edit the top-of-file comment block (the header around the
existing "Generated with Template by:" lines) to eliminate the redundant line
and preserve any surrounding header text or metadata.
| std::vector<II_t_rt> | ||
| Pgr_edgeColoring::edgeColoring() { | ||
| std::vector<II_t_rt> results; | ||
|
|
||
| CHECK_FOR_INTERRUPTS(); | ||
|
|
||
| try { | ||
| boost::edge_coloring(graph, boost::get(boost::edge_bundle, graph)); | ||
| } catch (...) { | ||
| throw std::make_pair( | ||
| std::string("INTERNAL: something went wrong while calling boost::edge_coloring"), | ||
| std::string(__PGR_PRETTY_FUNCTION__)); | ||
| } | ||
|
|
||
| for (auto e_i : boost::make_iterator_range(boost::edges(graph))) { | ||
| auto edge = get_edge_id(e_i); | ||
| int64_t color = graph[e_i]; | ||
| results.push_back({{edge}, {(color + 1)}}); | ||
| } | ||
| return results; | ||
| } | ||
|
|
||
| Pgr_edgeColoring::Pgr_edgeColoring(const std::vector<Edge_t> &edges) { | ||
| /* | ||
| * Inserting vertices | ||
| */ | ||
| Identifiers<int64_t> ids; | ||
| for (const auto &e : edges) { | ||
| ids += e.source; | ||
| ids += e.target; | ||
| } | ||
|
|
||
| for (const auto id : ids) { | ||
| auto v = add_vertex(graph); | ||
| id_to_V.insert(std::make_pair(id, v)); | ||
| V_to_id.insert(std::make_pair(v, id)); | ||
| } | ||
| edgeColoring(pgrouting::UndirectedGraph g) { |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Consider passing graph by const reference.
The graph parameter is taken by value but appears to only be read, not modified. Passing by const reference avoids an unnecessary copy.
Proposed fix
std::vector<II_t_rt>
-edgeColoring(pgrouting::UndirectedGraph g) {
+edgeColoring(const pgrouting::UndirectedGraph &g) {Note: If value semantics are intentional for some reason not visible in this context, please disregard.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| std::vector<II_t_rt> | |
| Pgr_edgeColoring::edgeColoring() { | |
| std::vector<II_t_rt> results; | |
| CHECK_FOR_INTERRUPTS(); | |
| try { | |
| boost::edge_coloring(graph, boost::get(boost::edge_bundle, graph)); | |
| } catch (...) { | |
| throw std::make_pair( | |
| std::string("INTERNAL: something went wrong while calling boost::edge_coloring"), | |
| std::string(__PGR_PRETTY_FUNCTION__)); | |
| } | |
| for (auto e_i : boost::make_iterator_range(boost::edges(graph))) { | |
| auto edge = get_edge_id(e_i); | |
| int64_t color = graph[e_i]; | |
| results.push_back({{edge}, {(color + 1)}}); | |
| } | |
| return results; | |
| } | |
| Pgr_edgeColoring::Pgr_edgeColoring(const std::vector<Edge_t> &edges) { | |
| /* | |
| * Inserting vertices | |
| */ | |
| Identifiers<int64_t> ids; | |
| for (const auto &e : edges) { | |
| ids += e.source; | |
| ids += e.target; | |
| } | |
| for (const auto id : ids) { | |
| auto v = add_vertex(graph); | |
| id_to_V.insert(std::make_pair(id, v)); | |
| V_to_id.insert(std::make_pair(v, id)); | |
| } | |
| edgeColoring(pgrouting::UndirectedGraph g) { | |
| std::vector<II_t_rt> | |
| edgeColoring(const pgrouting::UndirectedGraph &g) { |
🧰 Tools
🪛 Cppcheck (2.20.0)
[style] 49-49: The function 'edgeColoring' is never used.
(unusedFunction)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/edgeColoring.cpp` around lines 48 - 49, The edgeColoring
function currently takes the graph parameter by value
(edgeColoring(pgrouting::UndirectedGraph g)), causing an unnecessary copy;
change the signature to accept a const reference (edgeColoring(const
pgrouting::UndirectedGraph& g)) and update any callers if needed, ensuring you
only read from g inside edgeColoring (or explicitly copy where mutation is
required) and keep references to member functions or iterators compatible with a
const graph.
| /** | ||
| * There is a problem with boost: | ||
| * Sometimes it returns a color with outsatnding large value | ||
| * When that happens changing color to: colors + 1 | ||
| */ | ||
| results[i].d2.value = get(color_map, *ei) < colors? get(color_map, *ei) + 1 : colors + 1; |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial
Typo in comment.
"outsatnding" should be "outstanding".
Proposed fix
/**
* There is a problem with boost:
- * Sometimes it returns a color with outsatnding large value
+ * Sometimes it returns a color with outstanding large value
* When that happens changing color to: colors + 1
*/📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /** | |
| * There is a problem with boost: | |
| * Sometimes it returns a color with outsatnding large value | |
| * When that happens changing color to: colors + 1 | |
| */ | |
| results[i].d2.value = get(color_map, *ei) < colors? get(color_map, *ei) + 1 : colors + 1; | |
| /** | |
| * There is a problem with boost: | |
| * Sometimes it returns a color with outstanding large value | |
| * When that happens changing color to: colors + 1 | |
| */ | |
| results[i].d2.value = get(color_map, *ei) < colors? get(color_map, *ei) + 1 : colors + 1; |
🧰 Tools
🪛 Cppcheck (2.20.0)
[performance] 81-81: Function parameter 'data_edges' should be passed by const reference.
(passedByValue)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/edgeColoring.cpp` around lines 80 - 85, Fix the comment typo in
edgeColoring.cpp: change "outsatnding" to "outstanding" in the block above the
assignment that sets results[i].d2.value (the comment that references boost and
color_map/get). Leave the code statement (results[i].d2.value = ...) unchanged.
| try { | ||
| boost::sequential_vertex_coloring(graph.graph, color_map); | ||
| } catch (boost::exception const& ex) { | ||
| throw; | ||
| } catch (std::exception &e) { | ||
| throw; | ||
| } catch (...) { | ||
| throw std::make_pair( | ||
| std::string("INTERNAL: something went wrong while calling boost::edge_coloring"), | ||
| std::string(__PGR_PRETTY_FUNCTION__));; | ||
| } |
There was a problem hiding this comment.
Incorrect algorithm name in error message.
The error message references boost::edge_coloring but this function calls boost::sequential_vertex_coloring.
Proposed fix
} catch (...) {
throw std::make_pair(
- std::string("INTERNAL: something went wrong while calling boost::edge_coloring"),
+ std::string("INTERNAL: something went wrong while calling boost::sequential_vertex_coloring"),
std::string(__PGR_PRETTY_FUNCTION__));;
}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/coloring/sequentialVertexColoring.cpp` around lines 104 - 114, The
catch-all handler after calling boost::sequential_vertex_coloring incorrectly
mentions "boost::edge_coloring" in the thrown error; update the error message
text in the throw inside the catch(...) to reference
"boost::sequential_vertex_coloring" (and ensure the thrown pair still contains
the descriptive message plus __PGR_PRETTY_FUNCTION__), and remove any stray
punctuation (extra semicolon) if present so the exception text correctly
identifies the failing function.
Fixes #3100 #3101
Changes proposed in this pull request:
@pgRouting/admins
Summary by CodeRabbit
Release Notes
Bug Fixes
Documentation