Блог пользователя chari407

Автор chari407, история, 3 года назад, По-английски

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?

  • Проголосовать: нравится
  • -1
  • Проголосовать: не нравится

»
3 года назад, # |
Rev. 3   Проголосовать: нравится +19 Проголосовать: не нравится

Well in generally it is NP-Hard problem link