function G = albert(N)

G = zeros(N);

% construct initial 3 node graph
G(1:3,1:3) = [0 1 1; 1 0 1; 1 1 0];

for i = 4:N
   sums = sum(G(1:i-1,1:i-1));
   allsum = sum(sums);
   prob = sums/allsum;
   newEdges = rand(1,i-1) < prob;
   G(i,1:i-1) = newEdges;
   G(1:i-1,i) = newEdges';
end


end

