Saturday, 11 February 2023

Meal plan algorithm closesest to x calories with types

I have a problem where i need to generate a meal plan with:

  • x ammount of meals per day (eg. 5)
  • there should be x ammount of meal types in the plan (eg. 2 brekfasts, 2 snacks and 1 lunch)
  • calories in meal plan (eg. 2000)
  • There should be no duplicate meals in the output

the data given is a list of dictionaries (over 100,000 units) structured in this way:

{'title': 'Cannellini Bean and Asparagus Salad with Mushrooms', 'types': ['side dish', 'lunch', 'main course', 'salad', 'main dish', 'dinner'], 'calories': 482}

the output of the algorithm should be a list of x meals closest to the x calories, with the defined meal types and their ammounts.

I have no idea where to start with this problem, any alogrithm type or impementation is welcome.



from Meal plan algorithm closesest to x calories with types

No comments:

Post a Comment