In Algorithm  An alternative method to find a minimum-length permutation factorization of permutation \(\pi \in \mathfrak {S}_n\)  using the generating set \(S_1=\lbrace (i\,i+1) : 1 \le i < n\rbrace \)  is to apply numbers game [1]}, [2]} of finite Coxeter group of type \(A_{n-1}\)  [3]}, [4]}. An interested reader may refer to [1]}, [2]}, [3]}, [4]} for further details., we do not need to generate every bubble-sort Cayley graph \(\text{BS}_n\)  to find a shortest path from vertex \(\pi _2^{-1}\pi _1\)  to vertex \(I\) . If a right multiplication of \(\pi _2^{-1}\pi _1\)  by an adjacent transposition reduces an inversion number by 1, the vertex of the resulting permutation comes closer to vertex \(I\)  in terms of a distance in \(\text{BS}_n\)  in which permutation \(I\)  has the 0 inversion number [4]}, [10]}. By swapping adjacent out-of-order elements in the permutation using the bubble-sort algorithm, it reduces an inversion number by 1. Therefore, we may apply a bubble-sort algorithm of \(O(n^2)\)  complexity [11]} to \(\pi _2^{-1}\pi _1\)  in order to keep track of a shortest path from vertex \(\pi _2^{-1}\pi _1\)  to vertex \(I\)  as shown by the example in this section. Note that a minimum-length sequence of adjacent task swappings needed from \(\Gamma _{\pi _1}^{L(n)}\)  to reach \(\Gamma _{\pi _2}^{L(n)}\)  is not necessarily unique. However, the length of a minimum-length sequence is unique, which is the inversion number of permutation \(\pi _2^{-1}\pi _1\) . It is also the distance from vertex \(\pi _2^{-1}\pi _1\)  to vertex \(I\)  in \(\text{BS}_n\) .
<FIGURE>