Here is one more recursive answer that I find slightly easier to read:
ClearAll[jemPairings];
jemPairings[list_?VectorQ] := Catch@Module[
{two, rest, restpairings, pivot},
If[Length[list] == 2, Throw[{{list}}]];
{two, rest} = TakeDrop[list, 2];
restpairings = jemPairings[rest];
pivot = two[[2]];
Table[
Splice@Table[
{two /. pivot -> j, Splice[Sort /@ (rest /. j -> pivot)]},
{rest, restpairings}
],
(* Let j be every remaining item (including pivot) *)
{j, Union@Flatten[{pivot, restpairings}]}
]
] /; EvenQ@Length[list] && Length[list] >= 2
The Sort /@ is not really necessary, but nice to have.
It's the second fastest so far (Mathematica 13.0.1 on MacBook Pro):
TableForm@SortBy[
Table[
{
f,
Length[ReleaseHold[f[Range[8]] /. p -> Identity]] - (8 - 1)!!,
ReleaseHold[f[Range[2]]] == {{{1, 2}}} /. p -> Identity,
Sort[
Sort /@
ReleaseHold[f[Range[6]]]] == {{{1, 2}, {3, 4}, {5, 6}}, {{1,
2}, {3, 5}, {4, 6}}, {{1, 2}, {3, 6}, {4, 5}}, {{1, 3}, {2,
4}, {5, 6}}, {{1, 3}, {2, 5}, {4, 6}}, {{1, 3}, {2, 6}, {4,
5}}, {{1, 4}, {2, 3}, {5, 6}}, {{1, 4}, {2, 5}, {3, 6}}, {{1,
4}, {2, 6}, {3, 5}}, {{1, 5}, {2, 3}, {4, 6}}, {{1, 5}, {2,
4}, {3, 6}}, {{1, 5}, {2, 6}, {3, 4}}, {{1, 6}, {2, 3}, {4,
5}}, {{1, 6}, {2, 4}, {3, 5}}, {{1, 6}, {2, 5}, {3, 4}}} /.
p -> Identity,
UnitConvert[
Quantity[First@RepeatedTiming[ReleaseHold[f[Range[6]]]],
"Seconds"], "Microseconds"]
},
{f, {jemPairings, carlWollPairings, anjanKumarPairings,
HoldForm@kglrPairings, kargaratschPairings}}
],
Last
]

Subsets[list, {2}]? – Rabbit Jun 03 '19 at 21:102nelements, we are looking for a list of groups ofnpairs instead. – Kagaratsch Jun 03 '19 at 21:12Permutationgeneratesn!terms, while the symmetry of the pairings actually reduces the problem to generating only(n-1)!!terms. Which is way fewer, so that the recursive functions in the answers are guaranteed to be more efficient. – Kagaratsch Jun 04 '19 at 00:18(20-1)!! == 654 729 075(so around 600mb of data), while20! == 2432902008176640000(so around 2432902 terabytes of data). Unfortunately, I don't have a spare 2432902 terabyte drive lying around, hahaha! ^^ – Kagaratsch Jun 04 '19 at 00:28