Consider the following scenario:
- Potential customers are presented with a questionnaire where they can select none, one or multiple answers for every question.
- An automated algorithm should recommend the optimal solution based on the customers' answers.
Example:
- There are 3 possible solutions S1, S2, S3
- The questionnaire contains 10 questions Q1, Q2…Q10
- Each question contains a variable number of possible answers where:
- A1.1 is the first answer for question 1.
- A3.2 is the second answer for question 3.
- I want to be able to model the following solutions based on the answers provided by the customer:
- A1.1, A1.3, A2.1, A3.2 => S1
- A1.1, A1.3, A2.2 => S1
- A1.2 => S2
- A2.2 => S2
- A1.1, A3.1, A3.2 => S2
- Any other combination => S3
In summary:
- For given set of answers a solution must be recommended.
- Solutions defined by the smaller number of answers should be preferred over the ones defined by larger number of answers.
I’m looking for an existing algorithm (and data model) for the problem presented above instead of attempting to write my own from scratch.