EdgeLabels
is an option and annotation for Graph and related functions that specifies what labels and label positions should be used for edges.
Details

- The following option settings can be used:
-
None use no edge labels "Index" use the edge index as a label "Name" use the edge name as a label "EdgeWeight" use the edge weight as a label "EdgeTag" use the edge tag as a label {vivj->lblij,…} label edge vivj with lblij etc. {pattilbli,…} use lbli for edges matching the pattern patti - The wrapper Labeled[vivj,lbl] is equivalent to Annotation[vivj,EdgeLabels->lbl] and can be used when creating graphs in functions such as Graph etc.
- Labeled[vivj,lbl,pos] and Placed[lbl,pos] can be used to place labels along an edge.
- The following positions pos can be used for Labeled and Placed in positioning edge labels:
-
Tooltip,StatusArea show as tooltip or in status area on mouseover "Start","Middle","End" place label at start, middle, or end {Left,pos},{Right,pos} place label left or right of the edge at symbolic position {s,{lx,ly}} scaled position {lx,ly} in the label at scaled position s along the edge - The scaled position
along the edge curve represents the fraction of the total length: e.g.
places the edge label at the halfway point.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Scope (14)Survey of the scope of standard use cases
Label Specification (10)

https://wolfram.com/xid/09bszj52e-co0g0

https://wolfram.com/xid/09bszj52e-hr4015


https://wolfram.com/xid/09bszj52e-i6o22


https://wolfram.com/xid/09bszj52e-yott64


https://wolfram.com/xid/09bszj52e-otg87r

EdgeLabels can be used for general graphs:

https://wolfram.com/xid/09bszj52e-w9j3f


https://wolfram.com/xid/09bszj52e-fi80b1


https://wolfram.com/xid/09bszj52e-xwdja


https://wolfram.com/xid/09bszj52e-kjdxrt

Use EdgeLabels in an Annotation wrapper:

https://wolfram.com/xid/09bszj52e-f4jo2s


https://wolfram.com/xid/09bszj52e-earmxu

Alternatively, use a Labeled wrapper:

https://wolfram.com/xid/09bszj52e-nmuw

EdgeLabels works with patterns:

https://wolfram.com/xid/09bszj52e-64pi0q

Label Placement (4)
Use Placed with symbolic locations to control label placement along an edge:

https://wolfram.com/xid/09bszj52e-fnltmw

Use explicit coordinates to place labels:

https://wolfram.com/xid/09bszj52e-ndfa94


https://wolfram.com/xid/09bszj52e-bg84f5

Place multiple labels using Placed in a wrapper:

https://wolfram.com/xid/09bszj52e-cj2dt

Any number of labels can be used:

https://wolfram.com/xid/09bszj52e-dy5run

Place multiple labels using EdgeLabels:

https://wolfram.com/xid/09bszj52e-33q72

Use automatic labeling by values through Tooltip and StatusArea:

https://wolfram.com/xid/09bszj52e-dhn5kr


https://wolfram.com/xid/09bszj52e-bd54a9

Possible Issues (1)Common pitfalls and unexpected behavior
Using Rule to indicate edges does not work:

https://wolfram.com/xid/09bszj52e-crp5pc

Use parentheses to get correct parsing:

https://wolfram.com/xid/09bszj52e-bue20b


https://wolfram.com/xid/09bszj52e-m04fnn


https://wolfram.com/xid/09bszj52e-mh35n

Wolfram Research (2010), EdgeLabels, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeLabels.html (updated 2020).
Text
Wolfram Research (2010), EdgeLabels, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeLabels.html (updated 2020).
Wolfram Research (2010), EdgeLabels, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeLabels.html (updated 2020).
CMS
Wolfram Language. 2010. "EdgeLabels." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/EdgeLabels.html.
Wolfram Language. 2010. "EdgeLabels." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/EdgeLabels.html.
APA
Wolfram Language. (2010). EdgeLabels. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeLabels.html
Wolfram Language. (2010). EdgeLabels. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeLabels.html
BibTeX
@misc{reference.wolfram_2025_edgelabels, author="Wolfram Research", title="{EdgeLabels}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeLabels.html}", note=[Accessed: 29-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_edgelabels, organization={Wolfram Research}, title={EdgeLabels}, year={2020}, url={https://reference.wolfram.com/language/ref/EdgeLabels.html}, note=[Accessed: 29-March-2025
]}