get_w_connected_cmpts function

Get all nodes associated with connected components