merge both graphs into one