Luper
August 24, 2012, 8:54pm
1
When using the sort (spreads) , and having some equal values in your spread, the ‘Former Index’ pin seems to ‘random’ the sequence off the slices that are double.
https://vvvv.org/sites/default/files/imagecache/large/images/SortFormerIndex_2012.08.24-20.48.19.png
In the forum I found some people got the same problem, but cannot find the solution! someone can tell me how did you solved this?
SortFormerIndex.v4p (6.2 kB)
bjoern
August 24, 2012, 9:24pm
2
I think it’s a result of the used sorting algorithm.
SortSort.v4p (6.5 kB)
When using the sort (spreads) node, and having some equal values in your spread, the ‘Former Index’ pin seems to ‘random’ the sequence off the slices that are double. I wanted to make a Sort-Module with a Binsize when I discovered this behaviour....
Very old bug, hope it gets fixed some day…
as björn pointed out, this is a feature of the sorting algorithm. i guess our algorithm is not ‘stable’. where stable means, it keeps the order where ever possible.
here is a big comparison:
http://en.wikipedia.org/wiki/Sorting_algorithm
if one finds the time, we could look for another algorithm.
sebl
August 27, 2012, 12:27am
6
so, which algorithm is in the nodes now?
the vvvv node uses a quicksort implementation.
Elias
August 27, 2012, 3:19am
8
seems as if the Sort (Spreads Advanced) from the addonpack uses a stable sorting algorithm.
bjoern
August 27, 2012, 10:08am
9
yes so it seems but it reverses the slide order.
sebl
August 27, 2012, 12:29pm
10
Array.sort() does exactly the same…
SortSharp.rar (18.6 kB)
tonfilm
September 14, 2012, 2:11pm
11
the Sort (Spreads) node uses a stable mergesort algorithm now, check latest alpha28.3.