You could try like this:
- groups the elements into different queues, such that all the elements that have some 'order' are in the same queue, e.g.
[[1, 1A], [2, 2A, 2B], [3, 3A], ...]
- randomly select one of those queues, remove the first element and add it to your result
- repeat until all the queues are empty
In case the partial ordering is more complex, e.g. if some element a has to be before b and c, but there is no partial ordering between b and c you could probably do the same with a tree or similar.
Also, as pointed out by @vib, in order to ensure uniform distribution of elements in the result, you should pick the different queues with probability proportional to the number of elements remaining in that queue.