I got this qustion in a test, the answer says N * 2^((N-1)*(N-2)/2), because for each of the N vertices, it calculates the number of undirected graphs with N-1 vertices. But I think this answer is wrong. For N=3 it results 6, when, in fact, only 4 out of the 8 possible graphs have at least one isolated vertex. So, am I wrong? What is the correct formula?
Asked
Active
Viewed 481 times
1
-
I tried answering this but couldn't quite get there in time. The short version: you are absolute right. Where this formula goes wrong is that it counts the graph with no edges and three isolated vertices, three times: once for each isolated vertex. You will need to figure out how to avoid counting the same graph multiple times. Perhaps you could try to find an expression for the number of graphs with EXACTLY k isolated vertices, then sum from 1 to N to get your answer. – Patrick87 Jan 29 '21 at 21:16
-
Thank you for your answer! I also thought of finding a formula for a graph with **exactly 0 isolated vertices** in order to substract it from the total number of graphs. But I don't know how to do that either :) – Stefania Dumitru Jan 30 '21 at 19:44
-
Yes, it is not obvious how to approach that. Counting connected graphs might be related enough to be helpful here. Maybe break graphs into connected subgraphs and count that way? For example, N = 3 can be composed as 3, 2+1 and 1+1+1; there are 1, 3 and 1 ways, respectively to decompose the nodes like that; and 4 in total contain subgraphs of size one node. If you can count connected graphs on k vertices, this idea should work. Humorously: the expression from the test claims 32 graphs on four vertices with an isolated vertex, but there are only 16 graphs on four vertices. – Patrick87 Jan 31 '21 at 17:37
-
... based on the answer here, I am not sure we are going to get a nice closed-form answer to your problem... since I am pretty sure the real answer to your problem is pretty closely related to this, based on my last comment: https://math.stackexchange.com/questions/1785730/how-many-connected-simple-graphs-are-on-n-vertices – Patrick87 Feb 01 '21 at 13:15
-
I think this is the sequence you are looking for: https://oeis.org/A327367 – BufferSpoofer Jun 18 '21 at 17:06