Description
As discussed in #2963, the path sorting approaches in the initial parcats
trace are pretty simple.
When sortpaths
is 'forward'
the paths are sorted by categories in their left-most dimension, then by the second leftmost, and so on, and finally by the right most dimension.
When sortpaths
is 'backward'
the process is repeated with the dimensions considered from right to left.
These approaches aren't optimized to minimize path crossing, so it would be nice to introduce one or more algorithms for sorting paths so as to minimize crossing paths.
In #2963 @alexcjohnson noted
In the Three dimension all the grey paths come together, yet the B->11 and C->11 paths are interleaved. And the red A->11 goes all the way to the bottom, but it could go to the top of the red bundle, resulting in less self-crossings. We should be able to find an algorithm that untangles these.
In addition, there would also be the option combining path sorting and category ordering (maybe setting both categoryorder
and sortpaths
to 'auto'
or something) so as to further reduce path crossing.