Is there a function that identifies rows which are part of independent blocks of a symmetric (square) matrix?
For example, here is a symmetric matrix that is secretly a block-diagonal matrix under suitable exchanges of rows and columns.
mat = {{x2+x6, 0, 0, x6}, {0, x1+x4, x4, 0}, {0, x4, x3+x4, 0}, {x6, 0, 0, x5+x6}}
$$\left( \begin{array}{cccc} \text{x2}+\text{x6} & 0 & 0 & \text{x6} \\ 0 & \text{x1}+\text{x4} & \text{x4} & 0 \\ 0 & \text{x4} & \text{x3}+\text{x4} & 0 \\ \text{x6} & 0 & 0 & \text{x5}+\text{x6} \\ \end{array} \right)$$
Is there a function IdentifyRowsInIndependentBlocks
that indicates that rows 1 and 4 are part of a block, and 2 and 3 are part of a block? An output would be something like
IdentifyRowsInIndependentBlocks[mat]
(* {{1,4}, {2,3}} *)
which works for arbitrarily large matrices.