add flatten graph