-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add Graph Coloring implementation alongside tests #548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a Graph Coloring Problem solver to the algorithms collection, implementing a backtracking algorithm to assign colors to graph vertices such that no two adjacent vertices share the same color.
- Implements
GraphColoringSolverclass with backtracking algorithm for the NP-complete graph coloring problem - Adds comprehensive test suite covering edge cases, various graph types, and validation logic
- Updates README to include the new algorithm in the documentation
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| README.md | Adds Graph Coloring entry to the Problems section with link to implementation |
| Algorithms/Problems/GraphColoring/GraphColoringSolver.cs | New solver implementation with backtracking algorithm, input validation, and comprehensive XML documentation |
| Algorithms.Tests/Problems/GraphColoring/GraphColoringSolverTests.cs | Comprehensive test suite with 20+ test cases covering edge cases, various graph types (complete, bipartite, cycle, path, star), and validation helpers |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #548 +/- ##
==========================================
+ Coverage 96.70% 96.72% +0.01%
==========================================
Files 281 282 +1
Lines 11123 11174 +51
Branches 1590 1601 +11
==========================================
+ Hits 10757 10808 +51
Misses 232 232
Partials 134 134 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
siriak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
Hello, I saw this repository and wanted to add the classic Graph Coloring backtracking problem, its one I have worked on solving myself before. I added the necessary files in the algorithms directory and inside the test directory, while also updating the README. Let me know if there are any problems with my code, I am a novice contributor on GitHub and am always looking to improve! After my changes, the project successfully built and all tests passed.