We define two useful functions; the "polya" function produces the cycle index for the graphs on $n$ vertices.
Now we can compute the cycle index for $n=4$ as in the example above.
Then we can get the inventory:
And we get the total number of graphs by substituting 1 for $i$ in the inventory.