EdgeIndex
EdgeIndex[g,e]
gives the integer index for the edge e in the graph g.
EdgeIndex[{vw,…},…]
uses rules vw to specify the graph g.
Details
![](Files/EdgeIndex.en/details_1.png)
- EdgeIndex is also known as edge ordering.
- EdgeIndex gives the ordering used in functions such as EdgeList and IncidenceMatrix.
- EdgeIndex[g,e] gives the position for an edge e in EdgeList[g].
- EdgeIndex[g,e] gives the column position for an edge e in IncidenceMatrix[g].
![](Files/EdgeIndex.en/Image_1.gif)
Examples
open allclose allBasic Examples (1)
Scope (4)
Properties & Relations (5)
The EdgeIndex of an edge corresponds to its position in EdgeList:
Sort the vertices in undirected edges for comparison:
EdgeIndex is typically faster than Position:
EdgeQ can be used to tell whether EdgeIndex will succeed:
![](Files/EdgeIndex.en/2.gif)
Use VertexIndex to find the integer index of a vertex:
VertexIndex and EdgeIndex give the row and column ordering used in IncidenceMatrix:
Text
Wolfram Research (2010), EdgeIndex, Wolfram Language function, https://reference.wolfram.com/language/ref/EdgeIndex.html (updated 2015).
CMS
Wolfram Language. 2010. "EdgeIndex." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/EdgeIndex.html.
APA
Wolfram Language. (2010). EdgeIndex. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EdgeIndex.html