fixed BC bug related to multi-graph. When get multi-graph, will remove the redundant edges first.