Question

You are planning the seating arrangements for a wedding reception. There will be n guests at...

You are planning the seating arrangements for a wedding reception. There will be n guests at the reception, numbered 1 through n.

Certain pairs of guests are mortal enemies and must not be seated at the same table. The set E contains pairs of guests who are mortal enemies. For example, if guests 1 and 3 are mortal enemies, and guests 2 and 7 are mortal enemies, we would have E = {(1,3), (2,7)}.

Other pairs of guests are best friends and must be seated at the same table. The set F contains pairs of guests who are best friends.

Let m = |E| + |F| be the total number of enemy/friend constraints. You are to design an algorithm that will determine whether or not it will be possible to seat all of the guests. You can use as many tables as necessary, and the tables can be arbitrarily large. The time complexity of your algorithm must be O(n + m log* n). If you do not achieve this complexity, you will receive no credit.

Hint: The required time complexity is a hint.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Let us first convert it into more understandable form, by converting each variable into false or true which constitutes the symbolic logic. For instance, the sentence will be transformed into Conjunctive Normal Form (CNF) which is a formula and conjunction of clauses in which each clause is a disjunction of literals and if the conditions matches the CNF then it can represented in Boolean expression and by following this method, I was able to derive these conditions:

(i)Each guest Q should be seated at least one table and Each guest Q should be seated at most one table.

(ii) Any two guests Q and W who are Friends should be seated at the same table.

(iii) Any two guests Q and W who are Enemies should be seated at various tables.

The next step is to transform these sentences into CNF. If E are the total guests and R represents the table and T represents pairs of friends while Y represents pairs of enemies, therefore U(q,p) represents the guest Q placed at table p so that guest Q and T are friends while Q and Y are foes. However, there are many proposed algorithms which solves this problem and among them, the PL-Resolution algorithm is well-suited and provides optimal solution by determine whether there exists a solution or not and by constructing new clauses by solving each and every pair placed in the knowledge base.   

Add a comment
Know the answer?
Add Answer to:
You are planning the seating arrangements for a wedding reception. There will be n guests at...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT