Question: Problem 2. It is going to be cold this weekend, and we need to stay warm. I am thinking I should wear as many coats

 Problem 2. It is going to be cold this weekend, and

Problem 2. It is going to be cold this weekend, and we need to stay warm. I am thinking I should wear as many coats as I can. It is a bit complicated though, as I have two types of constraints: I) each coat has a size, and I can only wear Ci over C; if Ci is larger than Cj, and II) some pairs of coats have incompatible materials, so they cannot be in direct contact. So, you cannot wear one exactly on top of the other, however, you can wear both of them if there is one or more layers in between. The input of my problem is going to be s[1,..., n] the sizes of my coats, they are all positive integers. Also, I have a matrix incomp[1,..., n][1,..., n] which specifies for each i, j if the Ci and C; have incompatible materials: incomp[i, j] = incomp[j,i] = 1 if Ci and Cj have incompatible materials. Otherwise, incomp[i, j] = incomp[j,i] = 0. Describe and analyze an algorithm to tell me the maximum number of coats that I can wear this weekend. Argue that your algorithm is correct (it is going to be cold!). Your algorithm should work in polynomial time because the weekend is close. For example, let C1,C2,C3,C4 be the set of coats, with s(C1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!