merge for nodes and edges with partition information