generalized graph generation