Hi all,
I am having difficulty finding a way to simplify a tree of numbers.
I have data on the left, and a single value given in this case as 0.5.
I would like to get data on the right side in a way that the number of different elements is reduced (replaced) if the difference between them is less than the input value of 0,5
I would appreciate a lot any suggestions
numbers_sorting.gh (11.5 KB)
I don’t understand? What is Data?
Do you want Sort? (purple group)
Reading your post again, it sounds more complicated than that.
I think it’s funny when people use the word “simple” (or “simplify” or “simplifying”) in thread titles or their first post. What makes anyone think it’s simple 
1 Like
So I have some “tolerance value” that for this example is 0,5.
In the first branch, there are:
134.1 => that is “farther” than 0.5 from other elements in the list, and it remains in the simplified list.
Then there are 146.7 & 146.5 that are “closer” then 0.5 to each other and they are “simplified” in order that only one of them remains in the simplified list. It can be 146.7 or 146.5, so the final list will be {134.1, 146.5, 146,5} or {134.1, 146.7, 146,7}
I hope this explains a bit better
Cull Duplicate has also a tolerance, up to you to choose ?
You can also use “Point Group” but if you have
0.1 0.2 0.3 0.4 0.5 … with a max distance of 0.5 they will be all in a same group.
Or the other way is to convert everything to int, for example by multiplying by 2 (1/0.5) then using Sets. Then redividing everything by 2.
Nice solution, going the sideway to point and back. Just 4 components to get it done! Compliments, Regards, Eef
Thanks a lot. This is a really nice solution 
ok, instead of “simplified,” it could be described as a list with fewer unique elements. As the list on the right panel in the first picture I posted. AlsoI never said that it is something simple to do