generate graph for new alg