Derive the number of all labelled, balanced, 2-regular bipartite graphs I'm trying to explicitly derive the number $B_{2,k}$ of all labelled bipartite graphs with $k$ left nodes, $k$ right nodes, and every node has degree $2$. (these are labelled, balanced, 2-regular bipartite graphs).
I restrict to the case that $k$ is even.
To address the "what did You try so far" my question is two-fold, I present my approach in the following, and would like to know how to proceed, but I'm also generally interested in better approaches.
My approach:
My idea was to add pairs of edges to the vertices of the left node set $V_1$ and partition the "unfinished" graphs by the numbers $(n_0,n_1,n_2)$ where $n_k$ counts the number of vertices
in $V_2$ which already have $k$ edges attached.
That is, I start with an unfinished graph of type $(6,0,0)$ and at each step I add two edges to the first unprocessed vertex of $V_1$ to two different vertices of the $n_0+n_1$ possible vertices.
As an illustration the structure of the construction scheme is shown here for $k=4,6$

This scheme is $O(k)$ in space and $O(k^2)$ in time, so I try to seek an explicit solution.
In general, the scheme can be expressed as a recurrence for the number $C_{n_0,n_1,n_2}$ of "unfinished graphs" $C_{k,0,0}=1$ (an empty picture with no edges) I would obtain $B_{2,k}=C_{0,0,k}$ (a full drawn picture of a graph where all right nodes have 2 edges).
This recurrence is
$$
C_{n_0,n_1,n_2} = \binom{n_1+2}{2}C_{n_0,n_1+2,n_2-2} + \binom{n_0+2}{2}C_{n_0+2,n_1-2,n_2} +\binom{n_0+1}{1}\binom{n_1}{1}C_{n_0+1,n_1,n_2-1} + \delta_{n_0,k}\delta_{n_1,0}\delta_{n_2,0} 
$$
The recurrence is formulated such that it is true also for negative $n_k$ and defining the generating function $C(z_0,z_1,z_2)=\sum_{n_k}C_{n_0,n_1,n_2}z_0^{n_0}z_1^{n_1}z_2^{n_2}$, the recurrence can be summed to the following equation
$$
C(z) = (\tfrac{1}{2}z_2^2 \partial_1^2 + \tfrac{1}{2}z_1^2 \partial_0^2 + z_1 z_2 \partial_0\partial_1)C(z) + z_o^k
$$
At this point I would have to compute $\partial_2^k C(z)|_{z=0}$ but I have no idea how to solve this.
Moreover, I doubt this recurrence is the best way to formulate this. It looks simple to sum, but it unneccesarily incorporates all problems for different $k$ in one object, whereas they are not connected (only the coefficients with $n_1+n_2+n_3=k$ are connected and belong to the problem $k$).
 A: This is equivalent to counting $n\times n$ binary matrices with two ones in each row and column. As mentioned in OEIS sequence A001499, the number of such matrices is
$$
n!2^{-n}\sum_{k=0}^n (-1)^{n-k}\binom nk (2k-1)!!,
$$
where $(2k-1)!!$ is the product of all odd numbers between $1$ and $2k-1$, inclusive. Such a beautiful a formula is deserving of a combinatorial proof, which is what I now provide.
Proof: A matrix with two ones in each row and column is uniquely specified by a sequence
$$
(a_1,b_1,a_2,b_2,\dots,a_n,b_n),
$$
such that

*

*each $a_i,b_i\in \{1,\dots,n\}$,


*$a_i<b_i$,


*For each $j\in \{1,\dots,n\}$, $j$ appears twice in the sequence.
Given such a sequence, the corresponding $n\times n$ binary matrix is given by placing, for each $i\in \{1,\dots,n\}$, two ones in row $i$ at columns $a_i$ and $b_i$.
To enumerate these sequences, we first count the sequences which only satisfy conditions $1$ and $3$. This is not hard to do; the number of ways is
$$
\binom{2n}2\binom{2n-2}2\cdots \binom{2}2=n!\cdot (2n-1)!!,
$$
because the locations of the two $1$'s can be chosen in $\binom{2n}2$ ways, and the the locations of the two $2$'s can be chosen in $\binom{2n-2}2$ ways, and so on. Alternatively, you can choose a perfect matching of $2n$ locations in the sequence in $(2n-1)!!$ ways, and then assign labels from $1$ to $n$ to these $n$ pairs in $n!$ ways.
Now, let $S$ be the set of all sequences satisfying conditions $1$ and $3$ only, and for each $i\in \{1,\dots,n\}$, let
$$
E_i=\{s\in S\mid a_i=b_i\}
$$
Every sequence in $E_i$ is "bad", because it violates $a_i<b_i$ by having equality. To eliminate these "bad" sets, we use the principle of inclusion exclusion.
$$
\begin{align}
|S\setminus (E_1\cup \dots \cup E_n)|
&= \sum_{k=0}^n (-1)^k  \binom nk |E_1\cap \dots \cap E_k|
\\
&= \sum_{k=0}^n (-1)^k  \binom nk (2(n-k)-1)!!\cdot n!\tag{$*$}
\end{align}
$$
Let me explain why $|E_1\cap \dots \cap E_k|=(2(n-k)-1)!!\cdot n!$. When choosing a perfect matching for the $2n$ locations of the sequence in $E_1\cap \dots \cap E_k$, we are requiring $\{a_1,b_1\},\dots,\{a_k,b_k\}$ to all be matched, so there are only $2(n-k)$ locations remaining to freely match.
The expression in $(*)$ enumerates the sequences in $S$ which satisfy $a_i\neq b_i$ for each $i$. In order to count the sequences where $a_i<b_i$ for each $i$, you multiply the count in $(*)$ by $2^{-n}$. The result is exactly the formula advertised at the beginning of this answer. $\square$
