Change this to:

graph(int n = 0) {

so that we have default constructors... we can still do:

graph g[10];

g[0] = graph(10);