function[k]= RandomPick(L,j)
%The inputs are a Laplacian matrix L and a vertex j. The scalar output k
%corresponds to a random vertex to which j is not connected.
[m,n]=size(L);
R=L(j,:);
%R is the j'th row of L.
Y=find(R==0);
%Y is a list of all the indices in R that have zero entries, ie., the
%vertices to which j is not connected.
%Now we look at the number of entries in Y: S.
%Then we pick a random number between 1 and S: B.
%Finally, we choose the B'th entry in Y: k.
%This is one method of choosing a random vertex to which j is not
%connected.
S=size(Y);
B=randi(S,1);
k=Y(B);
end