Given a set of $n$ vertices and the fact that none of them is of degree greater than $2$, how many distinct such graphs are there?



Number of graphs on a given set of vertices with maximum degree of $2$
This is [OEIS A003292 Number of 4-line partitions of n decreasing across rows](https://oeis.org/A003292).



> 
> a(n) is the number of unlabeled graphs on n nodes whose connected components are a path or a cycle. - Geoffrey Critzer, Nov 28 2011
> 
> 
> 


OEIS gives generating function and references which may contain additional information.



```
G.f.: Product (1 - x^k)^-{c(k)}; c(k) = 1, 1, 2, 2, 2, 2, ....

```

