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
random cograph generator #37964
base: develop
Are you sure you want to change the base?
random cograph generator #37964
Conversation
Documentation preview for this PR (built with commit 2bc741f; changes) is ready! 🎉 |
some years ago there was a GSoC project which resulted in a cograph generator. |
We can certainly add such a generator (in a separate PR), but the code you pointed requires substantial amount of work to get a suitable version. I did a first trial and it took me some time to make it work. I'll see if I can get a better and properly documented version. It will take some time. |
for this PR, can you say what kind of distribution you get for these random cographs? |
I have no idea. I have not been able to find papers or code about the generation of random cographs of any order. The generator of networkx only produces cographs of order |
the usual bias to come from would be from.repititions (your recursion could lead to an isomorphic graph from different random choices). It would be good to have a cograph generator to test your code for non-uniformity of the distribution) |
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.
to me it sounds more natural to recurse on a random partition of n
.
The choice of starting with connected components, or co-components, has only to be made once, then the rest is forced.
The hope is that uniform random partitions correspond to a reasonably close to uniform random cograph.
for random partitions of |
I'm working on the cographs generator. I will propose a PR asap. I'm not sure of the algorithm you propose using random partitions. Can you develop the idea ? |
The idea is that all we need is to be able to generate a random partition |
I had a look at the formulae for computing
and we get
The next step will be to adapt method |
One thing I don't see is how to deal with isomorphic (co)connected components. With the approach I proposed there would be a bias towards getting isomorphic (co)-components more often than we want. This bias can be basically ignored for large components, though, as hitting an isomorphic one would get improbable. |
OTOH, instead of using |
Well, I'm lost. I did several trials to modify the random permutation method but I'm far from getting something uniform. Actually, I combine several calls to the random permutation method to get cotrees, but I'm getting most of the time |
Lemma 5.1 in https://arxiv.org/pdf/1906.10355 presents a method for generating random labelled cographs uniformly at random. It uses Galton–Watson trees conditioned on producing |
Add a generator of random cographs.
📝 Checklist
⌛ Dependencies