This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

EdgeIndex

EdgeIndex
gives the integer index for the edge e in the graph g.
Find the integer index of an edge:
The index corresponds to the position in the edge list:
Find the integer index of an edge:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
The index corresponds to the position in the edge list:
In[3]:=
Click for copyable input
Out[3]=
EdgeIndex works with undirected graphs:
Directed graphs:
EdgeIndex returns unevaluated if item is not an edge of g:
EdgeIndex works with large graphs:
Compare performance with a direct search in EdgeList[g]:
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:
Try an edge item:
Try a non-edge item:
Use VertexIndex to find the integer index of a vertex:
VertexIndex and EdgeIndex give the row and column ordering used in IncidenceMatrix:
Test whether is incident to :
Some edges do not seem to have integer indices:
Membership is tested using SameQ rather than Equal:
By using identical expressions the integer index is found:
New in 8