We can either do the multiplication or we can examine the graph and find the least expensive path between the specified nodes.

\[
\begin{matrix}
\begin{array}{c | c c c c}
M_X^2 & A & B & C & D \\\\
\hline
A & 0 & 6 & 3 & \infty \\\\
B & 2 & 0 & 5 & 5 \\\\
C & 5 & 3 & 0 & 8 \\\\
D & \infty & 7 & 4 & 0
\end{array}
&
\begin{array}{c | c c c c}
M_X^4 & A & B & C & D \\\\
\hline
A & 0 & 6 & 3 & 11 \\\\
B & 2 & 0 & 5 & 5 \\\\
C & 5 & 3 & 0 & 8 \\\\
D & 9 & 7 & 4 & 0
\end{array}
\end{matrix}
\]

Each successive multiplication identifies paths of that length.