# addEdge -- A method for adding edges to a graph

## Synopsis

• Usage:
H = addEdges' (G, L)
H = addEdge (G, S)
• Inputs:
• G, an instance of the type Graph,
• L, a list, This List should be composed of other Lists, just as one would input an edge set
• S, a set, This is used when only one edge needs to be used via addEdge
• Outputs:
• H, an instance of the type Graph, The Graph with the new edge

## Description

This method will take in a Graph and a List of new edges, and output a graph with these new edges along with the previous edges.

 i1 : H = cycleGraph 4; i2 : G = addEdge(H, set {0,2}) o2 = Graph{0 => {1, 2, 3}} 1 => {0, 2} 2 => {0, 1, 3} 3 => {0, 2} o2 : Graph i3 : G = addEdges'(H, {{0,2},{3,1}}) o3 = Graph{0 => {1, 2, 3}} 1 => {0, 2, 3} 2 => {0, 1, 3} 3 => {0, 1, 2} o3 : Graph

## See also

• addVertices -- A method for adding a set of vertices to a graph

## Ways to use addEdge :

• "addEdge(Digraph,Set)"

## For the programmer

The object addEdge is .