[issue12961] itertools: unlabelled balls in boxes

Phillip Feldman report at bugs.python.org
Sun Sep 25 04:50:51 CEST 2011

Phillip Feldman <phillip.m.feldman at gmail.com> added the comment:


I think that you may have overestimated the complexity of the problem.  In about 5 hours, I coded, debugged, and documented a set of generator functions to solve the general formulation (including box limits) for three occupancy problems:

- unlabeled balls in labeled boxes,
- unlabeled_balls_in_unlabeled_boxes, and
- labeled_balls_in_unlabeled_boxes.

(I will add labeled balls in labeled boxes, although this case is less interesting).

On the other hand, I agree with your comment that the general need for these has not yet been demonstrated.  I will post my code to PyPI and we'll see what happens.


Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list