Sanjay K.

asked • 05/06/22

Which polynomial time algorithm would you use to solve this if there is one to solve?

A group of m primary students is given a list of n foods offered by the cafeteria. Each student is asked to write down their 2 favorite foods. Each student must write exactly two food preferences. The cafeteria would like to select at most k students to represent the school at the food fair. The students must be chosen in such a way that each of the n foods is a selected preference of at least one of the k students.

Using the same input as above, suppose now we wish to select at most k food options to put on the school menu in such a way that every child has at least one of their preferences on the menu.


1 Expert Answer

By:

Nicholas V. answered • 03/05/23

Tutor
4.9 (52)

Computer Science Expert

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.