2

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$

enter image description here

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$).

flonk
  • 2,434
  • 1
    What is a biregular degree-2 graph again, please? – Mike Feb 24 '23 at 22:34
  • @Mike I hope that was correctly formulated, according to wikipedia a biregular graph is a bipartite graph, where all edges on one side have the same degree, and in my question this degree is $2$ on both sides. Would You say there is a better way to say this? – flonk Feb 24 '23 at 22:40
  • You mean vertices [not edges] on one side have the same degree, correct? And where does $k$ fit into 'biregular degree-2 graph', please? – Mike Feb 24 '23 at 22:45
  • Yes, sorry, I meant vertices of course. I don't understand Your second question, how this "fits". The meaning of $k$ is stated in my post and in other words, I have $k$ left vertices, $k$ right vertices and every vertex has degree 2. That is the part with "balanced". – flonk Feb 24 '23 at 22:51
  • I gather from your recurrence that you're counting these graphs on labelled vertices? – joriki Feb 24 '23 at 23:02
  • @joriki I think yes, but as I am not 100% familiar with the wording: If I draw the nodes from $V_1$ and $V_2$ at fixed points and every possible graph with straight lines, every image that looks different corresponds to a different graph. Is that what you mean? – flonk Feb 24 '23 at 23:09
  • @flonk: Yes, that's what I mean. Unlabelled vertices would mean to count the equivalence classes under isomorphism, so two graphs would count as equivalent if you can relabel the vertices on one to get the other. – joriki Feb 24 '23 at 23:15
  • I see now that $k$ is the number of vertices on each side of the graph. A biregular graph, IIRC, is a bipartite graph where every vertex on the one side has the same degree, and every vertex on the other side also has the same degree, but the degree of every vertex on one side, is allowed to be different from the degree of every vertex on the other side. – Mike Feb 24 '23 at 23:16
  • @Mike Yes, thats correct, this is a special case of bipartite graph, which I called "degree-2" bipartite graph, I will improve the wording – flonk Feb 24 '23 at 23:24
  • @Mike I'd like to improve it but cannot see how the use of "biregular" is not correct here. I never claimed that biregular refers to degree-2, I simply used "biregular" as an attribute according to "If all vertices on the same side of the bipartition have the same degree, then G is called biregular." according to this Isn't this still true if -- in addition -- both degrees coincide? – flonk Feb 24 '23 at 23:31
  • 4
    This is OEIS sequence A001499. (Here's Java code that applies your recurrence to calculate the counts.) – joriki Feb 24 '23 at 23:35
  • @joriki Wow, thanks! I'm sure You're right, because the binary matrix problem mentioned in the definition is exactly what I'm trying to solve. – flonk Feb 24 '23 at 23:38
  • Technically yes, a regular bipartite graph is a biregular bipartite graph, but if every vertex has the same degree, I say just write 'regular' and be done with it. I admit that it took me a minute to recognize that every vertex has degree 2. Anyways the edits to your top paragraph do make this much easier to follow! – Mike Feb 24 '23 at 23:40
  • @joriki good link--I figured counting the number $N_k$ of labelled 2-regular bipartite graphs ${v_1,\ldots, v_k}$ on on one side and ${x_1,\ldots, x_k}$ on the other side, had been studied before, and that the sequence ${N_k}; k=3,4,\ldots $ had been worked out already. – Mike Feb 24 '23 at 23:43
  • 1
    @Mike thanks I wasn't aware of the obvious fact that "biregular" is a relaxation of "regular", I now see how my wording was cumbersome – flonk Feb 24 '23 at 23:56
  • 1
    @joriki My scheme (and Your Java code) has the space/time complexities $O(k),O(k^2)$, however the linear recurrence mentioned in the link gives me $O(1),O(k)$, which is as good as any "explicit" formula involing at least one factorial. I'll look up the derivation of the recurrence in the references tomorrow, however technically You gave me the answer :) thanks again – flonk Feb 25 '23 at 00:26

1 Answers1

2

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

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

  2. $a_i<b_i$,

  3. 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$

Mike Earnest
  • 75,930