Check for duplicate edges in graph