Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Abstract
This is the solution of the assignment 5, in CMPT 705 Analysis and
design course (Fall 2019), Prof. Qianping Gu with Ehsan Hoseinzade
and Young Shin Oh as TA.
1
and A[2, 1] = 2, then we draw an edge in the vertex va[1] and va[2] ; that
edge means that in our independent set, we just want to select one of those
vertex in order to guarantee that just one row (in our case, row A[1] or A[2])
is selected. Finally, in order to solve the problem, we just need to check if
there is an independent set in G with at least k vertex. If we can solve the
independent set problem, we can solve the diverse subset problem.
Hence we can say that IndependentSet ≤p DiverseSubSet and it com-
pletes our proof that Diverse subset is NP-Complete.
2.3 Part c: The special case that there are two types of
resources
If we have two types of resources R and J and at most one resource of
each type is required per process, then there is no competence for resources,
because they are disjoint sets. Therefore, the number of k process that can
2
be allocated it will be limited by the number of R and J and the solution
is just check if there is almost k resources of each, which can be done in
polinomial time.
3
4 Solutions to problem 4 (Chapter 8 problem 21)
The Fully Compatible Configuration (FCC) is a problem that arrises natu-
rally when we have several set of options and an another subset of options
that are incompatible among them. This problem is NP because it is polino-
mial time verificable that for each given configuration, we can check if exist
any element that are incompatible or not among them.
If we want to check if this problem is NP-Complete, we need to check a Y
problem that is NP-Complete and can solve the FCC problem. If we check
the FCC problem, we can see that is a problem of deciding whether exist a
set of elements that are compatible among them. The 3-SAT problem is a
canonical way to decide this question.
Concretely, suppose we are given an instance of 3-SAT consisting of
clauses C1 , . . . , Ck over variables x1 , x2 , . . . , xn . We construct an instance
of FCC as follows. For each variable xi we correspond it with elements of
Ai , in order to form a clause with three elements. For each element in the
incompatible list P , we add it also in a clause, but in its negated form.
Therefore, if we have an element xi and xj that is in Ai and Aj respectively,
but also appears in P as a incompatible items, then the clause (xi ∨ xj ) will
not let to satisfy the arrangement to 1, but if we don’t have that restriction,
then the arragement in CNF form will satisfy to 1, meaning that the FCC
is satisfiable. The solution of the FCC exist if and only if exist a way to
satisfy to 1 the arrangement of variables of 3-SAT problem.
Therefore, we can see that 3-SAT ≤p FCC, that means FCC problem is
NP-Complete.
4
every A[i] in backward order (this means, from the point where there is no
way to force a winning to the start of the game). A given player can win
the game if exist a way for the player t to play the A[i] turn where it has
an edge to other turn and that turn (played by player s) has A[n] = 0 (that
means there is no other possible turn, lossing the game).
This algorithm clearly has polinomial time solution, because every node
n dependes of computing the value of A[n−1] and so on, recursivelly, solving
the game depending on which turn it starts.