This works for your sample data set (which does not include nodes 12:14 as shown in the plot. Please test test this, I'm not a graph theory expert so there may be cases where this does not work.
M = [1 2; 2 3; 1 3; 4 5; 5 6; 6 7; 4 7;2 4; 5 7; 5 8;11 8; 8 9; 9 10; 10 11];
g = graph(M(:, 1), M(:, 2));
h = plot(g);
bcg = biconncomp(g).';
[count, group] = groupcounts(bcg);
edgeidx = ismember(bcg, group(count==1));
g.Edges(edgeidx, 1)
ans =
2×1 table
EndNodes
________
2 4
5 8
Best Answer