%%% Random Graphs clc format compact format short g % Fixes the Random Number System % Comment out the next line to change the output rand('state',357) %% A small graph n=10; % # of Vertices p=0.45; % Probability of Connection A=rand(n); A=(A+A')/2; p1=sqrt(p/2); B = (A0); [1:n;sum(B);sum(C1)]' W=10*rand(n)+0.5; Weights=round((W+W')/2); D = Weights.*B1 %% A larger random graph n=100; % # of Vertices p=0.04; % Probability of Connection A=rand(n); A=(A+A')/2; p1=sqrt(p/2); B = (A0); [1:n;sum(B);sum(C2)]'