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: 1 addition & 1 deletion .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
fail-fast: true
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 | 🟠 Major

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.

Suggested change
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.

matrix:
boost_minor: [56]
old_pgr: [4.0.1, 4.0.0, 3.8.0, 3.7.3, 3.7.2, 3.7.1, 3.7.0, 3.6.3, 3.6.2, 3.6.1, 3.6.0, 3.5.1, 3.5.0, 3.4.2, 3.4.1, 3.4.0, 3.3.5, 3.3.4, 3.3.3, 3.3.2, 3.3.1, 3.3.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.6, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.2.0, 3.2.1, 3.2.2]
Expand Down
12 changes: 12 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ To see all issues & pull requests closed by this release see the
* [#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
* [#3100](https://github.com/pgRouting/pgrouting/issues/3100): Coloring: create an use a process & driver

**Bug Fixes**

* [#3101](https://github.com/pgRouting/pgrouting/issues/3101): pgr_edgeColoring not building graph correctly


**Summary of changes by function**

* pgr_edgeColoring

* Fix the way it builds the graph

## pgRouting 4.0

Expand Down
4 changes: 4 additions & 0 deletions doc/coloring/pgr_edgeColoring.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ graphs

.. rubric:: Availability

.. rubric:: Version 4.1.0

* Fix the way it builds the graph

.. rubric:: Version 4.0.0

* Output columns standardized to |result_edge_color|
Expand Down
14 changes: 14 additions & 0 deletions doc/src/release_notes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@ To see all issues & pull requests closed by this release see the
* :issue:`3086`: MaxFlow: create and use a process and driver
* :issue:`3089`: edgeDisjoint and bellmanFord use shortestPath driver and
process
* :issue:`3100`: Coloring: create an use a process & driver

.. rubric:: Bug Fixes

* :issue:`3101`: pgr_edgeColoring not building graph correctly


.. rubric:: Summary of changes by function

* pgr_edgeColoring

.. include:: pgr_edgeColoring.rst
:start-after: Version 4.1.0
:end-before: .. rubric

pgRouting 4.0
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down
2 changes: 1 addition & 1 deletion docqueries/coloring/edgeColoring.result
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SELECT edge, color FROM pgr_edgeColoring(
);
edge | color
------+-------
1 | 3
1 | 1
2 | 2
3 | 3
4 | 4
Expand Down
5 changes: 4 additions & 1 deletion include/c_common/enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ enum Which {
DFS = 520,
BFS = 530,
DIJKSTRADD = 540,
MAXFLOW, PUSHRELABEL, BOYKOV, EDMONDSKARP
/* For flow */
MAXFLOW, PUSHRELABEL, BOYKOV, EDMONDSKARP,
/* For coloring */
EDGECOLORING, BIPARTITE, SEQUENTIAL
};

#endif // INCLUDE_C_COMMON_ENUMS_H_
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/*PGR-GNU*****************************************************************
File: bipartite_driver.h
File: bipartite.hpp

Generated with Template by:
Copyright (c) 2013-2026 pgRouting developers
Copyright (c) 2021-2026 pgRouting developers
Mail: project@pgrouting.org

Function's developer:
Expand All @@ -27,33 +27,22 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

********************************************************************PGR-GNU*/

#ifndef INCLUDE_DRIVERS_COLORING_BIPARTITE_DRIVER_H_
#define INCLUDE_DRIVERS_COLORING_BIPARTITE_DRIVER_H_

#ifndef INCLUDE_COLORING_BIPARTITE_HPP_
#define INCLUDE_COLORING_BIPARTITE_HPP_
#pragma once

/* for size-t */
#ifdef __cplusplus
# include <cstddef>
using II_t_rt = struct II_t_rt;
#else
# include <stddef.h>
typedef struct II_t_rt II_t_rt;
#endif
#include <vector>

#include "c_types/ii_t_rt.h"
#include "cpp_common/base_graph.hpp"

#ifdef __cplusplus
extern "C" {
#endif
namespace pgrouting {
namespace functions {

void
pgr_do_bipartite(
const char*,
std::vector<II_t_rt> pgr_bipartite(pgrouting::UndirectedGraph&);

II_t_rt**, size_t*,
char**, char**, char**);
} // namespace functions
} // namespace pgrouting

#ifdef __cplusplus
}
#endif

#endif // INCLUDE_DRIVERS_COLORING_BIPARTITE_DRIVER_H_
#endif // INCLUDE_COLORING_BIPARTITE_HPP_
97 changes: 0 additions & 97 deletions include/coloring/bipartite_driver.hpp

This file was deleted.

43 changes: 2 additions & 41 deletions include/coloring/edgeColoring.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,56 +30,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#define INCLUDE_COLORING_EDGECOLORING_HPP_
#pragma once

#include <iostream>
#include <map>
#include <vector>
#include <cstdint>

#include <boost/config.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/version.hpp>

#include "cpp_common/edge_t.hpp"
#include "c_types/ii_t_rt.h"
#include "cpp_common/assert.hpp"
#include "cpp_common/messages.hpp"
#include "cpp_common/base_graph.hpp"

namespace pgrouting {
namespace functions {

class Pgr_edgeColoring : public Pgr_messages {
public:
using EdgeColoring_Graph =
boost::adjacency_list<boost::vecS, boost::vecS, boost::undirectedS, boost::no_property,
int64_t, boost::no_property>;

using V = boost::graph_traits<EdgeColoring_Graph>::vertex_descriptor;
using E = boost::graph_traits<EdgeColoring_Graph>::edge_descriptor;
using V_it = boost::graph_traits<EdgeColoring_Graph>::vertex_iterator;
using E_it = boost::graph_traits<EdgeColoring_Graph>::edge_iterator;

public:
std::vector<II_t_rt> edgeColoring();

explicit Pgr_edgeColoring(const std::vector<Edge_t>&);
Pgr_edgeColoring() = delete;

#if BOOST_VERSION >= 106800
friend std::ostream& operator<<(std::ostream &, const Pgr_edgeColoring&);
#endif

private:
V get_boost_vertex(int64_t id) const;
int64_t get_vertex_id(V v) const;
int64_t get_edge_id(E e) const;

std::vector<II_t_rt> edgeColoring(pgrouting::UndirectedGraph);
Copy link
Contributor

Choose a reason for hiding this comment

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

🧹 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 -50

Repository: 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.

Suggested change
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.


private:
EdgeColoring_Graph graph;
std::map<int64_t, V> id_to_V;
std::map<V, int64_t> V_to_id;
std::map<E, int64_t> E_to_id;
};

} // namespace functions
} // namespace pgrouting
Expand Down
Loading