This pull request adds support for the k-color problem, a combinatorial optimization problem related to graph coloring. The k-color problem involves assigning colors to the vertices of a graph such that no two adjacent vertices have the same color while minimizing the number of colors used.
The implementation includes a new class KColor in the existing problem module. The KColor class allows the creation of instances of the k-color problem and provides methods for solving the problem using the Docplex solver, visualizing the graph with a given solution, and obtaining the qubo.
Adding the k-color class with its corresponding test. https://en.wikipedia.org/wiki/Graph_coloring
Description
This pull request adds support for the k-color problem, a combinatorial optimization problem related to graph coloring. The k-color problem involves assigning colors to the vertices of a graph such that no two adjacent vertices have the same color while minimizing the number of colors used.
The implementation includes a new class
KColor
in the existing problem module. TheKColor
class allows the creation of instances of the k-color problem and provides methods for solving the problem using the Docplex solver, visualizing the graph with a given solution, and obtaining the qubo.Example:
Checklist
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
the test is inside './tests/test_problems.py'