The comments in Optimisation of food items problem - how do I find the cheapest combination? and Optimisation / linear programming: can I specify combinatorial constraints? have been very helpful.
To recap: I have P number of food items to choose from, and my objective is to minimise cost ie find the quantities of each of these food items (say in grams) that I should be buying (and consuming) such that my cost is minimised, subject to the constraint that these food items fulfil my nutritional needs. I have found this is by and large a linear programming problem.
However, my problem has now evolved into one in which I have to take into account that I need combinations of food items that are different day to day so I don't get bored. I do not mind my menu recurring as long as it is not recurring every day, so I can set it say to 7 different combinations of food, 1 for 1 day of the week. Hence I now have P X Q variables where P is the number of food items to choose from and Q is the number of days.
How then do I formulate a constraint such that the combinations of food for each day are different any other day? Note that the combinations, not just the quantity, should be different eg.
where yi refers to Food Item i out of P Food Items
This should not be allowed: 5y1+4y18 for Day 1, 2y1+13y18 for Day 2. Even though they are different quantities, the exact same few products are chosen for both days.
However, mixing and matching with some of the products remaining the same are ok, so: 5y1+4y18 for Day 1, 2y1+13y2 for Day 2. Even though Product 1 is chosen for both days.
I am now using Gurobi and AMPL to do this, so any answer that can be specified in AMPL or in the interfaces of Gurobi will be greatly appreciated. However, if this is not possible, this is also ok.