This problem is naturally expressed as a bipartite graph.
Such a graph G=(V,E) has a set of nodes L and a set of nodes
R such that ,
(partition:
mutually exclusive and exhaustive), and for all
,
and
.
Also natural for machines-tasks, classes-classrooms, and others?