function [B] = wws_greedy_maximum_violating_pair(X,G,n,r,P)
P = min(n,P);
max_val = -inf;
B = [1;2];
test_time = 0;
while (test_time<P)
    i_test = randperm(n,1);
    j_test = randperm(n,1);
    if(i_test==j_test),continue;end
    Dij = X(i_test,:)*G(j_test,:)' - G(i_test,:)*X(j_test,:)';
    Dij = abs(Dij);
    if(Dij>max_val)
        max_val = Dij;
        B = [i_test;j_test];
    end
    test_time = test_time + 1;
end