Say I have a class of M students. Every week I choose N students from the class to do some group assignment. The rest of the class does not participate. I have only one criterion: every student needs to have been in a group with every other student at least once. The number of times each student has been chosen to participate in an assignment is not important. I want to find a sequence of groupings of students that satisfies this constraint in as few weeks as possible.
An example:
Class: {A, B, C, D}
Week 1: {A, B, C}
Week 2: {B, C, D}
Week 3: {A, B, D}
This satisfies the constraint; every student is paired with every other student in at least one of the weeks.
I guess this can be written as a more general question. Combinatorics is not really my day job, so this is my best attempt at a formal description of the question:
Given a set $A$ of size $M$, find the set of sets $B=\{C_1, C_2, \ldots, C_Q\}$ with $|C_m|=N<M$ for all $m \leq Q$ such that every possible subset $D \subset A$ with $|D|=P<N$ is contained in at least one of the sets $C_m$, minimising $Q$. I'm really only interested in the case $P=2$ (so: pairs) if that helps.
EDIT: This question is different from Efficiently partition a set into all possible unique pair combinations because the size of the groups $N$ is not equal to the size of the pairs $P$. Furthermore, overlap/repetition between the sets $C_m \in B$ is allowed and the number of sets $Q$ is not known beforehand (needs to be minimised).