Invariant Factors of a complete tripartite graph Let $K_{4,4,12}$ be a complete tripartite graph on 20 vertices. Considering its adjacency matrix with a convenient labeling,its nonzero eigenvalues are -4,-8,12. Now the invariant factors are 4,4,24. How did they find the invariant factors in detail, please?
 A: The version of the paper I found says that the invariant factors are $4,4,24$; we get $1,9,36$ for the second example $K_{2,9,9}$.
In any case, here is how you get there. These are not the invariant factors of the adjacency matrix (there's a result about those elsewhere in the paper) but of the quotient matrix, which in the case of $K_{4,4,12}$ is
$$\begin{bmatrix} 0 & 4 & 12 \\ 4 & 0 & 12 \\ 4 & 4 & 0\end{bmatrix}.$$
(In general, it has zeroes along the diagonal and otherwise the $(i,j)$ entry is the size of the $j^{\text{th}}$ part of the complete multipartite graph.)
To find the invariant factors, we reduce the matrix to a diagonal matrix in which each diagonal entry divides the next, by doing integer-invertible row and column operations, like so:
\begin{align}
\begin{bmatrix} 0 & 4 & 12 \\ 4 & 0 & 12 \\ 4 & 4 & 0\end{bmatrix} & \leadsto \begin{bmatrix} 4 & 0 & 12 \\ 0 & 4 & 12 \\ 4 & 4 & 0\end{bmatrix} & \text{(swap a pivot into $(1,1)$)} \\
& \leadsto \begin{bmatrix} 4 & 0 & 12 \\ 0 & 4 & 12 \\ 0 & 4 & -12\end{bmatrix} & \text{(subtract row 1 from row 3)} \\
& \leadsto \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 12 \\ 0 & 4 & -12\end{bmatrix} & \text{(subtract $3\times$ column 1 from column 3)} \\
& \leadsto \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 12 \\ 0 & 0 & -24\end{bmatrix} & \text{(subtract row 2 from row 3)} \\
& \leadsto \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & -24\end{bmatrix} & \text{(subtract $3\times$ column 2 from column 3)} \\
& \leadsto \begin{bmatrix} 4 & 0 & 0 \\ 0 & 4 & 0 \\ 0 & 0 & 24\end{bmatrix} & \text{(multiply the third row by $-1$)} \\\end{align}
In general, see the algorithm on Wikipedia.
