How to find the Laplacian Matrix with Network, please

2 views (last 30 days)
Hi Dear
If we difine L_{ij} of the graph Laplacian are defined by L_{ij} = A_{ij}- k_i delta_{ij}, where A is the adjacency matrix, k_{i} is the degree of node i, delta_{ij} is the Kronecker delta, and where we do not sum over repeated indices.
N=200;L=100; coverage_range=20;
% random coordination
distinct_BOUND = 5;
P = zeros(N,2);
% rand(1,2)<0.05;
Q = rand(1,2)*L;
P(1,:) = Q;
for j = 2:N
u = true;
m = false;
while u || m
Q = rand(1,2)*L ;
% u is true if new added node is too far to all node
u = true;
for i = 1:j-1
if pdist([Q;P(i,:)],'euclidean') < coverage_range
%D = pdist(X) returns the Euclidean distance between pairs of observations in X.
u = false;
end
end
% m is true if new added node is too near to one node
m = false;
for i = 1:j-1
if pdist([Q;P(i,:)],'euclidean') < distinct_BOUND
m = true;
end
end
end
P(j,:) = Q;
end
figure;
OP=gscatter(P(:,1),P(:,2));
r = sprintf('N-%d,L-%d, cr-%d nodes', N, L, coverage_range);
could you help me to find Laplacian, I use Laplacian() but it didn't work, please

Answers (0)

Categories

Find more on Numeric Types in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!