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.
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.
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...
The wedding date for a couple is quickly approaching, and the wedding planner must provide the caterer an estimate of how many people will attend the reception so that the appropriate quantity of food is prepared for the buffet. The following table contains information on the number of RSVPs for the 145 invitations. Unfortunately, the number of guests does not always correspond to the number of RSVPs. Based on her experience, the wedding planner knows that it is extremely rare...
PartB (COMBINATORICS) -LEAVE ALL ANSWERA IN TERMS OF C(n,r) or factorials, Q4(a)(i ) In how many ways can you arrange the letters in the word INQUISITIVE? in how many of the above arrangements, U immediately follows Q? Q4. (b)Su next semester. Your favorite professor, John Smith, is teaching 2 courses next semester and therefore ppose you are a math major who is behind in requirements and you must take 4 math courses you "must" take at least one of them....
Tony and Peggy Sue graduated from a university in Texas last May. She received a degree in elementary education, and he graduated from the culinary school. They both now work in the Dallas area. Peggy Sue is a teacher, and Tony is a chef at a resort hotel restaurant. It is Christmas Day and Tony asks Peggy Sue to marry him. She excitedly accepts. They set a wedding date of June 30. Tony is from New York City. He is...
I have this project, I would like to hace an idea of how to do
it. I added a sample budget to get you an idea of how to designed.
Thank you in advance!
This is just the sample budget of how to designed!
Chapter 1 Project Dream Plans Owning your own home has always been part of the American Dream. But how feasible is building that home? Using Pólya's problem-solving process (http://www.cee.org/tep-lab- bench/pdf/PolyaProblemSolving.pdf ), you will estimate the cost...
Hi, can you solve Question 7 with code? Thanks.
Burrito-ful San Diego Tam, Margaret and Winifred are trying to use Data Science to find the best burritos in San Diego! Their friends Irene and Maya provided them with two comprehensive datasets on many burrito establishments in the San Diego area taken from (and cleaned from): https://www.kaggle.com/srcole/burritos-in-san- diego/data The following cell reads in a table called ratings which contains names of burrito restaurants, their Yelp rating, Google rating, as well as...
please use dia to draw the e-r diagram to create Entity -
Relationship Diagrams
then use MS access
This project requires you to create a database design. Your design will be documented in a set of Entity-Relationship Crow's Foot diagrams using the representation as shown in the lecture materials. Draw a set of Entity-Relationship diagrams to model the following scenario. The Maggs Realty Company wants to track the Sales Offices that they have across all of Ontario They are interested...
You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...
You are running a physics experiment with n complicated steps that you must do in order, and students sign-up for some steps to help. Your experiment requires n steps, and each of the m students gives you a list of which steps they can help out with (steps require special skills). From experience, you know things run most smoothly when you have as little switching of shifts as possible. For example, if your experiment has <1, 2, 3, 4, 5,...
484 Core Concepts of Accounting Information Systems a. Using Access, create an employee table sim- ilar to the one shown in Figure 15-4. Create created. (Hint You can use the aforemen- tioned expression for the department code as a validation rule.) at least one record for this table b. Create validation rules for the listed restric tions and an accompanying validation text for each. Document your work by provid- ing a table outlining exactly what rules you c. Test each...