next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Nauty :: addEdges

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 : R = QQ[a..e];
i2 : addEdges cycle R

o2 = {Graph{edges => {{a, b}, {a, c}, {b, c}, {c, d}, {a, e}, {d, e}}},
            ring => R                                                  
            vertices => {a, b, c, d, e}                                
     ------------------------------------------------------------------------
     Graph{edges => {{a, b}, {b, c}, {a, d}, {c, d}, {a, e}, {d, e}}},
           ring => R                                                  
           vertices => {a, b, c, d, e}                                
     ------------------------------------------------------------------------
     Graph{edges => {{a, b}, {b, c}, {b, d}, {c, d}, {a, e}, {d, e}}},
           ring => R                                                  
           vertices => {a, b, c, d, e}                                
     ------------------------------------------------------------------------
     Graph{edges => {{a, b}, {b, c}, {c, d}, {a, e}, {b, e}, {d, e}}},
           ring => R                                                  
           vertices => {a, b, c, d, e}                                
     ------------------------------------------------------------------------
     Graph{edges => {{a, b}, {b, c}, {c, d}, {a, e}, {c, e}, {d, e}}}}
           ring => R
           vertices => {a, b, c, d, e}

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.