Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Can this problem be solved in polynomial time?

Revision en1, by quinoa, 2021-05-18 19:03:02

I have N elements and I want to maximize the number of elements that can be selected given to some constraints of the type “you can take at most 1 element from this subset of the elements”.

Example

I have 10 elements (labeled 1 through 10) with constraints: - You can pick at most 1 element from the set { 1, 5, 7 } - You can pick at most 1 element from the set { 3, 4 } - You can pick at most 1 element from the set { 2, 5, 6, 9 }

An optimal solution is selecting elements { 1, 2, 3, 8, 10 } (I double checked it by writing the exponential solution).

I first though I could reduce it to a maximum matching or flow problem but I failed to do so. Is it a known problem and can it be solved in polynomial time?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English quinoa 2021-05-18 19:08:00 66 Tiny change: 'I have N elements ' -> 'I have $N$ elements ' (published)
en1 English quinoa 2021-05-18 19:03:02 779 Initial revision (saved to drafts)