%% Simplify Multigraph to Simple Graph
% Create a weighted, undirected multigraph with several edges between node 1 and node 2.

G = graph([1 1 1 1 2 3],[2 2 2 3 3 4], 1:6);
G.Edges

%
% Simplify the multigraph into a simple graph, such that there is only one edge between node 1 and node 2. simplify keeps the first edge between those two nodes, G.Edges(1,:), and drops the others.

G = simplify(G);
G.Edges

% Copyright 2012 The MathWorks, Inc.