Number of different graphs

83 Views Asked by At

How many different graphs exist with $n$ vertices? $$$$ And how many with $n$ vertices and $k$ edges? $(0 \leq k \leq n)$

$$$$ For example the different graphs with $3$ vertices are: enter image description here

1

There are 1 best solutions below

6
On

There are ${n \choose 2}$ "slots" for the edges to go in. Each of these "slots" can either have an edge, or not an edge. So there are $2$ choices for each slot, which means the total number of graphs on $n$ distinct vertices is $$ 2^{n \choose 2}. $$

To find the number of graphs with exactly $k$ edges, you just need to pick $k$ slots out of the ${n \choose 2}$ slots available.