'How to add an additional edge between nodes that already have edges?

I have a Graph object and between each pair of nodes that already has an edge, I would like to add an additional edge? Is there a way to do this without brute force looping through all the edges?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source