Example 7 Given that $x_{1}, x_{2}, \cdots, x_{6}$ are six different positive integers, taking values from $1,2, \cdots, 6$. Let
$$
\begin{aligned}
S= & \left|x_{1}-x_{2}\right|+\left|x_{2}-x_{3}\right|+\left|x_{3}-x_{4}\right|+ \\
& \left|x_{4}-x_{5}\right|+\left|x_{5}-x_{6}\right|+\left|x_{6}-x_{1}\right| .
\end{aligned}
$$

Then the minimum value of $S$ is $\qquad$ [5]
(2009, National Junior High School Mathematics League Sichuan Preliminary)
Since equation (1) is a cyclic expression about $x_{1}, x_{2}, \cdots, x_{6}$, we can assume $x_{1}=6, x_{j}=1(j \neq 1)$. Then
$$
\begin{aligned}
S \geqslant & \left|\left(6-x_{2}\right)+\left(x_{2}-x_{3}\right)+\cdots+\left(x_{j-1}-1\right)\right|+ \\
& \left|\left(x_{j+1}-1\right)+\left(x_{j+2}-x_{j+1}\right)+\cdots+\left(6-x_{6}\right)\right| \\
= & 10 .
\end{aligned}
$$

When $x_{i}=7-i(i=1,2, \cdots, 6)$, $S$ achieves its minimum value of 10.