The undocumented function SparseArray`StronglyConnectedComponents seems to be able to take a matrix (not just a binary one) and count some sort of connected components. But since it's undocumented I have little hope of finding out exactly what it does.
@xzczd No, but I watched the announcement video by S.W. on Youtube where he demoed it, and the Computational X video on Youtube where he uses it a bit more of different problems and I think it looks nice.
@xzczd No, unfortunately not but it looks nice in demos. I use Github Copilot and ChatGPT for coding on a daily basis so I have no doubts that it can work well.