Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Mathematics and Algorithms > Graphs & Networks > Graph Representation and Properties > EdgeIndex >
Mathematica > Visualization and Graphics > Graphs & Networks > Graph Representation and Properties > EdgeIndex >

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
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF