Mathematician use this algorithm to select a romantic partner.