I'm trying to find the best way to determine how similar a group of items (in this example; ingredients in a guacamole recipe) is to all groups of items (recipes in a table; linked to another table of ingredients).
For instance; I have the following guacamole recipe:
3 Avocados
1 Vine-Ripened Tomatoes
1 Red Onion
3 Jalapenos
1 Sea Salt
1 Pepper
I want to run this recipe through the table of all my recipes to determine if there is another recipe that is similar to it (based on ingredients and count), order by how similar it is. Additionally, I would like it to identify the differences (whether it's just the difference in count of ingredient; or a different in ingredient).
A possible output would be:
3 Avocados
(- 1 Vine-Ripened Tomatoes)
1 Red Onion
3 Jalapenos
1 Sea Salt
(- 1 Pepper)
(+ Tobasco)
89.5% Identical
This could also be used to determine the following use case: "Given a list of ingredients in my refrigerator; what can I make to eat?".
Thanks for any assistance in pointing me in the right direction.