in reply to Gift Exchange Code

Maybe Algorithm::Pair::Best, with a scoring function that assigns huge negative scores to ‘unpairables’?