Hey There,

Want to subdivide a list of random numbers so that within the subdivided partitions the sum of the numbers is as close to but not above an adjustable threshold. In practice the threshold would always be greater than the largest random number. For example:

Take a random list of numbers:

4

2

11

2

1

6

3

6

2

5

1

4

8

7

Subdivide to several lists with a maximum sum threshold.

Threshold = 12

4,2 (sum = 6)

11 (sum = 11)

2,1,6,3 (sum = 12)

6, 2 (sum= 8)

5, 1, 4 (sum = 10)

8 (sum = 8)

7 (sum = 7)

Is there a way to automate this process. Maybe a script?

Tried using Hoopsnake and Anemone but I’m stuck.

Would appreciate any help.

Thanks,

D