remove duplicate edges