traverses the row for individual in mpref or wpref until person or individual's mate is found and returns true only if person is found first

while(next != person && next != individualsmate)

{

index++;

next = pref[individual][index];

}