Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi and many thanks for reading this question.

I want to create an algorithm that will minimize the total number of ingredients that are in a weekly menu. A menu is made of several recipes, for simplicity let's say 5 recipes. Recipes are randomly selected from a database of many recipes. Each recipe has ingredients that can be identical or different.

  1. I would like your help to modelize this problem so it can be optimized.
  2. If you have any idea of what type of proble this is (NP Complex?) that could also help me going in the right direction.

Thanks for your help.

share|cite|improve this question
What do you mean by modelize? What kind of model are you thinking of? – user99680 Jun 30 '14 at 23:49
I would like to know if there is a Mathematical approach to this problem so I can use it further with Simulated Annealing or a Genetic Algorithm. I can imagine a cost function for a menu where C(M)=Total number of unique ingredients in the Menu. But maybe there is no more than that! I wanted to ask to people good with Math if they see something else there. – codea Jul 1 '14 at 11:13
No. There are no degrees of freedom in your task. This is not an optimization problem. – Adrian Schad Jul 3 '14 at 7:43
up vote 0 down vote accepted
  1. Since recipes are randomly selected, a menu (5 recipes) is also randomly selected from database. Hence, there is no need (or way) to optimize the outcome.

  2. This is not an NP-complex problem. It has complexity O(1), or maybe O(0).

share|cite|improve this answer
1. Like I said in the question comment, I can look into sevral randomly selected outcomes and pick the bests using some algorithms. There could be some optimization there on how I deal with that. Are there Mathematical approaches that you see that could help in this task? – codea Jul 1 '14 at 11:23
I have accepted your answer, but I think my question was not asked properly. Optimization is probably not the good wording in the question. It would be more about finding good candidates with minimal ingredient count. Many thanks for your help. – codea Jul 4 '14 at 14:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.