Skip to content
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

Welsh powell coloring #391

Merged
merged 7 commits into from
Jan 23, 2024
Merged

Conversation

badumbatish
Copy link
Contributor

Hi there, I'm creating a pull request to merge the Welsh Powell Coloring algorithm into the master branch.

The algorithm returns a std::map<Node, int> result that assigns each node to a color order (assigned by integers).

Users can also query the minimum chromatic order of the graph by querying the highest value from the resulting map

auto result = graph.welshPowellColoring();
auto chromatic_color = std::max_element(result.begin(), result.end(),
                                     [](const auto& lhs, const auto& rhs) {
                                       return lhs.second < rhs.second;
                                     }

The minimum coloring starts from 1 instead of 0.

The algorithm assumes the graph to be undirected. All sources and inspirations are linked in the declaration of the algorithm and test cases.

@ghost
Copy link

ghost commented Jan 20, 2024

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@ZigRazor
Copy link
Owner

Hi @badumbatish , please resolve conflict so we have the possibility to merge it!

@badumbatish
Copy link
Contributor Author

Hi there, I forgot to sync my fork with the origin repository. Things should be fixed now @ZigRazor

Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (87bee02) 97.55% compared to head (206bc51) 97.58%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #391      +/-   ##
==========================================
+ Coverage   97.55%   97.58%   +0.03%     
==========================================
  Files          85       87       +2     
  Lines        9367     9494     +127     
==========================================
+ Hits         9138     9265     +127     
  Misses        229      229              
Flag Coverage Δ
unittests 97.58% <100.00%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZigRazor ZigRazor self-requested a review January 23, 2024 08:13
@ZigRazor ZigRazor merged commit 3f143c9 into ZigRazor:master Jan 23, 2024
27 of 33 checks passed
@badumbatish badumbatish mentioned this pull request Feb 2, 2024
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.

2 participants