Macaulay2 » Documentation
Packages » Nauty :: 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

- Usage:
    `Ll = addEdges L`
    `Lg = addEdges G`
    `Ls = addEdges S`
- Inputs:
  - L, a list, containing graphs in various formats
  - S, a string, which describes a graph in Graph6 or Sparse6 format
  - G, a graph,
- Optional inputs:
  - MaxDegree => an integer, default value null, the maximum degree allowable for any vertex in the output graphs
  - NoNew3Cycles => a Boolean value, default value false, whether graphs with new 3-cycles are allowed
  - NoNew4Cycles => a Boolean value, default value false, whether graphs with new 4-cycles are allowed
  - NoNew5Cycles => a Boolean value, default value false, whether graphs with new 5-cycles are allowed
  - NoNewOddCycles => a Boolean value, default value false, whether graphs with new odd-cycles are allowed
  - NoNewSmallCycles => an integer, default value null, an upper bound on cycles which are not allowed
- Outputs:
  - Ll, a list, the list of graphs obtained from the graphs in $L$ in Graph6 format
  - Lg, a list, the list of graphs obtained from $G$
  - Ls, a list, the list of strings (in Graph6 format) obtained from $S$

## 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

- removeEdges -- creates a list of graphs obtained by removing one edge from the given graph in all possible ways

## Ways to use addEdges:

- `addEdges(Graph)`
- `addEdges(List)`
- `addEdges(String)`

## For the programmer

The object addEdges is a method function with options.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Nauty.m2:598:0.