Added unique number generator; now each edge is assigned with a unique index and the redundant edge combination result is eliminated.