I'm trying to create Geometric random graph and here is my code I wrote that is not done yet.
% code
n = input('Enter number of nodes: ');x=[];y=[];d=[];x = rand(1,n);y = rand(1,n);for i = 1 : (n) for j = 1 : (n) d(i, j) = sqrt((x(i) - x(j)) ^ 2 + (y(i) - y(j)) ^ 2); //finding distance of each nodes endendR=0.3; //radius edge = d <= R ;
I'm trying to find if the nodes are connected or not but I don't have any idea what I can use to find the answer. Please help.
Best Answer