Block diagonalization of a symmetric square boolean matrix

263 Views Asked by At

I have a symmetric square matrix with elements from $\{0,1\}$. How can I block diagonalize it only swapping lines and columns or detect it's not possible?

1

There are 1 best solutions below

0
On BEST ANSWER

I think this will work, if you are looking for an algorithm:

  1. Start with a vertex.

  2. Find all its neighbors $N_1$, and delete the vertex itself.

  3. Find all the neigbors $N_2$ of the neigbors, and delete the neigbors $N_1$.

  4. Continue the progress until no more neigbors are found.

  5. Check if there is any vertex remained. If yes, then the matrix is block diagonisable; otherwise is not.