-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Edge coloring on graphs #7397
base: main
Are you sure you want to change the base?
Edge coloring on graphs #7397
Conversation
@dschult Could you please check this out ? I've explained our implementation in brief in this conversation. |
Thanks for this @padath314 and @Sreelaxme (and for the bipartite PR). |
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.
This is encouragingly similar to the bipartite code. I put a few comments, but they are so similar to the bipartite comments it seems like the first step will be to update this code to match. Thanks!
d + 1 colors. Let u and v be distinct non-adjacent vertices of G. | ||
Then there exists a proper edge coloring using d + 1 colors | ||
such that the same color missing at both u and v. | ||
https://iuuk.mff.cuni.cz/~rakdver/kgii/lesson20-6.pdf |
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.
Can you make a References section with the full reference to this paper. Links rarely last more than a few years (except for the DOI link to the article). Full reference is more likely to last without additional maintenance.
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.
We are actually not able to find the DOI link since our reference is a lecture note.
G = G.copy() | ||
degrees = dict(G.degree()) | ||
delta = max(degrees.values()) | ||
colors = set(range(delta + 1)) |
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.
Maybe use the range for colors instead of the set.
And make u_colors
be the dict used_colors[u]
and only use the keys()
when doing set operations.
(similar comment to the bipartite version)
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.
We are keeping the colors as set to make it easier to find available colors using set difference.
This pull request introduces an edge coloring algorithm within the edge_coloring() function. The function now returns a dictionary where each edge is a key, with corresponding values representing the assigned colors.
We have already created a pull request for edge coloring in bipartite graphs (#7138) which gives optimal coloring of bipartite graphs.