EdgeAdd

EdgeAdd[g,e]

makes a graph by adding the edge e to the graph g.

EdgeAdd[g,{e1,e2,}]

adds a collection of edges to g.

EdgeAdd[{vw,},]

uses rules vw to specify the graph g.

Details and Options

  • EdgeAdd[g,e] will add the edge e and create a multiple edge if the edge already exists in g.
  • An undirected edge can be specified using vw or UndirectedEdge[v,w].
  • A directed edge can be specified using vw or DirectedEdge[v,w].
  • EdgeAdd works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

Examples

open allclose all

Basic Examples  (1)

Add an edge to a graph:

Scope  (7)

EdgeAdd works with undirected graphs:

Directed graphs:

Multigraphs:

Mixed graphs:

Add a set of edges to the graph:

Use rules to specify the graph:

EdgeAdd works with large graphs:

Introduced in 2010
 (8.0)
 |
Updated in 2014
 (10.0)
2015
 (10.3)