Thank you for all your replies, I will have experiment with the different options you have given but I think all 3 of you are pointing me in the direction of working in (non-negative?) integers and then using them to index back into the original set at the end.
I would never have thought of looking for the subSet function in SymmetricGroupCombinatoricFunctions for instance. I think it would be helpful to other users if one of the algorithms suggested could be wrapped in a function called powerSet and put in the set domain. On 07/04/2025 17:56, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote:
The question is whether sorting the subsets is needed.
I think it would be helpful for human readability if the results are graded by set length and are in a consistent order. In most cases I can think of filtering would not be required, for instance, generating a discrete topology. However there is one, completely mad, case that I would like to try even though I know its probably doomed. When I was trying to get an intuitive intuition for topologies on a finite set I thought it would help if I could write a function that listed out all the topologies on a set, of a given length, and see how they relate to each other. When I looked this up on wikipedia I found that the number of topologies is massive, even on a small set: https://en.wikipedia.org/wiki/Finite_topological_space#Number_of_topologies_on_a_finite_set Also finding an efficient algorithm to do this is an unsolved problem (I thought there were no unsolved problems in point-set topology). So the sensible thing to do here is give up. However even if no one has found an efficient algorithm there is still the inefficient bruit-force algorithm. That is to take every possible combination (a power set of a power set !) and then filter the result to pick only those that are valid topologies. I would also like to filter the results to give only topologies that are T0 and to not add topologies if there is already one isomorphic to it (another very difficult problem) this would reduce the size of the list a lot. Because the lists are so massive I think the results need to be filtered as the list is being generated. Not construct a really big list and then filter it. I realise this could only work for very small sets (3 or 4) but, for some reason, it seems like something I could learn from even though its mad. Martin -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/0f1ff03b-2b83-442e-b0db-471c63889ac5%40martinb.com.