graph generator using input graph