@mehul vaidya In gate 1994 question asked upto 3 nodes i.e you consider 0 node , 1 node , 2 nodes and 3 nodes.
But Question based on unlabeled graphs because they asked upto 3 nodes
so for and 3 nodes we construct 4 different unlabeled graphs
As 3 vertex with 3 edges = 1 graph
3 vertex with 2 edges = 1 graph
3 vertex with 1 edge = 1 graph
3 vertex with 0 edge = 1 graph
similarly 2 nodes we construct 2 different unlabeled graphs
2 vertex with 2 edges = 0 graph
2 vertex with 1 edges = 1 graph
2 vertex with 0 edges = 1 graph
and 1 nodes we construct only 1 unlabeled graphs
1 vertex with 1 edges = 0 graph
1 vertex with 0 edges = 1 graph
these are the total 7 unlabeled graphs construct
and out of these 7 graphs only 4 graphs are connected....
which are
3 vertex with 3 edges = 1 graph
3 vertex with 2 edges = 1 graph
2 vertex with 1 edges = 1 graph
1 vertex with 0 edges = 1 graph ( single node also called as connected graph in 1 vertex graph ).
if you considering Labeled graph then formula is 2^n(n−1)/2
for 3 node = 2^3(3-1)/2 = 8 labeled graphs construct
for 2 nodes = 2 labeled graphs construct
for 1 node = 1 labeled graphs construct
so total 11 graphs generates , if Labeled graph taken.
I hope now you cleared doubts.