set max attempts to regenerate graph to 5