Skip to content

Conversation

@Dajvid
Copy link

@Dajvid Dajvid commented Sep 10, 2025

Graph coloring problem statement created during the ROAR-NET Problem Modelling Code Fest.

Copy link
Collaborator

@mmarchi-github mmarchi-github left a comment

Choose a reason for hiding this comment

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

The problem formulation and the goal of inserting this specific problem statement are not entirely clear to me (please see my comments to the text).

Disclaimer: I am not an expert in combinatorial optimization.


## References

- Garey, M. R., & Johnson, D. S. (1979). _Computers and Intractability: A Guide to the Theory of NP-Completeness_. W. H. Freeman.
Copy link
Collaborator

Choose a reason for hiding this comment

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

These two references are not cited in the description text. Please cite them where suitable.

provide a clear justification when opening the pull request if the problem is
not licensed under CC-BY-4.0 -->

# Graph Coloring (vertex coloring)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This problem statement seems to describe a classic problem of Combinatorial Optimization. What is the added value of this problem here? As a non-expert in the field, I don't understand whether something new is proposed...


- The total number of colors used is minimised:

min( max\_{v ∈ V} c(v) + 1 )
Copy link
Collaborator

Choose a reason for hiding this comment

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

Written like this, the function to assign a color to a new vertex is not entirely clear to me.
The fitness function of the problem is also not entirely clear to me.


### Valid Solution

A solution is **valid** if all adjacency constraints are satisfied, and the number of colors is minimised.
Copy link
Collaborator

Choose a reason for hiding this comment

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

The term valid confuses me. What do you mean with valid? Do you mean "optimal"?
Valid makes me think about something that complies with certain rules or requirement, so it would be close to the concept of "feasible", while in your explanation a valid solution also seems to improve the objective of previous solutions... But this makes me think about moves between two solutions... Could you clarify the concept, please?


### Objective

The goal is to find a **coloring function**:
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the search space of this problem statement? A set of coloring functions?

@belzebuu
Copy link

Problem Statement

The graph coloring is like the traveling salesman a well-known problem. Hence, this problem statement is not novel and the relevance for including it in the ROAR-NET repository is arguable.

The following comments focus on the writing of the problem statement.

I would suggest to call the problem Graph Vertex-Coloring to distinguish it from Graph Edge-Coloring.

min( max_{v ∈ V} c(v) + 1 )

Why the +1?

Valid Solution
A solution is valid if all adjacency constraints are satisfied, and the number of colors is minimised.

This is the definition of an optimal solution not a valid one.

The format assumes one-based or zero-based indexing, depending on the instance.

How do we understand if the instance is zero based or one based?

This uses 3 colors: -Color 0 (e.g. red) for vertices 0 and 2 -Color 1 (e.g. green) for vertices 1 and 4 -Color 2 (e.g. blue) for vertex 3

Some formatting problems

The references are not referred to in the text.

Why are only some instances reported in the repository? I would be careful republishing the instances, the more places they are published the more chances there are that they become corrupted. For example, there are some instances among the DIMACS ones that have some problems (eg, edges listed in two directions).

There is no solution verifier mentioned in the README. The validation.py script is a bit superficial. It does not count how many colors are effectively used. A verifier is already available to the community:
https://github.com/belzebuu/coloring-verifier

A page with instances and best known solutions is available here:
https://sites.google.com/site/graphcoloring/vertex-coloring

Other important resources:
A python library https://gcol.readthedocs.io/en/latest/

An instance space analysis of the instances
https://github.com/GraphVertexColoring/gvc

Implementations in C++ of several ROAs:

Problem Code

  • The contribution lacks of a README file explaining how the code is expected to run and from where.
    mypy . returns errors
  • The objective function is defined as number_of_conflicts * penalty + number of colors. This function has two issues: 1) the penalty is a parameter and there is no indication on which should be the right number 2) the function does not guarantee that the optimal solution (ie, the coloring that uses the least number of colors) is a local optimum. There are more clever implementations in the literature.
  • Only a minimal set of functions from the API are implemented. Some move generators are missing. Also, while the generator for the constructive heuristic is deterministic the one for the local search is stochastic. It would be better to have some consistency.
  • Because of the missing implementation of some methods the code does not pass the automated tests used for the Training Track of the Code Fest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants