filter relation array in get_patch to discard self loop relationships