Resource and structure the data
Two large data frames feed the model. The first maps every ingredient to its nutritional profile, protein, carbohydrates, fat and and calories per 100g, together with its retail prices drawn from multiple competing retailers so that the solver can identify the cheapest compliant source for each ingredient. The second is a structured recipe universe: per-portion ingredient lists, meal types (breakfast, lunch, dinner), food categories and cooking instructions. National food composition databases or the comprehensive Nutrition Coordinating Center Food & Nutrition Database (NCCDB) at the University of Minnesota, containing over 17'000 foods with lab-analyzed data on more than 70 nutrients, can be used.
Translate the legal question into an objective function
The legal question, what is the minimum cost of adequate nutrition for one person over seven days?, becomes the MILP objective function: minimize the sum of ingredient costs subject to nutritional constraints, portion logic, diversity requirements and meal weight bounds. Binary variables track whether each recipe is selected for each meal slot. Continuous variables control portion scaling. The Branch-and-Cut algorithm finds the global minimum, not a heuristic approximation, within a set solve window, making the result reproducible and court-presentable.

Compute
With the objective function and all constraints assembled into a single problem object, the CBC Branch-and-Cut solver is invoked. It does not try combinations at random. It systematically partitions the solution space, branching on binary recipe-selection variables, tightening bounds with cutting-plane inequalities at each node, until it can prove that no feasible solution with a lower cost exists. The result is not a good answer. It is the best possible answer, with a mathematical certificate of optimality attached.