C-Plus-Plus
C-Plus-Plus copied to clipboard
Feature Request: Implement Graph Colouring Algorithm
Detailed description
I would like to request the implementation of a Graph Colouring Algorithm as a feature in this repository. Graph colouring is a way of assigning labels (often referred to as "colours") to the vertices of a graph such that no two adjacent vertices share the same label.
Context
This algorithm has multiple applications, including:
- Scheduling Problems: Assigning timeslots to tasks without conflicts.
- Map Coloring: Ensuring that no two adjacent regions share the same color.
- Register Allocation in Compilers: Minimizing the use of registers in code generation.
Possible implementation
Implementation of a Greedy Graph colouring Algorithm as a baseline. This algorithm assigns the smallest possible colour to each vertex while ensuring that no two adjacent vertices share the same colour. Additionally, an implementation of Backtracking can be provided to find more optimal solutions for graphs that require a minimal number of colours.
Additional information
(https://en.wikipedia.org/wiki/Graph_coloring)