Bijective coding of general graphs (like Prüfer code but not for trees)

76 Views Asked by At

I'am trying to find some way to effectively enumerate all possible graphs without repetition. I know there are Prüfer codes for trees, but what about other graphs? And if there is some coding, are there also codings for directed graphs or multigraphs? It would be ideal if all isomorphic graphs had the same code.

1

There are 1 best solutions below

2
On BEST ANSWER

As pointed out by @EthanBolker, the problem of describing all graphs upto isomorphism is not even known to be NP-hard. But, in case you want to just enumerate the number of graphs of order $n$, then as the graphs are nothing but binary non-reflexive, symmetric relations on a set of $n$ elements, their number is $2^{\frac{n(n-1)}{2}}$. As for directed graphs, since these needd not be symmetric, therefore, we have their number of $n$ vertices equals $2^{n(n-1)}$. Also see here