Simply creates a list, in the same format as the input, of all possible graphs obtained by adding one new edge to the input graph.
G = graph {{1,2},{2,3},{3,4},{4,5},{1,5}}; |
addEdges G |
If the List input format is used, then one should use care as the list may contain isomorphic pairs.