EdgeList
Examples
open all close allBasic Examples (3)
The edge list for an explicitly constructed graph:
Graph[{ab, bc, ca}]EdgeList[%]The edge list for a parametrically constructed graph:
EdgeList[[image]]Find all edges that match a pattern:
EdgeList[[image], 1_]Scope (5)
EdgeList works with undirected graphs:
EdgeList[[image]]EdgeList[[image]]Use rules to specify the graph:
EdgeList[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}]Use a pattern to select a subset of edges:
g = Graph[{12, 21, a1, a2, b1, b2, bb}]EdgeList[g, _Integer_]EdgeList[g, a_ | b_]EdgeList works with large graphs:
g = GridGraph[{10, 10, 10, 10}];Timing[EdgeList[g]//Length]Applications (1)
Properties & Relations (5)
EdgeCount can be found using EdgeList:
g = CompleteGraph[5]EdgeCount[g]Length[EdgeList[g]]Edges in EdgeList are given in the same order they are entered for Graph:
g = Graph[{23, 12, 31, 41}]EdgeList[%]Columns of the incidence matrix correspond to EdgeList:
g = CompleteGraph[4]EdgeList[g]TableForm[Normal@(m = IncidenceMatrix[g]), TableHeadings -> {VertexList[g], Style[#, Red]& /@ EdgeList[g]}]Edges can be explicitly specified in Graph:
Graph[{ab, bc, ca}]EdgeList[%]TreeGraph[{ab, ac, ad}]EdgeList[%]PathGraph[{ab, bc, cd}]EdgeList[%]A connected graph can be reconstructed from its edge list:
CompleteGraph[7]EdgeList[%]Graph[%]Related Guides
Text
Wolfram Research (2010), EdgeList, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeList.html (updated 2015).
CMS
Wolfram Language. 2010. "EdgeList." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/EdgeList.html.
APA
Wolfram Language. (2010). EdgeList. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeList.html
BibTeX
@misc{reference.wolfram_2026_edgelist, author="Wolfram Research", title="{EdgeList}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeList.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_edgelist, organization={Wolfram Research}, title={EdgeList}, year={2015}, url={https://reference.wolfram.com/language/ref/EdgeList.html}, note=[Accessed: 13-June-2026]}