ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 28 Mar 2020 21:22:34 +0100Iterate over Set partitions of given lengthhttps://ask.sagemath.org/question/50404/iterate-over-set-partitions-of-given-length/(Definition: for a set $S$, and a partition $P=\\{P_1,P_2,\ldots,P_k\\}$ of $S$, we say that the *length* of $P$ is $k$.)
I want to iterate over all partitions of $S$ whose length is $k$.
**Motivation**: I am testing a property for graphs which satisfy a certain coloring-property (which is **not** standard coloring). So I need to check, in turn, whether a partition in $1,2,\ldots,p$ parts will satisfy the restriction for this particular type of coloring, before I can proceed to the test I want to make.
If it helps, for traditional (proper) graph coloring there is an iterator that does precisely the type of thing I am looking for; it is called `all_graph_colorings`.tassioSat, 28 Mar 2020 21:22:34 +0100https://ask.sagemath.org/question/50404/