% ShowRandomLinks
n = 100;  % No. of web pages
A = RandomLinks(n);
close all
figure
axis equal square off
hold on

% n webpages laid out around a circle
[x, y] = CirclePoints(n);
plot(x, y, 'ko')

% Use link matrix A to connect appropriate pages (points)
for i=1:n
    for j=1:n
        if A(i,j)==1  % there is a link to page i from page j
           xmid = (x(i) + x(j)) / 2;
           ymid = (y(i) + y(j)) / 2;
           plot ([x(j), xmid], [y(j), ymid], 'k')
           plot ([xmid, x(i)], [ymid, y(i)], 'r')
        end
    end
end
shg

