Code covered by the BSD License  

Highlights from
Recognizing Far-Near Relations of Clusters by GDEM, Visualization by Line-Pearl Pattern

image thumbnail
from Recognizing Far-Near Relations of Clusters by GDEM, Visualization by Line-Pearl Pattern by Kaijun Wang
measure far-near degrees (distances) between clusters & dense degrees of border regions of clusters

border_points(Dm,A,B,N)
function [Ra,na] = border_points(Dm,A,B,N)
% finding N points in group A that are nearest to B
% the 1st point in Ra is the nearest to B, and so on

Ra=[];
for j=1:N
  [Q,R]=min(Dm(A,B));
  if length(Q) > 1
     [Q,k] = sort(Q);
     R = R(k); 
     [Q,S]= sort(R);
     k = [1 diff(Q)];
     k = find(k);
     [Q,k] = sort(S(k));
     k = R(Q);
     R=A(k); 
  else
     R = A;
  end
  Ra=[Ra;R];                     % nearest elements in A near B
  na=length(Ra);
  if na >= N
      Ra=Ra(1:N);
      na=N;
      break;
  end
  A=setdiff(A,Ra);
end

Contact us