EdgeAdd
Details and Options
- EdgeAdd is also known as edge insertion or edge creation.
- 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 all close allScope (7)
EdgeAdd works with undirected graphs:
EdgeAdd[[image], 56]EdgeAdd[[image], 56]EdgeAdd[[image], 56]EdgeAdd[[image], 56]Add a set of edges to the graph:
EdgeAdd[[image], {14, 56}]Use rules to specify the graph:
EdgeAdd[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}, 56]EdgeAdd works with large graphs:
g = GridGraph[{10, 10, 10, 10}];Timing[h = EdgeAdd[g, 1100];]EdgeCount /@ {g, h}See Also
Related Guides
Text
Wolfram Research (2010), EdgeAdd, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeAdd.html (updated 2015).
CMS
Wolfram Language. 2010. "EdgeAdd." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/EdgeAdd.html.
APA
Wolfram Language. (2010). EdgeAdd. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeAdd.html
BibTeX
@misc{reference.wolfram_2026_edgeadd, author="Wolfram Research", title="{EdgeAdd}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeAdd.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_edgeadd, organization={Wolfram Research}, title={EdgeAdd}, year={2015}, url={https://reference.wolfram.com/language/ref/EdgeAdd.html}, note=[Accessed: 13-June-2026]}