%% Locate Edges with Specified End Nodes
% Create a graph, and then determine the edge index for the (1,2) and (3,5) edges.

s = [1 1 2 2 2 3 3 3];
t = [2 3 3 4 5 6 7 5];
G = graph(s,t)

%

idxOut = findedge(G,[1 3],[2 5])

% idxOut contains the row index into G.Edges.EndNodes for each specified edge.
% Copyright 2015 The MathWorks, Inc.