C-Plus-Plus icon indicating copy to clipboard operation
C-Plus-Plus copied to clipboard

Feature Request: Implement Graph Colouring Algorithm

Open THIRU-1074 opened this issue 1 year ago • 2 comments

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)

THIRU-1074 avatar Oct 08 '24 13:10 THIRU-1074

Implementation of graph colouring using backtracking exists here. I guess other colouring algorithms can be added.

ritk20 avatar Oct 09 '24 15:10 ritk20

Yes , DSatur is good to be implemented, this algorithm has better performance compared to existing one in repo.

THIRU-1074 avatar Oct 10 '24 02:10 THIRU-1074

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Nov 10 '24 00:11 github-actions[bot]

Please ping one of the maintainers once you add more information and updates here. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

github-actions[bot] avatar Dec 10 '24 00:12 github-actions[bot]