The counting of partitions of a natural number, when they have to satisfy certain restrictions, is done traditionally by using generating functions. We develop a polynomial time algorithm for counting the weighted ideals of partially ordered sets of dimension \(2\). This allows the use of the same algorithm for counting partitions under all sorts of different constraints. In contrast with this, the method is very flexible, and can be used for an extremely large variety of different partitions.
1970-2025 CP (Manitoba, Canada) unless otherwise stated.