change to sparse graph generation