Refs #17059; sort the relations result only within forward_backward method in order to avoid waisted computation