function viewmcl(a,xy,m)
% function viewmcl(a,xy,m)
%
% view the graph, and directed edges for the links

javaaddpath java
import bfsShad.*;

figure(1)
clf
hold on

[x,y] = gplot(a,xy);
plot(x,y,'-','Color',[.9 .9 .9])

ac = find(diag(m) > .001);
hold on; 

m = round(1000*m)/1000;
[mi,mj,mv] = find(m);

u = unique(mv);
u = u(u > 0);
colors = hsv(length(u));

hold on

for i = 1:length(u),
  ind = find(mv == u(i));
  
  y = [xy(mi(ind),2), xy(mj(ind),2), NaN*ones(length(ind),1)]
  y = y';
  y = y(:);
  
  x = [xy(mi(ind),1), xy(mj(ind),1), NaN*ones(length(ind),1)]
  x = x';
  x = x(:);
  
  plot(x,y,'-','Color',colors(i,:),'LineWidth',2);
end

plot(xy(ac,1),xy(ac,2),'ro','MarkerFaceColor','k','MarkerSize',10);




%for i = 1:length(mv),
%    h = plot(xy([mi(i), mj(i)],1), xy([mi(i), mj(i)],2),'b-');
%end


