Consider the following graph:
https://i.imgur.com/r9d38v2.png
The vertex 1,2,3,4 belong to the first set and the vertex 5,6,7,8 belong to the second set. We want to check if its possible for each vertex from both sets to be connected to only one vertex from the other set. In other words if there are 8 nodes then there will be 4 different edges each one connecting different pairs of nodes. Is this a well known problem and how to solve it?