combinatorics: what is the smallest number of fixed-size sets that together contain all possible pairs? Consider the following problem: let $S$ be a subset of size $d$ of the set of the numbers from 1 to $n$. We say the $S$ contains the pair $(k,m)$ if it is a subset of $S$. for example, $(1,4,6)$ contains the pairs $(1,4),(1,6),(4,6)$.
Now, we would like to generate a number of such sets (all with size $d$) that will together  contain all $n(n-1)/2$ possible pairs.
for example, for $d=3$ and $n=6$, the following 7 sets:
$(1,2,3) \\
(4,5,6) \\
(1,4,5) \\
(1,6,2) \\
(2,4,5) \\
(3,4,5) \\
(3,6,5)$
together contain all of the 15 possible pairs of numbers from 1 to 6, however it has many redundancies: for example the pair $(4,5)$ appears in 4 different ones.
for general $d$ and $n$, what is the smallest number of sets that together contains all possible pairs, and how to algorithmically generate it ?
A trivial upper bound is $\frac{n(n-1)}{2\lfloor d/2 \rfloor}$, since we can clearly accommodate at least $\lfloor d/2 \rfloor$ distinct pairs in any set, however as demonstrated by the above example we can do much better than that.
 A: The optimal case (i.e., each pair appearing exactly once) of you are looking for is called a Block design.
As suggested in the comments, for small parameters, the requirements can be converted into an Integer Linear Program.
Specifically:

Given a finite set $X$ (of elements called points) and integers
$k, r, λ ≥ 1,$ we define a $2-$design (or BIBD, standing for balanced incomplete block design) B to be a family of $k-$element subsets of $X$, called blocks, such that any $x$ in $X$ is contained in $r$ blocks, and any pair of distinct points $x$ and $y$ in $X$ is contained in $λ$ blocks. Here, the condition that any $x$ in $X$ is contained in $r$ blocks is redundant, as shown below.

So you want $\lambda=1,$ (each pair must appear exactly once) if possible. It won't be possible for all parameters due to the equations
$$bk=vr,\quad \lambda(v-1)=(v-1)=r(k-1)
$$
needing to be satisfied for an optimal solution to exist. Here $b$ is the number of blocks, $v=n$ in your terminology, and $k=d$ in your terminology. So
$$
bd=nr, \quad (n-1)=r(d-1)
$$
must hold. Due to these constraints only certain parameters will give optimal solutions.
More generally you want a Covering Design where you want each $2-$tuple to appear at least once.
Both these problems are difficult to solve in general. There is a website of covering designs here maintained by Dan Gordon.
