Solution:
First, let's characterize the minimum number of swaps needed given a configuration. Each swap destroys 0, 1, or 2 adjacent pairs. If at least one pair is destroyed, no other adjacent pairs can be formed. Therefore, we only care about the count of adjacent pairs and should never create any new ones. In a maximal block of k adjacent pairs, defined as k consecutive (circular) adjacent pairs, we need at least ⌈2k⌉ swaps. Maximal blocks are independent as we never create new ones. Thus, we need ∑i⌈2ki⌉ over maximal blocks.
Now we focus on counting the desired quantity over all configurations. As the expression above is linear and because expectation is linear, our answer is the sum of the number of 1-maximal blocks, 2-maximal blocks, ..., 5-maximal blocks. Note that there can't be a 4-maximal block. This can be computed as
E[AA]−E[AABB]+E[AABBCC]−E[AABBCCDDEE]
where AA… denotes a (not necessarily maximal) block of adjacent pairs and E[AA…] is the expected count of such. (This counts a block of AA as 1, a block of AABB as 1, a block of AABBCC as 2, and a block of AABBCCDDEE as 3 overall, as desired).
Lastly, we compute this quantity. Say there's n pairs. Let's treat each of the 2n people as distinguishable. The expected number of k consecutive adjacent pairs (not necessarily as a maximal block) equals
2n1n(kn)k!(2n−2k)!2k
The first n comes from choosing the start of this chain, (kn) from choosing which pairs are in this chain, k! from permuting these pairs, 2k from ordering the people in each pair in the chain, and (2n−2k)! from permuting the other people.
We plug in n=5 to obtain 945926.