F
F
funkydictator2018-06-11 14:07:28
Algorithms
funkydictator, 2018-06-11 14:07:28

Is there such an algorithm and what is it called?

You need to implement the following solution.
There is a list of products
Each product has a group (breakfast, snack, lunch, dinner)
Each product has a subgroup or category (soups, salads, desserts, sauces, side dishes, main course, drink, fruit, vegetable, cheese, additives, nuts, yogurt, dressing, porridge, butter, bread, legumes, berries)
For each group there are conditions for possible combinations of subgroups (the number of conditions is about 20. That is, subgroups can be created based on one or more of the conditions, and not on the sum of all 20 conditions )
As a result, the algorithm should select combinations of products for each group. For example,
Breakfast: oatmeal, cherry
Snack: toast, avocado, salmon
Lunch: pasta, chicken breast, tomato
Snack: cottage cheese, banana
Dinner: rice, beef, asparagus

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
longclaps, 2018-06-11
@longclaps

There is such an algorithm .

S
Stanislav Pugachev, 2018-06-11
@Stqs

perhaps something like this is needed,
although the task is described by you rather poorly , it is
not entirely clear what exactly you need

A
Alexander, 2018-06-11
@Survtur

This algorithm is called a picker. You can implement, for example, by writing all the conditions manually.

R
Roman Mirilaczvili, 2018-06-12
@2ord

In the PROLOG language, such problems are solved quickly. It is necessary to make a set of predicates by which a solution will be found. Recursively by the iteration method built into the language, if I'm not mistaken.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question