Dependency Algorithm - find a minimum set of packages to install

前端 未结 10 1929
别那么骄傲
别那么骄傲 2021-02-02 17:23

I\'m working on an algorithm which goal is to find a minimum set of packages to install package \"X\".

I\'ll explain better with an example:



        
10条回答
  •  春和景丽
    2021-02-02 17:53

    To add to Misandrist's answer: your problem is NP-complete NP-hard (see dened's answer).

    Edit: Here is a direct reduction of a Set Cover instance (U,S) to your "package problem" instance: make each point z of the ground set U an AND requirement for X. Make each set in S that covers a point z an OR requirement for z. Then the solution for package problem gives the minimum set cover.

    Equivalently, you can ask which satisfying assignment of a monotone boolean circuit has fewest true variables, see these lecture notes.

提交回复
热议问题