I am currently working on a scheduling problem which has a solution represented by a multidimensional array called Sol. For instance, Sol = [[4, 1, 5, 2], [3, 6, 10, 9, 7, 8]]. Each row is represented by a permutation that may have different lenghts. I have also an ordered array with the same number of rows that is called OF such that OF = [448, 341]. I apply sortperm(OF) to find the order that I should sort Sol. For example, sortpem(OF) = [2, 1]. In this case, I would have to sort Sol such that Sol = [[3, 6, 10, 9, 7, 8], [4, 1, 5, 2]]. I would like to know if there is an efficient way to sort the the rows, which are individual arrays in Sol.
If this post is in the wrong category, please feel free to move it appropriately.