Question: Question 2 : The Good Host . . . You are hosting a party for ( n ) people ( indexed (
Question : The Good Host
You are hosting a party for n people indexed ldots n and you have booked two banquet halls. As it turns out, there are some some pairs of people that simply do not see eyetoeye and they refuse to be in the same hall at the same time. Given a list of pairs i j that don't get along, your goal is to find a partitioning of the n people into two halls so that within each hall, there is no pair that does not get along. If this is impossible to achieve, your algorithm must output impossible.
Give an algorithm for this problem that runs in time Omn where m is the number of pairs i j of people who do not get along.
Important. To receive full credit, you must describe your algorithm in pseudocode and give an explanation for why it runs in Omn time.
Hint: Form an appropriate graph and try a BFSlike procedure.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
