makerandomgraph function