I have a directed acyclic graph $\mathcal{G(V,E)}$ and a set $S = \{S_0, S_1, \ldots S_m\}$ consisting of $m$ disjoint subsets whose union equals $\mathcal{V}$.
Vertices can be attached together to form one vertex under the following two conditions:
- Vertices that are merged need to belong to the same subset $S_i$.
- No cycles are allowed to be introduced as a result of a merging.
The problem $P$ is defined as to minimize $|\mathcal{V}| $ by performing the mergings under the conditions described above.
I want to prove that this problem is NP-Hard and to my understanding, this is most easily done by transforming another problem $Q$ which is known to be NP-hard into the problem $P$. And here I'm almost at a dead end. I have looked at the set cover problem which has some similarities with my problem but I can't seem to find a way of transforming one into the other.
An example:
Let me demonstrate the optimization problem and the conditions with a simple example. We pick the simplest case where $m$ = 2 and is represented by the colors of the vertices in the pictures.

Since we have two pairs of vertices belonging to a subset $S_i$ (i.e. two colors) we can at most perform two mergings. Since only one merging is feasible (merging A and D creates a cycle) the optimal number is $|\mathcal{V}| = 3$