I would like to know if there exists a polytime probablistic algorithm for the problem described below. It is relevant for construction of a crossvalidation-partitioning in statistics, fulfilling certain constraints.
Or is it maybe NP-complete? I don't see any direct connections to any NP-complete problem I know of.
Input: $(N,K, (\phi_1, \ldots, \phi_l))$
Informal description:
Let $ \{1 \ldots N\}$ be partitioned according to functions $\phi_1, \ldots, \phi_l$. Find a random partition $\Phi : \{1\ldots N\} \rightarrow \{1\ldots K\}$ s.t. for all $i$, elements with the same value under $\phi_i$, will get at least 2 different values under $\Phi$. Furthermore, the new partitioning should be balanced.
If no solution exists, halt with error.
Formal description:
Let $N, K \in \mathbb N$, and $\phi_i : \{1 \ldots N\} \rightarrow \{1 \ldots m_i\}$ be given for $i \in \{1 \ldots l\}$.
Find a random $\Phi : \{1\ldots N\} \rightarrow \{1\ldots K\}$ s.t. $$ \forall i\in \{1 \ldots l\} :\forall v \in \{1\ldots m_i\} : |\Phi( \phi_i^{-1}(v) )| \geq 2 $$ $$ \forall v \in \{1\ldots K\} :\left\lfloor \frac{N}{K} \right\rfloor \leq |\Phi^{-1}(v)| \leq \left\lceil \frac{N}{K} \right\rceil $$