n = 100;
rand('seed',10);
[A,xy] = randgeom(n); A = spones(A);
clf;
gplot(A,xy,'.-'); axis off; 
%%
L = diag(sum(A)) - A; % construct the Laplacian of A
S = speye(n) - 1/25*L;
b = zeros(n,1); b(1) = 10; b(15) = -10;
b(find(A(1,:))) = 10; b(find(A(15,:))) = -10;
%%
[x hist_rich] = richardson(S,b,'verbose',1);
%%
gplot(A,xy,'-'); axis off; hold on;
scatter(xy(:,1),xy(:,2),25,x,'Filled');
plot(xy(1,1),xy(1,2),'rx',xy(15,1),xy(15,2),'rx','MarkerSize',18);
colormap;