write a C++ program that reads in a graphs adjacency matrix from a file and counts the number of connected components in that graph
the program must finally print out the total number of connected components this graph has,the number of vertices in each connected component,and there must be a line stating the connected component with the highest number of vertices
PLEASE code this in a readable manner,name the variables appropriately and comment and explain a bit
thanks so much
input files:
file number 1:
0 0 0 0 0 1 0 0 0 0 0 1
0 0 0 0 0 0 0 0 1 0 1 0
0 0 0 0 1 0 0 0 1 0 0 0
0 0 0 0 0 1 1 1 0 0 0 0
0 0 1 0 0 0 0 0 0 1 0 0
1 0 0 1 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 1
0 1 1 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 0 0 1 0 1 0
0 1 0 0 0 0 0 0 0 1 0 0
1 0 0 0 0 0 0 1 0 0 0 0
file number 2:
0 0 0 0 1 1 0 0
0 0 0 1 1 0 0 0
0 0 0 1 0 0 1 0
0 1 1 0 0 1 0 0
1 1 0 0 0 0 0 1
1 0 0 1 0 0 0 0
0 0 1 0 0 0 0 1
0 0 0 0 1 0 1 0
file number 3:
0 1 0 0 0 0 0 0 0 1 0 0 0 0
1 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 1 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 1 0 0 0 1 0 0 0
0 0 0 0 0 1 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 1 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 1 1 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0