function [y1, y2] = Find_rank(N,x,D,c)
A = zeros(N^2/2,2*N);
eq = 1;
for i = 1:N
  for j=i:N
  if (D(i,j)>=c)
    A(eq, i) = 1;
    A(eq, j) = 1;
    A(eq, N+i) = x(j);
    A(eq, N+j) = x(i);
    eq = eq+1;
  end
  end
end
A(eq,(N+1):(2*N)) = 1;
A_cut = A(1:eq,:);

y1=rank(A_cut);
%Share of imposed restrictions
y2=eq/( N*(N-1)/2);
end