Minimum number of subsets needed to get the main set

Правка en1, от chari407, 2021-02-10 14:47:39

We are given n sets of numbers, {1,4}, {4,5}, {1,2,3}. We have to find the minimum number of sets to combine to get the complete set of numbers {1,2,3,4,5}. Also, we should know which sets were selected.

Example: If we choose {1,2,3} & {4,5}, we get the complete set in the minimum most number of steps = 2. If we choose {1,2,3}, {1,4}, {4,5}, we get the complete set of numbers, but we would require 3 steps. How do I solve this problem?

Теги # dp, #dynamic programing

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский chari407 2021-02-10 14:47:39 496 Initial revision (published)