mp3: Corrections

This commit is contained in:
Claudio Maggioni 2020-10-28 14:04:35 +01:00
parent aa9eb03131
commit 7690f4b23d
6 changed files with 11 additions and 9 deletions

Binary file not shown.

View file

@ -74,7 +74,7 @@ for c = 1:nc
A = params.Adj;
coords = params.coords;
W = A - diag(diag(A));
W = A;
% 2. Recursive routines
% i. Spectral

View file

@ -1,4 +1,4 @@
function [part1,part2] = bisection_inertial(A,xy,picture)
function [part1,part2] = bisection_inertial(A,xy,picture)
% INERTPART : Inertial partition of a graph.
%
% p = inertpart(A,xy) returns a list of the vertices on one side of a partition
@ -20,7 +20,7 @@ function [part1,part2] = bisection_inertial(A,xy,picture)
% Steps
% 1. Calculate the center of mass.
m = sum(xy, 1) / size(xy, 1);
m = sum(xy, 1) ./ size(xy, 1);
xm = m(1);
ym = m(2);

View file

@ -18,9 +18,9 @@ function [part1,part2] = bisection_spectral(A,xy,picture)
% Steps
% 1. Construct the Laplacian.
[i, j, ~] = find(triu(A));
G = graph(i, j);
L = laplacian(G);
D = diag(sum(A, 1));
W = -1 .* A;
L = D + W;
% 2. Calculate its eigensdecomposition.
[V, ~] = eigs(L,2,'smallestabs');

View file

@ -7,6 +7,8 @@ addpaths_GP;
[W4,c4] = gridt(40);
[W5,c5] = grid9(30);
global W
global c
W = {W1, W2, W3, W4, W5, Smallmesh, Tapir, Eppstein};
c = {c1, c2, c3, c4, c5, Smallmesh_coords, Tapir_coords, Eppstein_coords};
@ -24,8 +26,8 @@ function runtest(implementation)
global W
global c
for i=1:8
out = implementation(W{i}, c{i});
ne = cutsize(W{i},out);
[part1, ~] = implementation(W{i}, c{i});
ne = cutsize(W{i},part1);
fprintf('%d\t', ne);
end
fprintf('\n');

View file

@ -11,4 +11,4 @@ bisection_spectral(Smallmesh, Smallmesh_coords, 2);
figure;
bisection_spectral(Eppstein, Eppstein_coords, 2);
%matlab2tikz( '../../ex3_eppstein.tex');
%matlab2tikz('../../ex3_eppstein.tex');