count_w_connected_cmpts function

Get the number of weakly-connected components