%% Edge List Construction with Extra Nodes
% Create a weighted graph using a list of the end nodes of each edge. Specify that the graph should contain a total of 10 nodes.

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

%
% Plot the graph. The extra nodes are disconnected from the primary connected component.

plot(G)

% Copyright 2015 The MathWorks, Inc.