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
IndependentSets class #13917
Comments
comment:2
I think this patch is useful. I was looking for something to count independents sets of a given size since they index certain triangulations of polytopes coming from flows on graphs (#14654). |
Reviewer: ahmorales |
Attachment: trac_13917.patch.gz |
comment:5
Hi, People from statistical physics are interested in finer quantities than the number of independent configurations (independent sets are related to particule interactions). In their case each configuration is counted with a weight of the form I let the serious comments to the reviewer. Vincent |
Work Issues: design, documentation |
This comment has been minimized.
This comment has been minimized.
comment:6
0') I thought that in your timing most of the time was lost in the creation of the list and the for loop... but no: it is not much faster to enumerate all independent set rather than counting them with the method cardinality (I update the example in the description). So, I am as well surprised by Todo
In other words an iterator is an iterator and nothing else. If you want to design the set of independent sets it should be an object different from the iterator. It would be better to have a Python class
Possible improvements
Documentation
|
comment:7
Yoooooooooooo !!
Cool !
Yep
Ok. So what you want is an empty class that does nothing, which calls another class that does all the job ? It cannot be just an independent iterator, for I also want to compute the number of cliques without having to compute all the lists of elements at Python level.
Says the dogma.
Says the dogma.
And what on earth would it do that is not a feature of the iterator ?
Over my dead body.
I will not create an empty class if I can avoid it.
Actually I avoided it on purpose. I felt like this thing was not interesting for everybody, and that it should belong to a module one would load when needed, rather than add a new function to Graph.... What do you think ? It's not like one wants to enumerate independent sets every other day.
I will rewrite this part using $14589 as a dependency. It's a bit stupid to deal with <64 vertices graphs only.
And it already is :
What do you want ? Ugly "if" everywhere in the main loop to filter this before returning them ?...
The complement of an independent set is a vertex cover (and very often a dominating set too, unless the graph has isolated vertices), but an independent set of the is a clique. Was that the problem ?
Right, right. I will add them to the next version of this patch. Nathann |
comment:8
Replying to @nathanncohen: Hey!
(-: you should love your parents :-)
And what about
Your class is in between:
It might be your choice to have a multiple purposes class. If so, specify it in the documentation as : "you can either use the class to iterate (though only once) or compute the cardinality, but do not think that you can do both in a clean way".
I agree!
No. What I meant is to consider a more general attribute
My mistake. |
comment:9
(new patch that works with >64 vertices, based on top of 14589. And even slower than the first one Nathann |
This comment has been minimized.
This comment has been minimized.
Dependencies: #14589 |
comment:11
Newwwwwwww patch !!!!
Tell me if you like it Nathann |
Attachment: trac_13917-v2.patch.gz |
Changed work issues from design, documentation to none |
comment:12
Attachment: trac_13917-v2-more_doc.patch.gz You are a clever guy as you found a solution that satisfy both of us! Some new comments
|
This comment has been minimized.
This comment has been minimized.
Commit: |
This comment has been minimized.
This comment has been minimized.
Branch: u/ncohen/13917 |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Changed reviewer from ahmorales to ahmorales, Vincent Delecroix |
comment:26
See |
comment:27
Helloooooooooooooooooooooo !!! I think that this 0 was meant to be a 10 or something. Anyway thank you for changing it. About About the TODO section. HMmmm... I don't like this much, because to me it is not a "todo" at all. It is just ideas for improvement. It is not something that must be done, it is just ideas.... "Possible improvements" would fit better I think. Well. 'tsup to you I will upload a small commit in a second, because the second Have fuuuuuuuun and thank you again Nathann |
comment:29
In my last commit, I removed the TODO and put the comment in the NOTE. New commits:
|
Changed reviewer from ahmorales, Vincent Delecroix to Vincent Delecroix |
Changed branch from u/ncohen/13917 to u/vdelecroix/13917 |
comment:30
Wouhouuuuuu !! :-) Nathann |
comment:31
Doctest failure
|
Changed branch from u/vdelecroix/13917 to public/13917 |
New commits:
|
Changed branch from public/13917 to |
I'm rather disappointed by this patch. Or I'm pleasantly surprised by Python, I don't know. I expected a much better speedup.
Either way, this patch implements a
sage.graphs.independent_set
module that can list/count (possibly maximal) independent sets. While right now we can only compute the maximal ones.Nathann
Depends on #14589
CC: @videlec
Component: graph theory
Author: Nathann Cohen
Branch/Commit:
635c88d
Reviewer: Vincent Delecroix
Issue created by migration from https://trac.sagemath.org/ticket/13917
The text was updated successfully, but these errors were encountered: