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: 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
Comment thread
cvvergara marked this conversation as resolved.
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 and 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 and 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 { // NOLINT(cppcoreguidelines-use-enum-class)
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(const 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(const pgrouting::UndirectedGraph&);

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