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
Gale Ryser theorem #7301
Comments
comment:2
Here it is ! :-) |
comment:3
I can review this in a week or two since a colleague here is an expert in that area (and I'll be finished with teaching then:-). Is the graph-theoretic analog of this theorem implemented? (The Haval-??? Theorem?) |
comment:4
I'm glad to hear it !! This is my second attempt at a contribution to the Combinatorics section, and I hope you will find it useful :-) The odd thing is that if I knew of the Gale Ryser theorem, I never heard of the theorem you are talking about, when it clearly should be the opposite... Could you tell me what this theorem is about ? I was not able to find it using "haval" on Google, and I am very interested in what it could be :-) The only direct use I could make of this theorem in Graph Theory is deciding whether there exists a bipartite graph with a given degree sequence... Is that the result you are mentionning ? :-) And by the way, I only wrote this function for squares matrices when it is not required.. Thinking about bipartite graphs helped me notice :-) Nathann |
comment:5
Replying to @nathanncohen:
Yes, I believe that is it. But I think the Haval-??? Theorem generalizes that a bit.
|
comment:6
Now with non-square matrices ;-) |
comment:8
Hi there, There is something I don't get in the doc:
I suggest that the role of Am I definitely confused ??? Florent |
comment:9
oopsssssss !!! Would "if and only if the conjugate of p_2 dominates p_1"make you feel better ? :-) This is what the code does ( and what the theorem says ) :-) Nathann |
comment:10
I am not an expert but I do have a colleague who not only wrote his thesis on a related result but claims that the Gale-Ryser theorem was one of the results which inspired him to become a combinatorialist. He is not satisfied with your implementation. He had problems with the wording of the documentation, though he admitted this was only a minor issue. (For example, "dominated" should be "majorized"...) More important, he believed, was that the only construction implemented was a special one (in particular, Ryser's construction was not implemented). Without being specific, he said that more options should be available to the user, to allow for different types of features/constructions. He was also hoping to have a construction of the graph-theoretic analog (given a possible degree sequence, construct a graph having that degree sequence). I presume though that, if you decided to implement that, you would create a separate ticket. Thanks very much for working on this! I know this is a bit vague, so please ask questions and I will ask for more details from my colleague. |
comment:11
Replying to @wdjoyner:
This is clearly a question of community. Those kind of matrix problem arise in the representation theory of Symmetric Groups or in symmetric functions and in this context I've allways seen the order called dominance order. See eg: Macdonald, I. G. Symmetric Functions and Hall Polynomials, 2nd ed. Oxford, England: Oxford University Press, 1995.
Again in the theory of symmetric function and descent algebra of the symmetric group, it is useful not to give a single solution but to give all of them, without restricting et entries of the matrix to be smaller than one (i.e. any non negative integer). Moreover the order of the input is important so that I'd rather have the input to be composition rather than partition. However I don't know if in this case we need a different enumeration algorithm. You can have a look at http://mupad-combinat.sourceforge.net/doc/en/combinat/integerMatrices.html
|
comment:12
Hello everybody !!! Well, concerning the wording issue, I believe that it is correct in this case, or that at least it depends on communities, especially, when one looks at the code : "the conjugate of p2 dominates p1" is written "p2.conjugate().dominates(p1), so surely I am not the only one to give these definitions to these words :-) The other issue seems for you to expect more than just a solution : you are both talking about the complete enumeration of the matrices corresponding to these criteria, and through Linear Programming I can olny give you a simple solution, as solvers are not that bright on the enumeration side... Would you happen to have a reference for this algorithm ? I was onnly able to find a proof to show one matrix existed, but nothing about enumerating them. I also have to admit that if writing this function was quick enough because I knew what I needed and how to use it, I may not have enough time available too look for a new ( and possibly long ) algorithm and implement it. Do you feel like this algorithm is totally useless as it is, or could it be possible to take this function and create a ticket to move it to a enumeration problem ? Besides, your friend was talking about "different subsets of numbers". Well, I only met this problem for 0-1 matrices and I assume your are not talking about replacing 0 by x and 1 by y... Do you mean that there is a version of this theorem working simultaneously for several types of different variables (with two partitions per type of variable, etc...) ?? This would interest me very much !! Thank you for your interest ! Nathann |
comment:13
No, I think this is a useful patch. Also, I agree that the enumeration problem is a separate ticket. I am not an expert, so to review your patch, which I think is interesting, I am told to read
They shouldn't take long to read but I don't own these and will I was also told of a very interesting application of the Gale-Ryser
|
comment:14
Replying to @nathanncohen:
...
Yes, he indicated that a very simple modification of the construction should
|
comment:15
Nathann: I have started reading these books and spoken to my colleague again. The book
has a construction (due to Ryser) which is in many cases more valuable than the construction implemented (due to Gale). Moreover, the implementation of the construction assumes that the R,S have no I need to digest the Ryser algorithm better but thought I would post this update FYI. |
comment:16
I began to read the chapter six and it is indeed very interesting :-) I did not get to the point where Ryser enumerates these matrices or speaks about multiple values beyong 0-1.. Thanks !!! Nathann |
comment:17
Please see |
comment:18
Replying to @wdjoyner:
Make that http://sage.math.washington.edu/home/wdj/sagefiles/gale-ryser.sage |
comment:19
Excellent !!! Well, could you send your code as a patch to replace mine then, as it does not use LP ? :-) two remarks though :
Great work !! :-) Nathann |
comment:20
Replying to @nathanncohen:
I will submit my code to my colleague, who does not use Sage He already said that you have implemented Gale's algorithm, and More later when I receive his report.
|
comment:21
Your is both an algoorithm and a proof, which makes it more interesting than mine. Besides, yours does not require the package GLPK to be installed.. I even doubt my version could be faster so... :-) |
comment:22
Just an update: My colleague agrees that my implementation is corect. There was a issue because I told him that in my opinion the Now he is grading finals but when he finishes, and I finish with my grading, I'll be able to add the two Gale-Ryser implementations together. |
comment:23
Hello !! I just noticed some paper among today's publications that may interest people here : Nathann |
This comment has been minimized.
This comment has been minimized.
comment:26
Replying to @wdjoyner:
Sorry, dumb question. This is what I should have asked: The condition
should be replaced by a condition on p1 and the conjugate of p2, |
comment:27
Well, the condition on the domination of p* may be fulfilled while the two partitions do not sum to the same value, which is clearly necessary, so we need the two conditions to be checked ( and summing the fastest of the two )... well, actually I thought after out little chat that we should forget about the LP version and implement yours when you will have found the time to write it. It's up to you ! :-) Nathann |
apply this patch only to 4.3. |
comment:28
Attachment: trac_7301.2.patch.gz This passes sage -testall on an ubuntu machine. Nathann: Can you please look at this? Please check your LP code, which I modified slightly. Feel free to add a referee's patch (eg, adding an AUTHORS field, which I just noticed I forgot). It turned out that partition was the wrong place to put it. My colleague who refereed it did not like that the integer vectors were not allowed to have trailing 0's and so that ruled out allowing gale_ryser_theorem to be a method for the Partition class. |
comment:29
In reply to an email Nathann Cohen sent me:
Python has a mechanism for "private" functions like slider01, so
I think this will not work, if you want to allow trailing 0's.
I was told that by my colleague which is much much more of an expert on
I changed all $ to '. Thanks!
Thank you for the reference! I think the docstrings are okay now.
Done. Thanks.
|
Attachment: trac_7301-referee.patch.gz seems to apply to 4.3* and test okay. Apply only this patch. |
comment:30
I thought you could have sorted the lists, created the corresponding Partition objects, then used the dominates/conjugate methods... Well, it is not that bad a problem anyway :-) Nathann |
comment:31
Well, do you think slider01 could be used by ither methods ?
The Gale-Ryser theorem tells you that given two partitions, there is a matrix satisfying the constraints if and only if the domination criterion is checked. Well, the point you made about trailing 0's is that you do not necessarily want the column's sums in your final matrix to be sorted in decreasing order. When you have a binary matrix, though, you can modify it by inverting two columns without changin the rows sums, and the columns sum still have the same set of sums. So instead of just taking care of trailing 0, the best may be to take care of non-sorted sequences, which is the general case of the theorem.
Then the best is to :
Nathann |
comment:32
New version, after some emails exchanged :
Nathann |
Attachment: trac_7301.patch.gz |
comment:33
|
comment:34
Thanks Nathann! I'll start testing it now. |
comment:35
applies to 4.3.a9 and 4.3 fine and passes testall except for some presumably unrelated failures on ubuntu 64bit and mac 10.6.2. Positive review. Thanks again Nathann! |
Merged: 4.3.1.alpha2 |
comment:36
David as Author and Nathann as Reviewer? It's not entirely clear to me, so can you fill out those slots for me? |
comment:37
Considering the amount of work from David on this function, it seems fitting :-) |
Author: David Joyner |
Reviewer: Nathann Cohen |
Changed merged from 4.3.1.alpha2 to sage-4.3.1.alpha2 |
The Gale-Ryser theorem is about filling a matrix with 0 and 1 when you know the number of 0 and 1 in each column and in each row.
It would not be too much work to write in Sage a function filling a matrix with 0 and 1 when the data is correct, and returning an error otherwise...
More informations there : http://mathworld.wolfram.com/Gale-RyserTheorem.html
********** please set #7590 as needing review when this receives a positive review ! ************
CC: @sagetrac-sage-combinat
Component: combinatorics
Author: David Joyner
Reviewer: Nathann Cohen
Merged: sage-4.3.1.alpha2
Issue created by migration from https://trac.sagemath.org/ticket/7301
The text was updated successfully, but these errors were encountered: