Data Strcuture to represent dependencies amongst modules
Your problem is the following:

Given a dag $G$, with labels $\ell:V\to L$ on the vertices, and a set $O \subseteq L$, find the smallest subset $S \subseteq V$ of vertices such that for each $o \in O$, there is a vertex in $S$ labelled $o$.

This problem is NP-hard, by reduction from set cover.

(The reduction: given sets $T_1,\dots,T_n$ and universe $U$, define a dag with one source vertex for each $T_i$, one sink vertex per element of $U$, labelled with that element, and an edge $T_i \to t$ for each $t \in T_i$; and set $O=U$.  Then the smallest subset of vertices that meets the requirements is also the minimum set cover.)

Since it is NP-hard, you'll need to use any of the standard methods for dealing with NP-hardness: heuristics, an approximation algorithm, an exponential-time algorithm, etc.  I suggest reducing this to integer linear programming.  Add a zero-or-one boolean variable $x_v$ for each vertex $v$; for each edge $v \to w$, add the inequality $x_v \ge x_w$; for each label $o \in O$ in the output set, add the inequality $\sum_{\ell(v)=o} x_v \ge 1$, where the sum ranges over all vertices with label $o$; and then minimize the objective function $\sum_{v \in V} x_v$.  Then, apply an off-the-shelf ILP solver.  Of course this may be exponential time in the worst case, but I suspect it's about as you're likely to get in practice, within any reasonable amount of programming effort.

The data structure to use is a graph.  The problem remains NP-hard no matter what data structure you use, so choice of an appropriate data structure isn't going to make the problem any easier.