I can store any undirected simple graph N vertices using $b = (N-1)N/2$ bits, by creating a mask of the edges on the upper diagonal of the adjacency matrix. For example the adjacency matrix of $K_3$ is
$$ A = [[0,1,1],[1,0,1],[1,1,0]] $$
which can be stored as the bit-mask $011101110$ or as an integer in base-10 as $238$. In general, this number isn't unique (due to graph isomorphisms) but it doesn't matter for my purposes. From a practical standpoint, this means I can store graphs up to $N=11$ in a database using a 64-bit integer.
My question now involves trees, which are considerably more edge-sparse. Is there a mapping scheme that can allow me to store (and quickly reconstruct) trees $N>11$ using a single 64-bit integer?