In Section  we discussed that a Cayley graph of \(\mathfrak {S}_n\)  generated by \(S_4=\lbrace (i\,j):1 \le i <j \le n\rbrace \)  is the complete transposition graph \(\text{CT}_n\) . It follows that a sequence of adjacent task swappings needed from \(\Gamma _{\pi _1}^{C(n)}\)  to reach \(\Gamma _{\pi _2}^{C(n)}\)  in Algorithm  corresponds to a path from vertex \(\pi _2^{-1}\pi _1\)  to vertex \(I\)  in the complete transposition graph \(\text{CT}_n\) . To find a shortest path from vertex
\(\pi _2^{-1}\pi _1\)  to vertex \(I\)  in \(\text{CT}_n\)  [1]}, one may apply a greedy algorithm to transpose and locate each element in the permutation to its homed position iteratively from left to right until arriving at \(I\) . For example, a shortest path from vertex \(p_2^{-1}p_1={(p_1^{-1}p_2)}^{-1}=1\,4\,6\,5\,3\,2 \in \mathfrak {S}_6\)  to vertex \(I\)  in \(\text{CT}_6\)  is as follows: \(1\,4\,6\,5\,3\,2 \xrightarrow{} 1\,5\,6\,4\,3\,2 \xrightarrow{} 1\,3\,6\,4\,5\,2\)\( \xrightarrow{} 1\,6\,3\,4\,5\,2 \xrightarrow{} 1\,2\,3\,4\,5\,6\) , where the label of each arrow denotes an edge in \(\text{CT}_6\) . Therefore, \({p_1}^{-1}p_2={(p_2^{-1}p_1)}^{-1}=(2\,4)\)\((2\,5)\)\((2\,3)\)\((2\,6)\) , which coincides the above permutation factorization of \({p_1}^{-1}p_2\)  using the generating set \(S_4\) .
