improved Erdős–Rényi random graph generation