There are people and the food they prefer:
John -20> Apple
John -10> Pear
Ethan -20> Apple
Ethan -5> Orange
Michael -10> Pear
Michael -10> Limon
The numbers indicate how strongly they prefer the respective food.
i.e. John likes Apple more than Pear (20 > 10). And so for everyone.
The task is to distribute food to absolutely all people, trying to give the most preferred food as much as possible.
Expected result:
John -10> Pear
Ethan -20> Apple
Michael -10> Limon
S = 10 + 20 + 10 = 40
But if so:
John -20> Apple
Ethan -5> Orange
Michael -10> Pear
S = 20 + 5 + 10 = 35 (<40 — not expected result)
With different initial data, there may be several solutions with the same maximum S.
These solutions must be kept without discarding.
(1) What kind of task is this and (2) What algorithm should be applied?