there are a few numbers,

How can you sort them into 3 bowls that amount was close to each other? (equal)

# There are a few numbers. How can you sort them into 3 bowls?

**Legantmar**#1

**Legantmar**#3

All number = Sum

bowl №1 ~ = sum/3

bowl №2 ~= sum/3

bowl №3 ~= sum/3

or

sum bowl 1 ~ sum bowl 2 ~ sum bowl 3

This sounds like a case for the “LoopWhile” node. A little messy but it should at least give you an idea:

Here is a Design Script version with a little shuffle in between, that sometimes seems to throw up closer results.

This is a very rough approach, seems like it can get very complex if the aim is to ensure that we obtain the best possible result every time.

File: 3bowlsDS.dyn

**Legantmar**#8

Vikram, thank you for work. I will try to undestand you code block

Vikram, please see attach

The script is still not perfect,

hands more accuratelyNumbers_sort_3bowls

**Legantmar**#9

I corrected handmade sort

It is ideal result

How can we do it algorithm ?

Numbers_manual sort

**Vikram_Subbaiah**#11

Other than a brute force approach, which feels very inefficient, I cannot think of a better way right now.

Don’t think 1/3 sum in a bowl is the answer as the result will still depends on the sequence in which the numbers are considered.

I think this is a good discussion of a similar problem:

the problem is called PARTITION

**Legantmar**#13

I have done here v0.1

Does not work with some lists of numbers, I do not know why this is happening,

but the overall result is good