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
Vertex Coloring, Edge Coloring #6679
Comments
First patch ! |
Attachment: coloring-1.patch.gz Attachment: coloring-1.2.patch.gz First patch ! |
comment:1
Hmmm... The two patches coloring-1 and coloring-1.2 are exactly identical, but I do not know how to remove the second one ^^; |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:7
As the functions dealing with LP have not been reviewed, I prefer to rewrite the MIP class for Sage to make it easier to use. I will post a new version of the MIP patch as soon as possible, along with all the patches for functions using it. Sorry for the trouble, I'll try to make it quick ! Nathann |
comment:8
Even shorter, even better, even more efficient... Here is the new version of these two functions, now using the symbolic version of MIP from #6869 !!!! |
This comment has been minimized.
This comment has been minimized.
Attachment: coloring-symbolic.patch.gz |
comment:9
I have a question. What is the relation to the already existing methods .chromatic_number() and .coloring()?
At the very least it seems reasonable to modify .coloring() rather than add a new function, and perhaps keep the previous algorithm if that is useful. I can't speak to which one is better, unfortunately, but it can be good to avoid a surfeit of methods. |
comment:10
Hello !!!! I wrote this patch some time ago, and it needed an update because of some changes in class numerical.mip. Besides, your sound remark needs an answer :-) Here is what this new version of the patch does :
Nathann |
This comment has been minimized.
This comment has been minimized.
comment:12
Added round_robin, and a more efficient coloring for complete graphs |
comment:13
I assume that the patch
However, the following style is compatible with Python 3.x:
Lots of code in the Sage library still uses the old style of raising exceptions. This will come back to haunt us when the time comes to switch to Python 3.x.
|
comment:14
Patch updated ! I also noticed I had forgotten one "optional" tag in the docstrings, and I rewrote all the ValueError I was able to find in the whole file. I have a question though : I build the reference to check the docstrings and noticed the file graph_colouring.pyx was not included in them : should we change it ? There are still many "test" functions in this file that may not be of interest to the user, though.... In any case, thank you very much for your help :-) Nathann |
comment:15
Attachment: trac_6679.patch.gz Replying to @nathanncohen:
An ultimate goal is to include all documentation of the Sage library in the reference manual. So, yes to your suggestion. Please open another ticket to include the file |
based on trac_6679.patch |
comment:16
Attachment: trac_6679-reviewer.patch.gz The patch
The doctests also pass with the optional packages
|
Author: Nathann Cohen |
Reviewer: Minh Van Nguyen |
Changed reviewer from Minh Van Nguyen to Karl-Dieter Crisman, Minh Van Nguyen |
comment:18
Well, graph coloring may be used to plot graphs but most of the time, its output is used to do more interesting things, so I think settng the default behaviour to returning the partition of independent sets is safe :-) Short of this :
And I thank you very very very much for your help !!! I agreed with all of your changes while reading the patch file, you're doing a great job !! Nathann |
This comment has been minimized.
This comment has been minimized.
Merged: sage-4.3.alpha1 |
Hello everybody !!!
Here are two new functions for the Graph class in Sage : vertex_coloring and edge_coloring.
If you have no LP Solver installed, you can download GLPK or CBC from this address : http://www.sagemath.org/packages/optional/
These functions should be ---way--- more efficient than the previous ones, regardless of the Linear Solver you chose to use.
DEPENDS ON #7270 !!!!!!!!!!!!!
Component: graph theory
Author: Nathann Cohen
Reviewer: Karl-Dieter Crisman, Minh Van Nguyen
Merged: sage-4.3.alpha1
Issue created by migration from https://trac.sagemath.org/ticket/6679
The text was updated successfully, but these errors were encountered: