I have been given a question in graph theory recently.
let { a,b,c,d,e } be a set of 5 vertices.
How many different graphs are there, such that there's one and only one vertex with a degree of 4.
Note : we are only dealing with simple graphs.
My suggested solution as follows:
$5*2^{{4 \choose 2}}$ - choosing a vertex with a degree of 4 ( which means that it connects to all of the others). We are left with 4 vertices. The number of graphs we can keep creating are $2^{4 \choose 2}$.
Now we need to get rid of all the graphs that contain more than one vertex with a degree of 4.
From now on I focus only on the 4 vertices which weren't chosen. Note that in order to get another vertex with 4 neighbors, it needs to be connected to the rest of those which weren't chosen.
Let's mark them a1,a2,a3,a4.
Let ai - number of graphs such that vertex ai has exactly 3 neighbors ($1\le$i$\le4$)
by using inclusion-exclusion principle:
$|ai|$ = $4*2^{{3 \choose 2}}$ - choosing the vertex with 3 neighbors. for the other 3 no restrictions.
$|ai \cap aj | = {4 \choose 2}*2^{{2 \choose 2}}$
$|ai \cap aj \cap ak | = 1$ ( the complete graph on 4 vertices, since 3 vertices have 3 neighbors, the last one has 3 neighbors as well.
in total:
$$5*2^{{4 \choose 2}} - [4*2^{{3 \choose 2}}-6*2^{{2 \choose 2}}+1]= 299 $$
hence there are 299 different graphs with 5 vertices such that one and only one vertex has 4 neighbors.
Is that correct? Thanks in advance.