Let $T$ be a permutation (multiset). A function $\pi(i)$ assigns a positive integer value lower than $m$ for an element $i$ of $T$. The set $B_k$ is a subset of $T$, such that $i \in B_k$ if $\pi(i) = k$, i.e. $B_k = \{ i \in T : \pi(i) = k \}$. Note that the arrangement of the elements in $B_k$ are the same as $T$. Let $Y$ be a set of arcs $(i,j)$, where an arc exist for each element $i$ to $i+1$ of $Y_k$, for all $k$ and $i < |Y_k$ , e.g. $Y = \{ (Y_{k,i}, Y_{k,i+1}) : k \leq m \land i < |Y_k| \}$.
My question is, is it clear the way that I am writing? There is an easier way to make the reader understand those relations? Could I reduce the amount of text by using a more clear set builder notation?
The elements where $\pi$ takes the same value form an equivalence class. You can identify them with the union-find algorithm. Once you have identified the equivalence classes, you can sort them with the key being their original position in the list. You can them make the arcs according to whatever protocol you are using. The simplest of course would be the first with the second, the second with the third, and so on.
It may be true that the sorting step will be unnecessary, due to the order in which the elements are processed by union-find. You should check this.