Detecting graph components and visualizing communities