remove the duplicated nodes in both data and control graphs