What is an algorithm that can find the best possible matches given a set of data. I have read up on stable roommates problem and or stable marriage problems. However, from my understanding, these type of algorithms only output a specific match (pairings) and not a set of possible matches. For example, say we have a group of users each with a desire to trade one particular fruit for another.
 - Has/Have
() - Wants
User 1: [Apples, Bananas] (Grapes) User 2: [Bananas, Grapes, Peaches] (Apples) User 3: [Grapes, Oranges] (Bananas) User 4: [Mango, Pineapple] (Strawberry) User 5: [Raspberry] (Pineapple) User 6: [Pineapple] (Raspberry)
In this scenario, matches should be (->)
User 1 -> (User 2 and User 3) User 2 -> (User 1) User 3 -> (User 1) User 4 -> None User 5 -> (User 6) User 6 -> (User 5)
Irving's algorithm requires that a solution have a unique pairing. What is an algorithm that could give me a solution set like above?