Let's say that I have a graph where each vertex can have an outdegree of at most 1 (self-loops allowed). Finding/creating an algorithm to find the weakly connected components and then counting them is not difficult. But it seems weird to have to do both. Is there a way to find the number of weakly connected components without finding them as well, in a way that is faster than having to do both?
At first I thought about looking at restrictions on the numbers of zero columns compared to the number of zero rows, but couldn't get anywhere with that.