I want to randomly shuffle an array but also keep some physical links together/in order.
If I have an array like {10, 20, 50, 1, 2, 3, 15, 25}, I want to randomly shuffle the indices but also keep together some relevant links. For example if I wanted to keep {10,20,50} together and only treat the "10" as a index to randomly shuffle:
{1, 10, 20, 50, 15, 2, 25, 3}
I know that there is a function random_shuffle() for vectors and I was hoping to apply it once I figured out how to keep what I want to keep intact.