9. Use five different colors to color the six vertices of the triangular prism $A B C-D E F$, requiring each point to be colored with one color, and the two endpoints of each edge to be colored with different colors. Then the number of different coloring methods is $\qquad$.


9. 1920.

Transform the adjacency relationship of the vertices of a triangular prism into the regional relationship as shown in Figure 4, then the coloring methods for vertices $A$, $B$, and $C$ are $\mathrm{A}_{5}^{3}$ kinds.

For each determined coloring scheme of points $A$, $B$, and $C$, if we temporarily do not consider the requirement that the endpoints of each edge must be different colors, then vertices $D$, $E$, and $F$ also have $\mathrm{A}_{5}^{3}$ different coloring schemes. Let the set of all these coloring schemes be denoted as $P$, hence
$$
|P|=\mathrm{A}_{5}^{3}=60 \text{. }
$$

Let $P_{1}$, $P_{2}$, and $P_{3}$ represent the sets of all schemes in $P$ where points $A$ and $D$, $B$ and $E$, and $C$ and $F$ are the same color, respectively. Then
$$
\left|P_{i}\right|=\mathrm{A}_{4}^{2}=12, \left|P_{i} \cap P_{j}\right|=\mathrm{A}_{3}^{1}=3,
$$

where $1 \leqslant i<j \leqslant 3$,
$$
\left|P_{1} \cap P_{2} \cap P_{3}\right|=1 \text{. }
$$

By the principle of inclusion-exclusion, the total number of coloring schemes where the endpoints of any edge are different colors is
$$
\begin{array}{l}
\mathrm{A}_{5}^{3}\left(\mathrm{~A}_{5}^{3}-\left|P_{1} \cup P_{2} \cup P_{3}\right|\right) \\
=\mathrm{A}_{5}^{3}\left(\mathrm{A}_{5}^{3}-\sum_{i=1}^{3}\left|P_{i}\right|+\sum_{1<i<j<3}\left|P_{i} \cap P_{j}\right|-\left|P_{1} \cap P_{2} \cap P_{3}\right|\right) \\
=\mathrm{A}_{5}^{3}\left(\mathrm{A}_{5}^{3}-3 \mathrm{~A}_{4}^{2}+3 \mathrm{~A}_{3}^{1}-1\right) \\
=1920 .
\end{array}
$$