i’ve tried some python scripts from different questions, but they don’t quite solve the problem and i have no python experience. I don’t know if you can do it only in grasshopper.
I want to sort all the 21 numbers in the picture above in lists were the sum doesnt exceed 240 but still gets as close as possible. the list length and the total amount of those (max 240) lists necessary doesn’t matter.
By the way, running data through text panels is generally a bad idea. They are great for examining component outputs but can cause data corruption in certain cases.
That’s a tough cookie (if we are after “ideal/best” solutions AND we invite combinations/permutations to the party … we are talking O(2^n) solution … meaning the obvious: Adios Amigos),
Anyway a simplistic (a bit naive) solution could be (you can’t translate C# to P [plus: I hate P]):