Macaulay2 » Documentation
Packages » NautyGraphs :: addEdges
next | previous | forward | backward | up | index | toc

addEdges -- creates a list of graphs obtained by adding one new edge to the given graph in all possible ways

Synopsis

Description

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}   },
            1 => {0, 2}            1 => {0, 2}            1 => {0, 2, 3}  
            2 => {1, 0, 3}         2 => {1, 3}            2 => {1, 3}     
            3 => {2, 4}            3 => {0, 2, 4}         3 => {1, 2, 4}  
            4 => {0, 3}            4 => {0, 3}            4 => {0, 3}     
     ------------------------------------------------------------------------
     Graph{0 => {1, 4}   }, Graph{0 => {1, 4}   }}
           1 => {0, 2, 4}         1 => {0, 2}
           2 => {1, 3}            2 => {1, 3, 4}
           3 => {2, 4}            3 => {2, 4}
           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.

See also

Ways to use addEdges :

For the programmer

The object addEdges is a method function with options.