EdgeIndex
EdgeIndex[g, e] gives the integer index for the edge e in the graph g.
Examples
Get edge index:
g = Graph[{a -> b, b -> c, c -> d}];
EdgeIndex[g, b -> c]
(* 2 *)Use with edge list:
EdgeIndex[CompleteGraph[4], 1 <-> 3]Please visit the official Wolfram Language Reference for more details.