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.
i1 : G = graph {{1,2},{2,3},{3,4},{4,5},{1,5}}; |
i2 : addEdges G o2 = {Graph{0 => {1, 2, 4}}, Graph{0 => {1, 3, 4}}, Graph{0 => {1, 4} }, Graph{0 => {1, 4} }, Graph{0 => {1, 4} }} 1 => {0, 2} 1 => {0, 2} 1 => {0, 2, 3} 1 => {0, 2, 4} 1 => {0, 2} 2 => {1, 0, 3} 2 => {1, 3} 2 => {1, 3} 2 => {1, 3} 2 => {1, 3, 4} 3 => {2, 4} 3 => {0, 2, 4} 3 => {1, 2, 4} 3 => {2, 4} 3 => {2, 4} 4 => {0, 3} 4 => {0, 3} 4 => {0, 3} 4 => {1, 0, 3} 4 => {0, 2, 3} o2 : List |
If the List input format is used, then one should use care as the list may contain isomorphic pairs.
The object addEdges is a method function with options.