fix for edge cmp and spanning tree