1 Introduction

A fundamental theme in graph theory is the study of the spectral gap of a regular (undirected) graph, that is, the difference between the two largest eigenvalues of the adjacency matrix of such a graph. Analogously, the spectral gap of a bipartite, biregular graph is the difference between the two largest singular values of its biadjacency matrix (please see Sect. 2 for detailed definitions). Ramanujan graphs (respectively Ramanujan bigraphs) are graphs with an optimal spectral gap. Explicit constructions of such graphs have multifaceted applications in areas such as computer science, coding theory, and compressed sensing. In particular, in [8] the first and third authors show that Ramanujan graphs can provide the first deterministic solution to the so-called matrix completion problem. Prior to the publication of [8], the matrix completion problem had only a probabilistic solution. The explicit construction of Ramanujan graphs has been classically well studied. Some explicit methods are known, for example, by the work of Lubotzky, Phillips, and Sarnak [22], Margulis [26], Li [21], Morgenstern [27], Gunnells [19], Bibak et al. [6]. These methods are drawn from concepts in linear algebra, number theory, representation theory and the theory of automorphic forms. In contrast, however, no explicit methods for constructing unbalanced Ramanujan bigraphs are known. There are a couple of abstract constructions in [5, 14], but these are not explicit.Footnote 1

This article has three goals.

  1. 1.

    [Explicit construction of unbalanced Ramanujan bigraphs]: First and foremost, we present for the first time explicit constructions of an infinite family of unbalanced Ramanujan bigraphs. Our construction, presented in Sect. 3, is based on “array code” matrices from LDPC (low-density parity check) coding theory. Apart from being the first explicit constructions, they also have an important computational feature: the biadjacency matrices are obtained immediately upon specifying two parameters, a prime number q and an integer \(l \ge 2\).

  2. 2.

    [Comparison of computational aspects of known constructions]: The second goal of this article is to revisit some of the earlier-known constructions of Ramanujan graphs and (balanced) bigraphs and compare the amount of work involved in constructing the various classes of graphs and obtaining their adjacency or biadjacency matrices. We also focus on the two earlier-known constructions of Ramanujan bipartite graphs due to Lubotzky–Phillips–Sarnak [22] and Gunnells [19] and show that each can be converted into a nonbipartite graph. Note that every graph can be associated with a bipartite graph, but the converse is not true in general. Also, the research community prefers nonbipartite graphs over bipartite graphs. Thus, our proof that the LPS and Gunnells constructions can be converted to nonbipartite graphs is of some interest. All of this is addressed in Sect. 4.

  3. 3.

    [Construction of Ramanujan graphs with prohibited edges]: The third goal of this article is to address the following question: can we construct a bipartite Ramanujan graph with specified degrees, but with the restriction that the edge set of this graph must be distinct from a given set of “prohibited” edges? The approach that we follow to answer this question is to start with an existing Ramanujan bigraph, and then to perturb its edge set so as to eliminate the prohibited edges and replace them by other edges that are nonprohibited. This procedure retains the biregularity of the graph. We then show that our replacement procedure also retains the Ramanujan nature of the bigraph, provided the gap between the second largest singular value of the biadjacency matrix and the “Ramanujan bound” is larger than twice the maximum number of prohibited edges at each vertex. These questions are studied in Section 7.

1.1 Organization of paper

This article is organized as follows. In Sect. 2, we present a brief review of Ramanujan graphs and bigraphs.

In Sect. 3, we address the first goal of this article, and present the first explicit construction of an infinite family of unbalanced Ramanujan bigraphs.

In Sect. 4 (Sects 4.14.4), we address the second goal of this article. We review many of the known methods for constructing Ramanujan graphs, based on the original publications.

In Sect. 5, we shed further light on the two constructions of Ramanujan bipartite graphs due to Lubotzky–Phillips–Sarnak [22] and Gunnells [19] and show how each can be converted into a nonbipartite graph.

In Sect. 6, we analyze the computational effort required in actually implementing the various construction methods reviewed in Sect. 4. A pertinent issue that is addressed here is whether one can give a polynomial-time algorithm for implementing the known constructions.

In Sect. 7 (Sects. 7.1 and 7.2), we accomplish the third goal of this article, namely to construct a bipartite Ramanujan graph with specified degrees, but with the restriction that the edge set of this graph must be disjoint from a given set of “prohibited” edges. In Sect. 7.3, we analyze our new construction of Ramanujan bigraphs from Sect. 3 as well as the previously known constructions of Ramanujan graphs and bigraphs, in terms of how many edges can be relocated while retaining the Ramanujan property.

2 Review of Ramanujan graphs and bigraphs

In this subsection, we review the basics of Ramanujan graphs and Ramanujan bigraphs. Further details about Ramanujan graphs can be found in [12, 28].

Recall that a graph consists of a vertex set \(\mathcal {V}\) and an edge set \(\mathcal {E}\subseteq \mathcal {V}\times \mathcal {V}\). If \((v_i,v_j) \in \mathcal {E}\) implies that \((v_j,v_i) \in \mathcal {E}\), then the graph is said to be undirected. A graph is said to be bipartite if \(\mathcal {V}\) can be partitioned into two sets \(\mathcal {V}_r, \mathcal {V}_c\) such that \(\mathcal {E}\cap (\mathcal {V}_r \times \mathcal {V}_r) = \emptyset \), \(\mathcal {E}\cap (\mathcal {V}_c \times \mathcal {V}_c) = \emptyset \). Thus, in a bipartite graph, all edges connect one vertex in \(\mathcal {V}_r\) with another vertex in \(\mathcal {V}_c\). A bipartite graph is said to be balanced if \(|\mathcal {V}_r| = |\mathcal {V}_c|\), and unbalanced otherwise.

A graph is said to be d-regular if every vertex has the same degree d. A bipartite graph is said to be \((d_r,d_c)\)-biregular if every vertex in \(\mathcal {V}_r\) has degree \(d_r\), and every vertex in \(\mathcal {V}_c\) has degree \(d_c\). Clearly this implies that \(d_c |\mathcal {V}_c| = d_r |\mathcal {V}_r|\).

Suppose \((\mathcal {V},\mathcal {E})\) is a graph. Then its adjacency matrix \(A \in \{0,1\}^{|\mathcal {V}| \times |\mathcal {V}|}\) is defined by setting \(A_{ij} = 1\) if there is an edge \((v_i,v_j) \in \mathcal {E}\), and \(A_{ij} = 0\) otherwise. In an undirected graph (which are the only kind we deal with in the paper), A is symmetric and therefore has only real eigenvalues. If the graph is d-regular, then d is an eigenvalue of A and is also its spectral radius. The multiplicity of d as an eigenvalue of A equals the number of connected components of the graph. Thus the graph is connected if and only if d is a simple eigenvalue of A. The graph is bipartite if and only if \(-d\) is an eigenvalue of A. If the graph is bipartite, then its adjacency matrix A looks like \( A = \left[ \begin{array}{cc} 0 &{} B \\ B^\top &{} 0 \end{array}\right] , \) where \(B \in \{0,1\}^{|\mathcal {V}_r| \times |\mathcal {V}_c|}\) is called the biadjacency matrix. The eigenvalues of A equal \(\pm \sigma _1 , \ldots , \pm \sigma _l\) together with a suitable number of zeros, where \(l = \min \{ |\mathcal {V}_r| , |\mathcal {V}_c| \}\), and \(\sigma _1 , \ldots , \sigma _l\) are the singular values of B. Here, the singular values of B denote the square roots of nonnegative eigenvalues of \(B^\top B\). In particular, in a \((d_r,d_c)\)-biregular graph, \(\sqrt{d_r d_c}\) is the largest singular value of B. These and other elementary facts about graphs can be found in [28].

Definition 1

A d-regular graph is said to be a Ramanujan graph if the second largest eigenvalue by magnitude of its adjacency matrix, call it \(\lambda _2\), satisfies

$$\begin{aligned} | \lambda _2 | \le 2 \sqrt{d-1} . \end{aligned}$$
(1)

A d-regular bipartite graphFootnote 2 is said to be a bipartite Ramanujan graph if the second largest singular value of its biadjacency matrix, call it \(\sigma _2\), satisfies

$$\begin{aligned} \sigma _2 \le 2 \sqrt{d-1} . \end{aligned}$$
(2)

Note the distinction being made between the two cases. If a graph is d-regular and bipartite, then it cannot be a Ramanujan graph, because in that case \(\lambda _2 = -d\), which violates (1). On the other hand, if it satisfies (2), then it is called a bipartite Ramanujan graph. Observe too that not all authors make this distinction.

Definition 2

A \((d_r,d_c)\)-biregular bipartite graph is said to be a Ramanujan bigraph if the second largest singular value of its biadjacency matrix, call it \(\sigma _2\), satisfies

$$\begin{aligned} \sigma _2 \le \sqrt{d_r-1} + \sqrt{d_c-1} . \end{aligned}$$
(3)

It is easy to see that Definition 2 contains the second case of Definition 1 as a special case when \(d_r = d_c = d\). A Ramanujan bigraph with \(d_r \ne d_c\) is called an unbalanced Ramanujan bigraph.

The rationale behind the bounds in these definitions is given the following results. In the interests of brevity, the results are paraphrased and the reader should consult the original sources for precise statements.

Theorem 1

(Alon–Boppana bound; see [1]) Fix d and let \(n \rightarrow \infty \) in a d-regular graph with n vertices. Then

$$\begin{aligned} \liminf _{n \rightarrow \infty } | \lambda _2 | \ge 2 \sqrt{d-1} . \end{aligned}$$
(4)

Theorem 2

(see [16]) Fix \(d_r,d_c\) and let \(n_r, n_c\) approach infinity subject to \(d_r n_r = d_c n_c\). Then

$$\begin{aligned} \liminf _{n_r \rightarrow \infty , n_c \rightarrow \infty } \sigma _2 \ge \sqrt{d_r-1} + \sqrt{d_c-1} . \end{aligned}$$
(5)

Given that a d-regular graph has d as its largest eigenvalue \(\lambda _1\), a Ramanujan graph is one for which the ratio \(\lambda _2/\lambda _1\) is as small as possible, in view of the Alon–Boppana bound of Theorem 1. Similarly, given that a \((d_r,d_c)\)-regular bipartite graph has \(\sigma _1 = \sqrt{d_r d_c}\), a Ramanujan bigraph is one for which the ratio \(\sigma _2/\sigma _1\) is as small as possible, in view of Theorem 2.

In a certain sense, Ramanujan graphs and Ramanujan bigraphs are pervasive. To be precise, if d is kept fixed and \(n \rightarrow \infty \), then the fraction of d-regular, n-vertex graphs that satisfy the Ramanujan property approaches one; see [17, 18]. Similarly, if \(d_r,d_c\) are kept fixed and \(n_r, n_c \rightarrow \infty \) (subject of course to the condition that \(d_r n_r = d_c n_c\)), then the fraction of \((d_r,d_c)\)-biregular graphs that are Ramanujan bigraphs approaches one; see [7]. However, despite their prevalence, there are relatively few explicit methods for constructing Ramanujan graphs. Many of the currently known techniques are reprised in Sect. 4.

3 Two new families of unbalanced Ramanujan bigraphs

The existence of Ramanujan bigraphs of specified degrees and sizes has been well studied in recent years. A “road map” for constructing Ramanujan bigraphs is given in [4], and some abstract constructions of Ramanujan bigraphs are given in [5, 14]. These bigraphs have degrees \((p+1,p^3+1)\) for various values of p, such as \(p \equiv 5 ~\mathrm{mod}~12\), \(p \equiv 11 ~\mathrm{mod}~12\) [5], and \(p \equiv 3 ~\mathrm{mod}~4\) [14].Footnote 3 For each suitable choice of p, these papers lead to an infinite family of Ramanujan bigraphs. At present, these constructions are not explicit in terms of resulting in a biadjacency matrix of 0 s and 1 s. There is a paper under preparation by the authors of these papers to make these constructions explicit.

The celebrated results of [23,24,25] show that there exist bipartite Ramanujan graphs of all degrees and all sizes. However, these results do not imply the existence of Ramanujan graphs of all sizes and degrees. To understand the approach of [24], we recall the notion of a Ramanujan covering as follows: A covering of a graph G refers to a graph \(G'\) and a surjection \(f:\,\mathcal {V}(G') \rightarrow \mathcal {V}(G)\) such that for any vertex \(v \in \mathcal {V}(G')\), the neighborhood of any vertex in \(G'\) [that is, the set of all vertices in \(G'\) which are joined to v by an edge] is mapped bijectively to the neighborhood of f(v) in G. Moreover, for a positive integer s, a covering \(G'\) of G is called an s-covering if every vertex in G has exactly s preimages in \(G'\). Finally, if an s-covering \(G'\) of a Ramanujan bigraph G satisfies the Ramanujan property in (3), it is said to be a Ramanujan s-covering of G.

A special case of one of the key results in [24] implies the existence of a Ramanujan 2-covering of any Ramanujan bigraph G. Subsequently, this was generalized to the existence of a Ramanujan s-covering of a Ramanujan bigraph G for \(s=3,\,4\) in [10] and in [20] for any positive \(s \ge 2\). The results of [10, 20, 24] therefore show that if we start with a specific \((d_r,d_c)\)-Ramanujan bigraph with \(n_r+n_c\) vertices, then there exist infinite families of \((d_r,d_c)\)-Ramanujan bigraphs with arbitrarily large number of vertices.

As far as we are able to understand, the ideas in [10, 20, 23,24,25] do not lead to an explicit construction (in the sense of resulting in a biadjacency matrix of 0 s and 1 s). There is a preprint [11] that claims to give a polynomial-time algorithm for implementing the construction of [23, 24]. However, no code for the claimed implementation is available.

We would also like to recall here a recent result [7], which states that a randomly generated \((d_r,d_c)\)-biregular bipartite graph with \((n_r,n_c)\) vertices satisfies the Ramanujan property with probability approaching one as \(n_r,n_c\) simultaneously approach infinity (of course, while satisfying the constraint that \(d_r n_r = d_c n_c\)). This result generalizes an earlier result due to [17, 18] which states that a randomly generated d-regular, n-vertex graph satisfies the Ramanujan property with probability approaching one as \(n \rightarrow \infty \).

The objective of this section is to present what the authors believe is the first explicit construction of a family of unbalanced Ramanujan bigraphs, that is, unbalanced biregular bipartite graphs that satisfy the inequality (3). The biadjacency matrices of these constructions are obtained immediately upon specifying two parameters, a prime number q and an integer \(l \ge 2\).

We state and prove two such explicit constructions, namely \((lq,q^2)\)-biregular graphs where q is any prime and l is any integer that satisfies \(2 \le l \le q\), and \((q^2,lq)\)-biregular graphs where q is any prime and l is any integer greater than q. Thus we can construct Ramanujan bigraphs for a broader range of degree-pairs as compared to [5, 14]. In particular, for \(l = q\) we generate a new class of Ramanujan graphs. However, for a given pair of integers lq, we can construct only one Ramanujan bigraph.

Our construction is based on the so-called “array code” matrices from LDPC (low-density parity check) coding theory, first introduced in [15, 32]. Let q be a prime number, and let \(P\in \{0,1\}^{q \times q}\) be a cyclic shift permutation matrix on q numbers. Then the entries of P can be expressed as

$$\begin{aligned} P_{ij} = \left\{ \begin{array}{ll} 1,\quad &{} j = i-1 ~\mathrm{mod}~q, \\ 0,\quad &{} \text{ otherwise } . \end{array}\right. \nonumber \\ \end{aligned}$$

Now let q be a prime number, and define

$$\begin{aligned} B(q,l) = \left[ \begin{array}{ccccc} I_q &{}\quad I_q &{}\quad I_q &{}\quad \cdots &{}\quad I_q\\ I_q &{}\quad P &{}\quad P^2 &{}\quad \cdots &{}\quad P^{(l-1)}\\ I_q &{}\quad P^2 &{}\quad P^4 &{}\quad \cdots &{}\quad P^{2(l-1)}\\ I_q &{}\quad P^3 &{}\quad P^6 &{}\quad \cdots &{}\quad P^{3(l-1)}\\ \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots &{}\quad \vdots \\ I_q &{}\quad P^{(q-1)} &{}\quad P^{2(q-1)} &{}\quad \cdots &{}\quad P^{(l-1)(q-1)}\\ \end{array}\right] \end{aligned}$$
(6)

where \(P^j\) represents P raised to the power j. Now \(B = B(q,l)\) is binary with \(q^2\) rows and lq columns, row degree of l and column degree of q. If \(l < q\), we study the matrix \(B^\top \), whereas if \(l \ge q\), we study B. In either case, the largest singular value of B is \(\sqrt{ql}\). The fact that these bipartite graphs satisfy the Ramanujan property is now established.

Theorem 3

(1):

Suppose \(2 \le l \le q\). Then the matrix \(B^\top \) has a simple singular value of \(\sqrt{ql}\), \(l(q-1)\) singular values of \(\sqrt{q}\), and \(l-1\) singular values of zero. Therefore \(B^\top \) represents the biadjacency matrix of a Ramanujan bigraph.

(2):

Suppose \(l \ge q\). The matrix B has a simple singular value of \(\sqrt{ql}\). Now two subcases need to be considered:

  1. (a)

    When \(l ~\mathrm{mod}~q = 0\), in addition B has \((q-1)q\) singular values of \(\sqrt{l}\) and \(q-1\) singular values of 0.

  2. (b)

    When \(l ~\mathrm{mod}~q \ne 0\), let \(k=l ~\mathrm{mod}~q\). Then B has, in addition, \((q-1)k\) singular values of \(\sqrt{l+q-k}\), \((q-1)(q-k)\) singular values of \(\sqrt{l-k}\), and \(q-1\) singular values of 0.

Therefore, whenever \(l\ge q\), B(ql) represents the biadjacency matrix of a Ramanujan bigraph.

Proof

We note that P is a cyclic shift permutation; therefore \(P^\top = P^{-1}\). The proof of Theorem 3 consists of computing \(BB^\top \), \(B^\top B\) and determining its eigenvalues. Throughout we make use of the fact that \(P^\top = P^{-1}\).

We begin with the case \(l \le q\). Use block-partition notation to divide \(B B^\top \) into l blocks of size \(q \times q\). Then

$$\begin{aligned} (B B^\top )_{ij}= & {} \sum _{s=1}^q P^{(i-1)(s-1)} (P^\top )^{(s-1)(j-1)} \\= & {} \sum _{s=1}^q P^{(i-j)(s-1)} = \sum _{s=0}^{q-1} P^{(i-j)s} . \end{aligned}$$

It readily follows that \( (B B^\top )_{ii} = q I_q , i = 1 , \ldots , q . \) Now observe that, for any nonzero integer k, the set of numbers \(ks ~\mathrm{mod}~q\) as s varies over \(\{ 0 , \ldots , q-1 \}\) equals \(\{ 0 , \ldots , q-1 \}\). (This is where we use the fact that q is a prime number.) Therefore, whenever \(i \ne j\), we have that \( (B B^\top )_{ij} = \sum _{s=0}^{q-1} P^s = \mathbf{1}_{q \times q} , \) where \(\mathbf{1}_{q \times q}\) denotes the \(q \times q\) matrix whose entries are all equal to one. We observe that ql is an eigenvalue of \(B B^\top \), with normalized eigenvector \((1/\sqrt{ql}) \mathbf{1}_{ql}\). Therefore if we define \(M_l = B B^\top - \mathbf{1}_{ql \times ql}\) and partition it commensurately with B, we see that the off-diagonal blocks of \(M_l\) are all equal to zero, while the diagonal blocks are all identical and equal to \(q I_q - \mathbf{1}_{q \times q}\). This is the Laplacian matrix of a fully connected graph with q vertices, and thus has \(q-1\) eigenvalues of q and one eigenvalue of 0. Therefore \(M_l = B B^\top - \mathbf{1}_{ql \times ql}\) has \(l(q-1)\) eigenvalues of q and l eigenvalues of 0. Moreover, \(\mathbf{1}_{ql}\) is an eigenvector of M corresponding to the eigenvalue zero. Therefore \(B B^\top = M_l + \mathbf{1}_{ql} \mathbf{1}_{ql}^\top \) has a single eigenvalue of ql, \(l(q-1)\) eigenvalues of q, and \(l-1\) eigenvalues of 0. This is equivalent to the claim about singular values of \(B^\top \).

Now we study the case where \(l \ge q\). Let \(M_q \in \{0,1\}^{q^2 \times q^2}\) denote the matrix in the previous case with \(l = q\). This matrix can be block-partitioned into \(q \times q\) blocks, with

$$\begin{aligned} (M_q)_{ij} = \left\{ \begin{array}{ll} q I_q - \mathbf{1}_{q \times q} , &{} \text{ if } j-i \equiv 0 ~\mathrm{mod}~q , \\ 0, &{} \text{ otherwise } . \end{array}\right. \end{aligned}$$

Now consider the subcase that \(l \equiv 0 ~\mathrm{mod}~q\). Then \(B^\top B\) consists of l/q repetitions of \(M_q\) on each block row and block column of size \(q^2 \times q^2\). Therefore each such row and column block gives \((q-1)q\) eigenvalues of magnitude l and rest of the eigenvalues will be zero. Next, if \(l ~\mathrm{mod}~q =: k \ne 0\), then \(B^\top B\) consists of \((l-k)/q\) repetitions of \(M_q\) on each block row and column of size \(q^2 \times q^2\). In addition it contains first k column blocks of \(M_q\) concatenated l times column-wise as the last block of columns. It contains first k row blocks of \(M_q\) concatenated \(l-k\) times row-wise as the last block of rows. The extra k rows and columns of \(B^\top B\) give \((q-1)k\) eigenvalues of magnitude \(l+(q-k)\). Another set of row and column blocks gives \((q-1)(q-k)\) eigenvalues of magnitude \(l-k\). The remaining eigenvalues are 0. \(\square \)

Remark

It has been pointed out to the authors by the referee that the construction in Theorem 3 can be viewed as an explicit realization of the results of [20] (in particular [20, Corollary 2.2]). For any positive integers m and n, the complete bipartite graph \(K_{m,n}\) is immediately seen to be a Ramanujan bigraph as its eigenvalues are \(\{\pm \sqrt{mn},\,0\}\). The Ramanujan bigraphs constructed in Items (1) and (2) of Theorem 3 are explicit constructions of q-coverings of \(K_{l,q}\) and \(K_{q,l}\), respectively.

We also note that when \(l = q\), Theorem 3 leads to the following corollary.

Corollary 1

For every prime number q, the matrix B(qq) defined in (6) is the biadjacency matrix of a \((q^2,q^2)\)-bipartite Ramanujan graph with degree q. In this case \(\lambda _1 = q\), and \(\lambda _2 = \sqrt{q}\) with a multiplicity of \(q(q-1)\). The remaining \(q-1\) eigenvalues of B(qq) are zero.

This leads to a new class of \((q^2,q^2)\)-bipartite Ramanujan graphs of degree q. In our terminology, it is a “one-parameter” family. So far as we are able to determine, this family is new and is not contained in any other explicitly known family. However, as pointed out in the remark above, it is an explicit q-covering of the complete graph \(K_q\).

4 Some constructions of Ramanujan graphs

At present there are not too many methods for explicitly constructing Ramanujan graphs. In this section, we reprise most of the known methods. Note that the authors have written Matlab codes for all of the constructions in this section, except the Winnie Li construction in Sect. 4.3; these codes are available upon request.

The available construction methods can be divided into two categories, which for want of a better terminology we call “one-parameter” and “two-parameter” constructions. One-parameter constructions are those for which, once the degree d of the graph is specified, the number n of vertices is also fixed by the procedure. In contrast, two-parameter constructions are those in which it is possible to specify d and n independently. The methods of Lubotzky–Phillips–Sarnak (LPS) and of Gunnells are two-parameter, while those of Winnie Li and Bibak et al. are one-parameter. Of course, not all combinations of d and n are permissible.

Some of the methods discussed here lead to bipartite Ramanujan graphs. It is presumably of interest to show that these constructions in fact lead to nonbipartite Ramanujan graphs. This is done below.

All but one of the constructions described below are Cayley graphs. So we begin by describing that concept. Suppose G is a group, and that \(S \subseteq G\) is “symmetric” in that \(a \in S\) implies that \(a^{-1} \in S\). Then the Cayley graph \(\mathcal {C}(G,S)\) has the elements of G as the vertex set, and the edge set is of the form \((x,xa), x \in G, a \in S\). Due to the symmetry of S, the graph is undirected even if G is noncommutative.

4.1 Lubotzky–Phillips–Sarnak construction

The Lubotzky–Phillips–Sarnak (referred to as LPS hereafter) construction [22] makes use of two unequal primes pq, each of which is \(\equiv 1 ~\mathrm{mod}~4\). As is customary, let \({{\mathbb {F}}}_q\) denote the finite field with q elements, and let \({{\mathbb {F}}}_q^*\) denote the set of nonzero elements in \({{\mathbb {F}}}_q\). The general linear group \(GL(2,{{\mathbb {F}}}_q)\) consists of all \(2 \times 2\) matrices with elements in \({{\mathbb {F}}}_q\) whose determinant is nonzero. If we define an equivalence relation \(\sim \) on \(GL(2,{{\mathbb {F}}}_q)\) via \(A \sim B\) whenever \(A = \alpha B\) for some \(\alpha \in {{\mathbb {F}}}_q^*\), then the resulting set of equivalence classes \(GL(2,{{\mathbb {F}}}_q) / \sim \) is the projective general linear group \(PGL(2,{{\mathbb {F}}}_q)\). Next, it is shown in [22] that there are exactly \(p+1\) solutions of the equation

$$\begin{aligned} p = a_0^2 + a_1^2 + a_2^2 + a_3^2 , \end{aligned}$$
(7)

where \(a_0\) is odd and positive, and \(a_1, a_2, a_3\) are even (positive or negative). Choose an integer \(\mathbf{i}\) such that \(\mathbf{i}^2 \equiv -1 ~\mathrm{mod}~q\). Thus \(\mathbf{i}\) is a proxy for \(\sqrt{-1}\) in the field \({{\mathbb {F}}}_q\). Such an integer always exists.

The LPS construction is a Cayley graph where the group G is the projective general linear group \(PGL(2,{{\mathbb {F}}}_q)\). The generator set S consists of the \(p+1\) matrices

$$\begin{aligned} M_j = \left[ \begin{array}{cc} a_{0j} + \mathbf{i}a_{1j} &{}\quad a_{2j} + \mathbf{i}a_{3j} \\ -a_{2j} + \mathbf{i}a_{3j} &{}\quad a_{0j} - \mathbf{i}a_{1j} \end{array}\right] ~\mathrm{mod}~q , \end{aligned}$$
(8)

as \((a_{0j}, a_{1j}, a_{2j}, a_{3j})\) range over all solutions of (7). Note that each matrix \(M_j\) has determinant \(p ~\mathrm{mod}~q\). It is clear that the LPS graph is \((p+1)\)-regular, and the number of vertices equals the cardinality of \(PGL(2,{{\mathbb {F}}}_q)\), which is \(q(q^2-1)\).

To proceed further, it is necessary to introduce the Legendre symbol. If q is an odd prime and a is not a multiple of q, define

$$\begin{aligned} \left( \frac{a}{q} \right) = \left\{ \begin{array}{ll} 1 &{}\quad \text{ if } \exists x \in {{\mathbb {Z}}} \text{ s.t. } x^2 \equiv a ~\mathrm{mod}~q , \\ -1 &{}\quad \text{ otherwise } \end{array}\right. . \end{aligned}$$

Partition \([q-1] := \{ 1 , \ldots , q-1 \}\) into two subsets, according to

$$\begin{aligned} S_{1,q}:= & {} \left\{ a \in [q-1] : \left( \frac{a}{q} \right) = 1 \right\} , \end{aligned}$$
(9)
$$\begin{aligned} S_{-1,q}:= & {} \left\{ a \in [q-1] : \left( \frac{a}{q} \right) = -1 \right\} . \end{aligned}$$
(10)

Then it can be shown that each set \(S_{1,q}\) and \(S_{-1,q}\) consists of \((q-1)/2\) elements of \([q-1]\). One of the many useful properties of the Legendre symbol is that, for integers \(a,b \in {{\mathbb {Z}}}\), neither of which is a multiple of q, we have \( \big ( \frac{ab}{q} \big ) = \big ( \frac{a}{q} \big ) \big ( \frac{b}{q} \big ) . \) Consequently, for a fixed odd prime number q, the map \( a \mapsto \big ( \frac{a}{q} \big ) : {{\mathbb {Z}}}\setminus q {{\mathbb {Z}}}\rightarrow \{-1,1\}\) is multiplicative. Further details about the Legendre symbol can be found in any elementary text on number theory; see for example [31, Sect. 6.2], or [3, Sect. 5.2.3].

The LPS construction gives two distinct kinds of graphs, depending on whether \( \left( \frac{p}{q} \right) = 1\) or \(-1\). To describe the situation, let us partition \(PGL(2,{{\mathbb {F}}}_q)\) into two disjoint sets \(PSL(2,{{\mathbb {F}}}_q)\) and \(PSL^c(2,{{\mathbb {F}}}_q)\), that are defined next. Partition \(GL(2,{{\mathbb {F}}}_q)\) into two sets \(GL1(2,{{\mathbb {F}}}_q)\) and \(GL2(2,{{\mathbb {F}}}_q)\) as follows:

$$\begin{aligned}&GL1(2,{{\mathbb {F}}}_q) = \{ A \in GL(2,{{\mathbb {F}}}_q) : \mathrm{det}(A) \in S_{1,q} \},\\&GL2(2,{{\mathbb {F}}}_q) = \{ A \in GL(2,{{\mathbb {F}}}_q) : \mathrm{det}(A) \in S_{-1,q} \} , \end{aligned}$$

Because of the multiplicativity of the Legendre symbol, it follows that \(GL1(2,{{\mathbb {F}}}_q)\) is a subgroup of \(GL(2,{{\mathbb {F}}}_q)\). Next, define

$$\begin{aligned}&PSL(2,{{\mathbb {F}}}_q):= GL1(2,{{\mathbb {F}}}_q) / \sim ,\\&PSL^c(2,{{\mathbb {F}}}_q):= GL2(2,{{\mathbb {F}}}_q) / \sim . \end{aligned}$$

Then \(PSL(2,{{\mathbb {F}}}_q)\) and \(PSL^c(2,{{\mathbb {F}}}_q)\) form a partition of \(PGL(2,{{\mathbb {F}}}_q)\), and each set contains \((q(q^2-1))/2\) elements.

Now we come to the nature of the Cayley graph that is generated by the LPS construction.

  • If \( \left( \frac{p}{q} \right) = 1\), then each \(M_j\) maps \(PSL(2,{{\mathbb {F}}}_q)\) onto itself, and \(PSL^c(2,{{\mathbb {F}}}_q)\) into itself. Thus the Cayley graph consists of two disconnected components, each with \((q(q^2-1))/2\) elements. It is shown in [22] that each component is a Ramanujan graph. It is shown below that the two graphs are actually isomorphic.

  • If \( \left( \frac{p}{q} \right) = -1\), then each \(M_j\) maps \(PSL(2,{{\mathbb {F}}}_q)\) onto \(PSL^c(2,{{\mathbb {F}}}_q)\), and vice versa. In this case the Cayley graph of the LPS construction is a balanced bipartite graph, with \((q(q^2-1))/2\) elements in each component. It is shown in [22] that the graph is a bipartite Ramanujan graph. It is shown below that the bipartite graph can be converted to a nonbipartite graph.

4.2 Gunnells’ construction

Next we review the construction in [19]. Suppose q is a prime or a prime power, and as usual, let \({{\mathbb {F}}}_q\) denote the finite field with q elements. Let l be any integer, and view \({{\mathbb {F}}}_{q^l}\) as a linear vector space over the base field \({{\mathbb {F}}}_q\). Then the number of one-dimensional subspaces of \({{\mathbb {F}}}_{q^l}\) equals \( \nu (l,q) := \frac{q^l-1}{q-1} = \sum _{i=0}^{l-1} q^i . \) Let us denote the set of one-dimensional subspaces by \(\mathcal {V}_1\). Correspondingly, the number of subspaces of \({{\mathbb {F}}}_{q^l}\) of codimension one also equals \(\nu (l,q)\). Let us denote this set by \(\mathcal {V}_{l-1}\) because (obviously) every subspace of codimension one has dimension \(l-1\). The Gunnells construction is a bipartite graph with \(\mathcal {V}_1\) and \(\mathcal {V}_{l-1}\) as the two sets of vertices. In this construction, there is an edge between \(\mathcal {S}_a \in \mathcal {V}_1\) and \(\mathcal {T}_b \in \mathcal {V}_{l-1}\) if and only if \(\mathcal {S}_a\) is a subspace of \(\mathcal {T}_b\). The Gunnells construction is a balanced bipartite graph with \( n = |\mathcal {V}_1| = |\mathcal {V}_{l-1}| = \nu (l,q) = \sum _{i=0}^{l-1} q^i , \) vertices and is biregular with degree \( d = \nu (l-1,q) = \sum _{i=0}^{l-2} q^i . \) For ease of reference, we state properties of the Gunnells construction as a theorem.

Theorem 4

(see [19, Theorem 3.2]) The Gunnells graph is a balanced bipartite Ramanujan graph with \(\sigma _1 = \nu (l-1,q)\). Moreover all other singular values of B(lq) have magnitude \(\sqrt{q^{l-2}}\).

It is shown below that the bipartite graph can be converted to a nonbipartite graph.

4.3 Winnie Li’s construction

Suppose G is an Abelian group and let n denote |G|. Then a character \(\chi \) on G is a homomorphism \(\chi : G \rightarrow S^1\), where \(S^1\) is the set of complex numbers of magnitude one. Thus \(\chi (ab) = \chi (a) \chi (b)\) for all \(a,b \in G\). There are precisely n characters on G, and it can be shown that \([\chi (a)]^n = 1\) for each character \(\chi \) and each \(a \in G\). Therefore each character maps an element of G into an n-th root of one. The character defined by \(\chi _0(a) = 1\) for all \(a \in G\) is called the trivial character. Let us number the remaining characters on G as \(\chi _i, i \in [n-1]\) in some manner.

Suppose that S is a symmetric subset of G, and consider the associated Cayley graph. Thus the vertices of the graph are the elements of G, and the edges are \((x,xa), x \in G , a \in S\). Clearly the Cayley graph has n vertices and is d-regular where \(d = |S|\). Now a key result [21, Proposition 1.(1)] states that the eigenvalues of the adjacency matrix are \( \lambda _i = \sum _{s \in S} \chi _i(s), i = 0, 1 , \ldots , n-1 . \) If \(i = 0\), then \(\lambda _0 = d\), which we know (due to regularity). Therefore, if the set S can somehow be chosen in a manner that \( \left| \sum _{s \in S} \chi _i(s) \right| \le 2 \sqrt{d-1} , i \in [n-1] , \) then the Cayley graph would have the Ramanujan property. Several Ramanujan graphs can be constructed using the above approach. In particular, the following construction is described in [21, Sect. 2].

Let \({{\mathbb {F}}}_q\) be a finite field, so that q is a prime or prime power. Let \({{\mathbb {F}}}_{q^2}\) be a degree 2 extension of \({{\mathbb {F}}}_q\) and choose S to be the set of all primitive elements of \({{\mathbb {F}}}_{q^2}\), that is, the set of elements of multiplicative norm 1. Here, the multiplicative norm of \(\alpha \in {{\mathbb {F}}}_{q^2}\) is defined as \( N(\alpha ) := \alpha \cdot \alpha ^q = \alpha ^{q+1}. \)

Note that S is symmetric and contains \(q+1\) elements. A deep and classical theorem due to Deligne [13] states that for every nontrivial character \(\chi _i, i \ge 1\) on the additive group of \({{\mathbb {F}}}_{q^2}\), we have \( \left| \sum _{s \in S} \chi _i(s) \right| \le 2 \sqrt{q} , i \in [q^2-1] . \) Therefore the Cayley graph with \({{\mathbb {F}}}_{q^2}\) as the group and S as the generator set has the Ramanujan property.

4.4 Bibak et al. construction

The next construction is found in [6]. Suppose q is a prime \(\equiv 3 ~\mathrm{mod}~4\). Let G be the additive group \({{\mathbb {F}}}_{q^2}\), consisting of pairs \(z = (x,y)\) where \(x,y \in {{\mathbb {F}}}_q\). Clearly \(n = |G| = q^2\). The “norm” of an element z is defined as \(( x^2 + y^2 ) ~\mathrm{mod}~q\), and the set S consists of all z such that the norm equals one. It can be shown that \(|S| = q+1\) and that S is symmetric. It is shown in [6] that the associated Cayley graph has the Ramanujan property.

5 Further analysis of earlier constructions

It is seen from Sect. 4 that if \( \left( \frac{p}{q} \right) = 1\), then the LPS construction leads to a disconnected graph, consisting of two components with an equal number of vertices (and edges). It would be of interest to know whether the two connected components are isomorphic to each other, that is, whether LPS construction leads to two distinct Ramanujan graphs, or just one. In general, determining whether two graphs are isomorphic is in the class NP, (so that it is easy to determine whether a candidate solution is in fact a solution). The best available algorithm [2] provides a “quasi-polynomial-time” algorithm to solve this problem. Therefore in the worst case, the problem is not trivial. This of course does not prevent specific instances of the graph isomorphism problem from being easy to solve. Indeed, in the case of the two components of an LPS construction, one can readily demonstrate that the two graphs are isomorphic. Next, if the Legendre symbol \( \left( \frac{p}{q} \right) = -1\), the LPS construction leads to a bipartite Ramanujan graph. The Gunnells construction always leads to a bipartite Ramanujan graph. Graph theorists prefer nonbipartite (or “real”) Ramanujan graphs to bipartite Ramanujan graphs. It is easy to show that every Ramanujan graph leads to a bipartite Ramanujan graph. Specifically, suppose \((\mathcal {V},\mathcal {E})\) is a Ramanujan graph with adjacency matrix A. Define two sets \(\mathcal {V}_r, \mathcal {V}_c\) to be copies of \(\mathcal {V}\), and define an edge \((v_{ri},v_{cj})\) in the bipartite graph if and only if there is an edge \((v_i,v_j)\) in the original graph. Then it is obvious that the biadjacency matrix of this bipartite graph is also A. Hence the bipartite graph is a bipartite Ramanujan graph if and only if the original graph also has the Ramanujan property. However, the converse is not necessarily true. Indeed, it is not yet known whether the bipartite graphs constructed in [25] can be turned into nonbipartite graphs. Therefore it is of some interest to show that the bipartite constructions of LPS and Gunnels can indeed be turned into nonbipartite graphs.

Suppose that there is a balanced bipartite graph with vertex sets \(\mathcal {V}_r\) and \(\mathcal {V}_c\) and edge set \(\mathcal {E}\subseteq \mathcal {V}_r \times \mathcal {V}_c\). In order to convert this bipartite graph into a nonbipartite graph, it is necessary and sufficient to find a one-to-one and onto map \(\pi : \mathcal {V}_c \rightarrow \mathcal {V}_r\) (which is basically a permutation), such that whenever there is an edge \((v_i,v_j)\) in the bipartite graph, there is also an edge \((\pi ^{-1}(v_j),\pi (v_i))\). In this way, the “right” vertex set can be identified with its image under \(\pi \) and the result would be an undirected nonbipartite graph. Moreover, it is easy to show that, if B is the biadjacency matrix of the original graph, and A is the adjacency matrix of the nonbipartite graph, then \(A = B \Pi \) where \(\Pi \) is the matrix representation of \(\pi \). Thus the eigenvalues of A are the singular values of B, which implies that if the bipartite graph has the Ramanujan property, so does the nonbipartite graph.

With this background, in the present section we first remark that, when \( \left( \frac{p}{q} \right) = 1\), the two connected components of the LPS construction are isomorphic. Indeed, choose any \(A \in PGL(2,{{\mathbb {F}}}_q)\) such that \(\mathrm{det}(A) \in S_{-1,q}\), and define the map \(\pi : PSL(2,{{\mathbb {F}}}_q)\rightarrow PSL^c(2,{{\mathbb {F}}}_q)\) via \(X \mapsto AX\). Then the edge incidence is preserved.

Next we show that, when \( \left( \frac{p}{q} \right) = -1\), the resulting LPS bipartite graph can be mapped into a (nonbipartite) Ramanujan graph. For this purpose we establish a preliminary result.

Lemma 1

There exists a matrix \(A \in GL2(2,{{\mathbb {F}}}_q)\) such that \(A^2 \sim I_{2 \times 2}\).

Proof

Choose elements \(\alpha ,\beta ,\gamma \in {{\mathbb {F}}}_q\) such that \(-(\alpha ^2 + \beta \gamma ) \in S_{-1,q}\). This is easy: Choose an arbitrary \(\delta \in S_{-1,q}\), arbitrary \(\alpha \in {{\mathbb {F}}}_q\), \(\gamma = -1\), and \(\beta = \alpha ^2 + \delta \). Now define

$$\begin{aligned} A = \left[ \begin{array}{cc} \alpha &{}\quad \beta \\ \gamma &{}\quad -\alpha \end{array}\right] . \end{aligned}$$
(11)

Then

$$\begin{aligned} A^2 = \left[ \begin{array}{cc} \alpha &{}\quad \beta \\ \gamma &{}\quad -\alpha \end{array}\right] \left[ \begin{array}{cc} \alpha &{}\quad \beta \\ \gamma &{}\quad -\alpha \end{array}\right] = \left[ \begin{array}{cc} \alpha ^2 + \beta \gamma &{}\quad 0 \\ 0 &{}\quad \alpha ^2 + \beta \gamma \end{array}\right] . \end{aligned}$$

Hence \(A^2 \sim I\). Clearly \(\mathrm{det}(A) = -(\alpha ^2 + \beta \gamma ) \in S_{-1,q}\). \(\square \)

Theorem 5

Suppose \( \left( \frac{p}{q} \right) = - 1\), and consider the bipartite Ramanujan graph \(\mathcal {C}(PGL(2,{{\mathbb {F}}}_q),S)\). Then there exists a map \(\pi : PSL(2,{{\mathbb {F}}}_q)\rightarrow PSL^c(2,{{\mathbb {F}}}_q)\) that is one-to-one and onto such that, whenever there is an edge (XZ) with \(X \in PSL(2,{{\mathbb {F}}}_q)\) and \(Z \in PSL^c(2,{{\mathbb {F}}}_q)\), there is also an edge \((\pi ^{-1}(Z),\pi (X))\).

Proof

For a matrix \({\bar{X}}\in GL(2,{{\mathbb {F}}}_q)\), let \([{\bar{X}}] \in PGL(2,{{\mathbb {F}}}_q)\) denote its equivalence class under \(\sim \). Construct the matrix as in Lemma 1. Suppose there exists an edge (XZ) with \(X \in PSL(2,{{\mathbb {F}}}_q)\) and \(Z \in PSL^c(2,{{\mathbb {F}}}_q)\). Thus there exist representatives \({\bar{X}}\in GL1(2,{{\mathbb {F}}}_q), {\bar{Z}}\in GL2(2,{{\mathbb {F}}}_q)\) and an index \(i \in [p+1]\) such that \({\bar{Z}}\sim {\bar{X}}M_i\). Now observe that if \((a_0,a_1,a_2,a_3)\) solves (7), then \((a_0,-a_1,-a_2,-a_3)\) also solves (7). By examining the definition of the matrices \(M_j\) in (8), it is clear that for every index \(i \in [p+1]\), there exists another index \(j \in [p+1]\) such that \(M_i M_j \sim I\). Now define \({\bar{Y}}= A {\bar{Z}}\) and note that \({\bar{Y}}\sim A^{-1} {\bar{Z}}\) because \(A^2 \sim I\). Also, \({\bar{Y}}\in GL1(2,{{\mathbb {F}}}_q)\) because \({\bar{Z}}\in GL2(2,{{\mathbb {F}}}_q)\) and \(\mathrm{det}(A) \in S_{-1,q}\). By assumption \({\bar{Z}}\sim {\bar{X}}M_i\). So \(A {\bar{Z}}\sim A {\bar{X}}M_i\). Now choose the index \(j \in [p+1]\) such that \(M_i M_j \sim I\). Then \( {\bar{Y}}M_j = A {\bar{Z}}M_j \sim A {\bar{X}}M_i M_j \sim A {\bar{X}}. \) Hence there is an edge from \([ {\bar{Y}}] = \mathcal {A}^{-1}(Z)\) to \([ A {\bar{X}}] = \mathcal {A}(X)\). \(\square \)

Theorem 6

The Gunnells construction can be converted into a nonbipartite Ramanujan graph of degree \(d = \nu (l-1,q)\) and \(n = \nu (l,q)\) vertices.

Proof

As before, it suffices to find a one-to-one and onto map \(\pi \) from \(\mathcal {V}_{l-1}\) to \(\mathcal {V}_1\) such that, if there is an edge \((\mathcal {S},\mathcal {T})\) where \(S \in \mathcal {V}_1\) and \(\mathcal {T}\in \mathcal {V}_{l-1}\), then there is also an edge \((\pi (\mathcal {T}),\pi ^{-1}(\mathcal {S}))\). Accordingly, if \(\mathcal {T}\in \mathcal {V}_{l-1}\), so that \(\mathcal {T}\) is a subspace of codimension one, define \(\pi (\mathcal {T})\) to be an “annihilator” \(\mathcal {T}^\perp \) of \(\mathcal {T}\), consisting of all vectors \(v \in {{\mathbb {F}}}_q^l\) such that \(v^\top u = 0\) for every \(u \in \mathcal {T}\). Then \(\mathcal {T}^\perp \) is a one-dimensional subspace of \({{\mathbb {F}}}_q^l\) and thus belongs to \(\mathcal {V}_1\). Moreover, for \(\mathcal {S}\in \mathcal {V}_1\), we have that \(\pi ^{-1}(\mathcal {S}) = \mathcal {S}^\perp \). It is obvious that this map is one-to-one and onto. Now suppose there is an edge \((\mathcal {S},\mathcal {T})\) where \(S \in \mathcal {V}_1\) and \(\mathcal {T}\in \mathcal {V}_{l-1}\). This is the case if and only if \(\mathcal {S}\subseteq \mathcal {T}\). But this implies that \(\mathcal {T}^\perp \subseteq \mathcal {S}^\perp \). Hence there is an edge from \(\pi (\mathcal {T})\) to \(\pi ^{-1}(\mathcal {S})\). \(\square \)

6 Computational aspects of various constructions

In this section, we discuss some of the implementation details of constructing Ramanujan graphs using the various methods discussed in Sect. 4. The authors have written Matlab codes for all of these implementations except the Winnie Li construction, which can be made available upon request. One of the objectives of this discussion is to compare and contrast the amount of work involved in actually constructing the various classes of graphs.

6.1 Our new construction

We begin by noting that the biadjacency matrix of the Ramanujan bigraphs presented in Sect. 3 is quite explicit, and does not require any work: One simply specifies a prime number q and an integer \(l \ge 2\), and the biadjacency matrix is obtained at once from (6). We now discuss the remaining constructions, in the order of increasing complexity of implementation.

For the Bibak construction, we simply enumerate all vectors in \({{\mathbb {Z}}}_q^2\), compute all of their norms, and identify the elements of norm one. Again, for \(q \le 103\), this works quite well.

6.2 Gunnells construction

For the Gunnells construction, the vertex set is the set of one-dimensional subspaces of \({{\mathbb {F}}}_{q^l}\). For this purpose we identify \({{\mathbb {F}}}_{q^l}\) with \({{\mathbb {F}}}_q^l\), the set of l-dimensional vectors over \({{\mathbb {F}}}_q\). To enumerate these, observe that there are \(q^l-1\) nonzero vectors in \({{\mathbb {F}}}_q^l\). For any nonzero vector, there are \(q-1\) nonzero multiples of it, but all these multiples generate the same subspace. Therefore the number of one-dimensional subspaces is \( \frac{q^l-1}{q-1} = \sum _{i=0}^{l-1} q^i . \) To enumerate these subspaces without duplications, we proceed as follows: In step 1, fix the first element of a vector \(x \in {{\mathbb {F}}}_q^l\) to 1, and let the elements \(x_2\) through \(x_l\) be arbitrary. This generates \(q^{l-1}\) nonzero vectors that generate distinct subspaces. In step 2, fix \(x_1 = 0\), \(x_2 = 1\), and \(x_3\) through \(x_l\) be arbitrary. This generates \(q^{l-2}\) nonzero vectors that generate distinct subspaces, and so on. To construct the edge set, suppose xy are two nonzero generating vectors defined as above (which could be equal). Then the one-dimensional subspace generated by x is contained in the one-dimensional subspace annihilated by y if and only if \(y^\top x \equiv 0 ~\mathrm{mod}~q\).

6.3 LPS construction

In order to implement this construction, it is desirable to have systematic enumerations of the projective groups \(PGL(2,{{\mathbb {F}}}_q)\), \(PSL(2,{{\mathbb {F}}}_q)\), and \(PSL^c(2,{{\mathbb {F}}}_q)\). The approach used by us is given next. Define

$$\begin{aligned} \mathcal {M}_1&= \left\{ \left[ \begin{array}{cc} 0 &{}\quad 1 \\ g &{}\quad h \end{array}\right] : g \in {{\mathbb {F}}}_q^*, h \in {{\mathbb {F}}}_q\right\} ,\\ \mathcal {M}_2&= \left\{ \left[ \begin{array}{cc} 1 &{}\quad f \\ g &{}\quad h \end{array}\right] : f , g \in {{\mathbb {F}}}_q^*, h - fg \in {{\mathbb {F}}}_q^*\right\} . \end{aligned}$$

Then every matrix in \(GL(2,{{\mathbb {F}}}_q)\) is equivalent under \(\sim \) to exactly one element of \(PGL(2,{{\mathbb {F}}}_q)\). Specifically, let \(A \in GL(2,{{\mathbb {F}}}_q)\) be arbitrary. If \(a_{11} = 0\), then \(A \sim (a_{12})^{-1} A \in \mathcal {M}_1\), whereas if \(a_{11} \ne 0\), then \(A \sim (a_{11})^{-1} A \in \mathcal {M}_2\). The rest of the details are easy and left to the reader. This provides an enumeration of \(PGL(2,{{\mathbb {F}}}_q)\). To provide an enumeration of \(PSL(2,{{\mathbb {F}}}_q)\), we modify the sets as follows:

$$\begin{aligned} \mathcal {M}_{1,1}&= \left\{ \left[ \begin{array}{cc} 0 &{}\quad 1 \\ g &{}\quad h \end{array}\right] : g \in S_{1,q}, h \in {{\mathbb {F}}}_q\right\} ,\\ \mathcal {M}_{2,1}&= \left\{ \left[ \begin{array}{cc} 1 &{}\quad f \\ g &{}\quad h \end{array}\right] : f , g \in {{\mathbb {F}}}_q^*, h - fg \in S_{1,q} \right\} ,\\ \mathcal {M}_{1,-1}&= \left\{ \left[ \begin{array}{cc} 0 &{}\quad 1 \\ g &{}\quad h \end{array}\right] : g \in S_{-1,q}, h \in {{\mathbb {F}}}_q\right\} ,\\ \mathcal {M}_{2,-1}&= \left\{ \left[ \begin{array}{cc} 1 &{}\quad f \\ g &{}\quad h \end{array}\right] : f , g \in {{\mathbb {F}}}_q^*, h - fg \in S_{-1,q} \right\} . \end{aligned}$$

Then the set of matrices \(\mathcal {M}_{1,1} \cup \mathcal {M}_{2,1}\) provides an enumeration of \(PSL(2,{{\mathbb {F}}}_q)\), while the set of matrices \(\mathcal {M}_{1,-1} \cup \mathcal {M}_{2,-1}\) provides an enumeration of \(PSL^c(2,{{\mathbb {F}}}_q)\). Once the vertex sets are enumerated, each representative matrix of an element in \(PGL(2,{{\mathbb {F}}}_q)\) is multiplied by each generator matrix \(M_1\) through \(M_{p+1}\), and then converted to one of the above representations, depending on whether the (1, 1)-element is zero or nonzero.

In the original LPS construction, it is assumed that \(p < q\). However, the LPS construction can still be used with \(p > q\),Footnote 4 provided that the \(p+1\) generating matrices \(M_1\) through \(M_{p+1}\) are distinct elements of \({{\mathbb {F}}}_q^{2 \times 2}\). In our implementation, we handle the case \(p > q\) by verifying whether this is indeed the case.

6.4 Winnie Li construction

As mentioned earlier, the fact that the Winnie Li construction leads to a Ramanujan graph is based on a deep result of [13]. However, it is still a challenge to construct this graph explicitly. The main difficulty is that as yet there is no polynomial-time algorithm to find all elements of the generator set S of a finite field \({{\mathbb {F}}}_q\). Suppose that \(q = p^r\) where p is a prime number and r is an integer. Then the best available algorithm [30] returns one primitive element of the field \({{\mathbb {F}}}_q\) in time \(O(p^{(r/4)+\epsilon })\) for arbitrarily small \(\epsilon \). Recall that, for an algorithm for integer computations to be considered as “polynomial-time,” its running time has to be \(O(\lceil \log _2 q \rceil )\). Thus, for the moment there are no efficient algorithms for implementing the Winnie Li construction. However, for relatively small values of q (say 101 or less), it is still feasible to execute “nonpolynomial” algorithms, basically just enumeration of all possibilities. The approach adopted by us to implement this construction is described next.

This construction requires more elaborate computation. The main source of difficulty is that as of now there is no polynomial-time algorithm for finding a primitive element in a finite field. The best-known algorithm to date is due to [30], which finds a primitive element of \({{\mathbb {F}}}_{p^l}\) in time \(O(p^{(l/4)+\epsilon })\). Thus, for really large primes q, the Li construction would be difficult to implement. At present, “realistic” matrix completion problems such as the Netflix problem could potentially have millions of columns. However, many if not most practical examples are of size \(10^4 \times 10^4\). Since the graphs in the Li construction have \(q^2\) vertices, it is reasonable to focus on the much narrower problem of finding a primitive element in the field \({{\mathbb {F}}}_q\) when q is a prime \(\le 101\). For this purpose we follow a simple enumeration procedure.

  1. 1.

    We identify an irreducible polynomial \(\phi (x)\) of degree 2 in \({{\mathbb {F}}}_q[x]\). For instance, if \(q \equiv 5 ~\mathrm{mod}~8\), then \(x^2 + 2\) is irreducible. In particular, \(x^2 + 2\) is an irreducible polynomial in \({{\mathbb {F}}}_{13}[x]\). Other irreducible polynomials are known for other classes of prime numbers. In the worst case, an irreducible polynomial can be found by enumerating all polynomials of degree 2 in \({{\mathbb {F}}}_q[x]\), and then deleting all products of the form \((x-a)(x-b)\) where \(a,b \in {{\mathbb {F}}}_q\). This would leave \((q(q-1))/2\) irreducible polynomials, but we can use any one of them. Note that the worst-case complexity of this approach is \(O(q^2)\).

  2. 2.

    Once this is done, \({{\mathbb {F}}}_{q^2}\) is isomorphic to the quotient field \({{\mathbb {F}}}_q[x]/(\phi (x))\). Let us denote \({\overline{x}} = x + (\phi (x))\). Then the elements of \({{\mathbb {F}}}_{q^2}\) can be expressed as \( a {\overline{x}} + b, \, a, \, b \in {{\mathbb {F}}}_{q}. \)

  3. 3.

    To determine the set of units S in the field \({{\mathbb {F}}}_{q^2}\), we have to find all elements \(\alpha \) in \({{\mathbb {F}}}_{q^2}^*\) such that \(\alpha ^{q+1} = 1\). Now, if \(\beta \) is a primitive element of the \({{\mathbb {F}}}_{q^2}^*\), then \( {{\mathbb {F}}}_{q^2}^* = \{\beta ^{m}, \, 1 \le m \le q^2-1\}. \) Among the elements of \({{\mathbb {F}}}_{q^2}^*\), the units are precisely the roots of \(\alpha ^{q+1} = 1\). With the above enumeration, we get \( S = \{\beta ^{k(q-1)},\,1 \le k \le q+1\}. \)

  4. 4.

    We now enumerate all elements in the multiplicative group \({{\mathbb {F}}}_{q^2}\) and test each element to see if it is a primitive element. To ensure that \(g \in {{\mathbb {F}}}_{q^2}^*\) is a primitive element, it is sufficient to check that \(g^{\frac{q^2 - 1}{l}} \ne 1\) for any prime divisor l of \(q^2 - 1\). Because \(q^2 - 1 = (q-1)(q+1)\), the prime divisors of \(q^2-1\) are 2 and the other prime divisors of \(q-1\) and \(q+1\). For example, with \(q = 13\), the prime divisors of \(q^2-1\) are \(l = 2, 3, 7\), with the corresponding values \(k = (q^2-1)/l = 84, 56, 24\). Therefore if \(g^k \ne 1\) for these values of k, then g is a primitive element. There are also efficient ways to raise a field element to large powers, for example, by expanding the power to the base 2. One can check that \(g = {\overline{x}} + 1\) is a primitive element of the field \({{\mathbb {F}}}_{13^2}\).

  5. 5.

    Once a primitive element \(g \in {{\mathbb {F}}}_{q^2}\) is determined, the generator set S equals \(\{ g^{(q-1)k} , k \in [q+1] \}\). Thus we can construct the Cayley graph \(\mathcal {C}({{\mathbb {F}}}_{q^2},S)\) as follows: Each vertex \(a{\overline{x}} + b\) is connected to the vertices \( \{a{\overline{x}} + b + g^{(q-1)k}, k \in [q+1] \}. \) In this way we can construct a \((q+1)\)-regular Ramanujan graph with \(q^2\) vertices.

Note that, in the worst case, the Winnie Li construction cannot be implemented by any poly-time algorithm. The above are just some shortcuts that may or may not work for specific values of q.

7 Construction of Ramanujan graphs with “prohibited” edges

7.1 Problem statement and motivation

Suppose we are given vertex sets \(\mathcal {V}_r, \mathcal {V}_c\), where \(|\mathcal {V}_r|\) need not equal \(|\mathcal {V}_c|\). Denote \(|\mathcal {V}_r| = n_r, |\mathcal {V}_c| = n_c\). We are also given degrees \(d_r, d_c\), as well as a set \(\mathcal {M}\subseteq \mathcal {V}_r \times \mathcal {V}_c\), known as the set of prohibited edges. The objective is to construct a bipartite Ramanujan graph of degrees \((d_r,d_c)\), but with the added restriction that the edge set \(\mathcal {E}\) must be disjoint from \(\mathcal {M}\).

The motivation for this problem arises from an engineering application known as “matrix completion with missing measurements.” The conventional matrix completion problem can be stated as follows: Suppose \(X \in {{\mathbb {R}}}^{n_r \times n_c}\) is a matrix that is unknown other than a known upper bound r on its rank. The learner is able to choose a “sample set” \(\Omega \subseteq [n_r] \times [n_c]\), and can measure \(X_{ij}\) for all \((i,j) \in \Omega \). From these measurements, and the information that \(\mathrm{{rank}}(X) \le r\), the learner aspires to determine the unknown matrix X exactly. The most widely used approach, introduced in [9, 29], is the following: Let \( \Vert X \Vert _N \) denote the nuclear norm of a matrix, namely the sum of its singular values. Given the measurement set \(X_{ij}, (i,j) \in \Omega \), define

$$\begin{aligned} {\hat{X}}:= \mathop {\mathrm{argmin}}\limits _{Z \in {{\mathbb {R}}}^{n_r \times n_c}} \Vert Z \Vert _N \text{ s.t. } Z_{ij} = X_{ij} \; \forall (i,j) \in \Omega . \end{aligned}$$
(12)

Thus one finds the matrix \({\hat{X}}\) that has minimum nuclear norm while being consistent with the measurements. The problem (12) is a convex optimization problem subject to linear constraints; so it can be solved efficiently even for relatively large-sized matrices. However, the key question is: Is the solution \({\hat{X}}\) of (12) equal to the unknown matrix X? To put it another way, can an unknown matrix of low rank be recovered by sampling a few entries and then carrying out nuclear norm minimization?

It is clear that the choice of the sample set \(\Omega \) plays a crucial role in any analysis of the matrix completion problem. In almost all papers, starting with [9], it is assumed that \(\Omega \) is determined by sampling the elements of X uniformly and at random. Then it is shown that, if the number of samples \(|\Omega |\) is sufficiently large, then with high probability \({\hat{X}}\) does indeed equal X. A significant departure is made in a recent paper by a subset of the present authors [8], where the sample set \(\Omega \) is chosen in a deterministic fashion, as the edge set of a Ramanujan bigraph. In [8] a sufficient condition is derived for the solution of (12) to equal X.

While [8] gives the first deterministic solution to the matrix completion problem, it does not address the issue of “missing measurements.” In any real-life application of matrix completion, it is a fact that a few elements of the matrix X are “missing” and thus cannot be measured. This is the set \(\mathcal {M}\subseteq [n_r] \times [n_c]\). Therefore, in applying nuclear norm minimization, it is essential to ensure that the “sample set” \(\Omega \) is disjoint from the missing measurements, that is, the set \(\mathcal {M}\) of prohibited edges. If the elements of X are sampled at random, as suggested in [9, 29], then one can simply omit the elements of \(\mathcal {M}\) while sampling. However, if a Ramanujan graph is constructed using one of the methods outlined in earlier sections, it is not possible to guarantee a priori that the resulting edge set \(\Omega \) and the prohibited edge set \(\mathcal {M}\) will be disjoint.

This now brings us to a formal statement of the missing measurement problem in Ramanujan bigraphs. Suppose that we have constructed a \((d_r,d_c)\)-biregular Ramanujan bigraph with \(n_r, n_c\) vertices. This graph can be described in one of two equivalent ways: First, its biadjacency matrix \(E \in \{0,1\}^{n_r \times n_c}\), and second, its edge set \(\Omega \) which consists of all (ij) such that \(E_{ij} = 1\). It is tacitly understood that the construction might impose some constraints on the four numbers \(d_r, d_c, n_r , n_c\). Next, suppose that the set of prohibited edges \(\mathcal {M}\subseteq [n_r] \times [n_c]\) is also specified. In applications, the set \(\mathcal {M}\) has quite small cardinality. If \(\Omega \) and \(\mathcal {M}\) are disjoint sets, then there is nothing to be done. On the other hand, if \(\Omega \) and \(\mathcal {M}\) have some overlap, the question is: Is it possible to “perturb” the biadjacency matrix E in such a manner that the corresponding graph has no edges in the set \(\mathcal {M}\), and is still a \((d_r,d_c)\)-biregular Ramanujan bigraph? Note that we could have phrased the problem differently: Suppose integers \(d_r, d_c, n_r, n_c\) and a set \(\mathcal {M}\subseteq [n_r] \times [n_c]\) are specified. Is it possible to construct a \((d_r,d_c)\)-biregular Ramanujan graph such that no element of \(\mathcal {M}\) is an edge? Our method of framing the question suggests our proposed approach: We first construct a Ramanujan bigraph without worrying about the set \(\mathcal {M}\), and afterwards worry about “perturbing” the Ramanujan bigraph so as to eliminate the edges in \(\mathcal {M}\) (if any) and replace them by others, while still retaining biregularity and the Ramanujan property. Since the underlying assumption (motivated by real-life applications) is that the set \(\mathcal {M}\) is quite small, this approach makes sense.

7.2 Perturbations of Ramanujan graphs

Let \( \mathcal {M}= \{(i_1,j_1),\,(i_2,j_2),\dots \,(i_s,j_s)\} \subseteq [n_r] \times [n_c] \) denote the set of prohibited edges. Now suppose we have constructed a \((d_r,d_c)\)-biregular Ramanujan graph with biadjacency matrix E and edge set \(\Omega \). If \(\Omega \cap \mathcal {M}= \emptyset \), then there is nothing for us to do. If on the other hand the intersection is nonempty, then we modify E to another matrix \(E_p = E + \Delta _+ - \Delta _-\) where \(\Delta _- , \Delta _+ \in \{0,1\}^{n_r \times n_c}\) such that \(E_p \in \{0,1\}^{n_r \times n_c}\), and also corresponds to a \((d_r,d_c)\)-biregular Ramanujan graph. There are two distinct issues here: Ensuring that \(E_p \in \{0,1\}^{n_r \times n_c}\) and is \((d_r,d_c)\)-biregular, and ensuring that \(E_p\) represents a Ramanujan graph. The two questions are treated sequentially. We begin with perturbing the graph to ensure \((d_r,d_c)\)-biregularity while avoiding prohibited edges.

To recapitulate, given a matrix E and corresponding edge set \(\Omega \), the problem is to choose \(\Delta _- , \Delta _+ \in \{0,1\}^{n_r \times n_c}\) such that \(E_P := E + \Delta _+ - \Delta _-\) is also \((d_r,d_c)\)-biregular while avoiding prohibited edges. This requires, among other things, that

$$\begin{aligned} \mathrm{{supp}}(\Delta _-) \subseteq \Omega , \text{ and } \Omega \cap \mathcal {M}\subseteq \mathrm{{supp}}(\Delta _-) , \end{aligned}$$
(13)

and

$$\begin{aligned} \mathrm{{supp}}(\Delta _+) \cap \Omega = \emptyset , \text{ and } \mathrm{{supp}}(\Delta _+) \cap \mathcal {M}= \emptyset . \end{aligned}$$
(14)

Here, (13) ensures that \(\Delta _-\) is a submatrix of E, and that by subtracting the edges in \(\mathrm{{supp}}(\Delta _-)\) from \(\Omega \), we eliminate all prohibited edges. Note that we do not insist that \(\Omega \cap \mathcal {M}= \mathrm{{supp}}(\Delta _-)\). In other words, in the process of eliminating some prohibited edges, we may perhaps also remove other edges that are not prohibited. Clearly this does not matter. Along similar lines, (14) ensures that only new edges are added, and that these edges are not prohibited.

Lemma 2 presented next gives a very simple sufficient condition and a recipe for choosing \(\Delta _-,\Delta _+\) provided that \(\mathcal {M}\) satisfies certain conditions. It can definitely be improved, but in the case of matrix completion with missing measurements, it is good enough.

Lemma 2

Suppose that, for each index \(i \in [n_r]\), the set \(\{ j \in [n_c]: (i,j) \in \mathcal {M}\}\) has cardinality no more than p, and similarly, for each index \(j \in [n_c]\), the set \(\{ i \in [n_r]: (i,j) \in \mathcal {M}\}\) has cardinality no more than p. Let \(\theta _c\) denote the maximum inner product between any two distinct columns of E. Suppose it is the case that

$$\begin{aligned}&2p \le n_c - d_r , \end{aligned}$$
(15)
$$\begin{aligned}&2 p - 1 \le d_c - \theta _c. \end{aligned}$$
(16)

Then we can choose \(\Delta _-, \Delta _+ \in \{0,1\}^{n_r \times n_c}\) such that (13) and (14) hold.

Proof

We introduce a few symbols to streamline the presentation. In analogy with the notation introduced earlier, define \( \mathrm{{supp}}(i) := \{ j \in [n_c] : E_{ij} = 1 \}, \) \( \mathrm{{supp}}(j) := \{ i \in [n_r] : E_{ij} = 1 \}, \)

$$\begin{aligned} \mathcal {N}_r(i)&: =&\{ j \in [n_c] : (i,j) \in \Omega \cap \mathcal {M}\}\quad \; \forall i \in [n_r] . \end{aligned}$$
(17)
$$\begin{aligned} \mathcal {N}_c(j)&: =&\{ i \in [n_r] : (i,j) \in \Omega \cap \mathcal {M}\}\quad \; \forall j \in [n_c] . \end{aligned}$$
(18)

Order the elements of \([n_r],[n_c]\) in some fashion. Ascending order is as good as any, and it will play no role in the proof other than simplifying notation. So we use that. Apply the procedure below for each \(i \in [n_r]\), in sequential order. If the set \(\mathcal {N}_r(i)\) is empty, move to the next row. Suppose \(\mathcal {N}_r(i)\) is nonempty, and define \(p_i = | \mathcal {N}_r(i) |\). Since \(p_i \le p\) for each i, we simplify notation by using p instead of \(p_i\).

Recall the definition of the set \(\mathcal {N}_r(i)\). Enumerate the set as \(\{ (i,j_1) , \ldots , (i,j_p) \}\), and observe that \(E_{i,j_l} = 1\) for all l. Note that row i contains precisely \(d_r\) columns with a 1 (including of course \(E_{ij_1}\)), and therefore \(n_c - d_r\) columns with zeros. Among these, a maximum of p can be such that \((i,j) \in \mathcal {M}\). Therefore, if \(n_c - d_r \ge 2p\), then we can find indices \({\bar{j}}_l, 1 \le l \le p\) such that \( E_{i,{\bar{j}}_l} = 0, \text{ and } (i,{\bar{j}}_l) \not \in \mathcal {M}, 1 \le l \le p . \)

Next, fix a specific index \({\bar{j}}_l\), and compare the columns \(E_{j_l}\) and \(E_{{\bar{j}}_l}\). It is now shown that it is possible to find a subset \(\mathcal {I}_{{\bar{j}}_l} = \{ {\bar{i}}_1 = i , {\bar{i}}_2 , \ldots , i_p \} \subseteq [n_r]\) such that

$$\begin{aligned} E_{{\bar{i}}_k {\bar{j}}_l}&= 1,\quad k = 1 , \ldots , p , \end{aligned}$$
(19)
$$\begin{aligned} E_{{\bar{i}}_k j_l}&= 0,\quad k = 1 , \ldots , p . \end{aligned}$$
(20)
$$\begin{aligned} | \mathcal {I}_{{\bar{j}}_l} |&= p , \end{aligned}$$
(21)
$$\begin{aligned} ({\bar{i}}_k , j_l)&\not \in \mathcal {M},\quad 1 \le k \le p . \end{aligned}$$
(22)

To establish this, we observe that, by assumption, we have that \( \langle E_{j_l} , E_{{\bar{j}}_l} \rangle \le \theta _c\). So, as a first cut, define \(\mathcal {I}_1({\bar{j}}_l) = \mathrm{{supp}}({\bar{j}}_l)\). This set consists of \(d_c\) elements (and does not include i). Now examine the values \(E_{i_k{\bar{j}}_l}\). By the inner product constraint, out of the \(d_c\) nonzero elements of \(\mathcal {I}_1({\bar{j}}_l)\), no more than \(\theta _c\) can be nonzero (in column \(j_1\)). Hence there are at least \(d_c - \theta _c\) elements in column \(j_l\) such that \(E_{i_kj_l} = 0\) and \(E_{i_k {\bar{j}}_l} = 1\). Out of these, at most \(p-1\) elements can have the property that \((i_k,j_l) \in \mathcal {M}\). Note that \(E_{ij_1} = 0\), but i is not on this list. Therefore, if \(d_c - \theta _c - (p - 1) \ge p\), that is, \(d_c - \theta _c \ge 2p - 1\), then we can choose any p elements from whatever remains of the set \(\mathcal {I}_1({\bar{j}}_l)\) and call it the set \(\mathcal {I}({\bar{j}}_l)\). Now the above-claimed properties follow by inspection.

To complete the proof, we remove each prohibited edge \(E_{ij_l}\) as follows: We choose any one element from \(\mathcal {I}({\bar{j}}_l)\), call it \({\bar{i}}_l\) and simply “flip” the zeros and ones. Thus we set

$$\begin{aligned} (E_p)_{ij_l}= & {} 0,\quad (E_p)_{{\bar{i}}_l j_l} = 1, \end{aligned}$$
(23)
$$\begin{aligned} (E_p)_{{\bar{i}}_l j_l}= & {} 0,\quad \,(E_p)_{i {\bar{j}}_l} = 0. \end{aligned}$$
(24)

Since the set \(\mathcal {I}({\bar{j}}_l)\) has p elements for each l, we can ensure that the the vertices \({\bar{i}}_l\) chosen for each l are distinct. If we now write \(E_p\) as \(E - \Delta _- + \Delta _+\), it is evident that the three claims in the lemma follow upon observation. The process can be repeated for each row i. \(\square \)

Now we present our result on perturbing a Ramanujan bigraph while retaining the Ramanujan property.

Theorem 7

Suppose E is the biadjacency matrix of a \((d_r,d_c)\)-biregular Ramanujan bigraph, and define

$$\begin{aligned} \mu (d_r,d_c) := \sqrt{d_r-1} + \sqrt{d_c-1} . \end{aligned}$$
(25)

Let \(\sigma _2\) denote the second largest singular value of E. Next, suppose the set \(\mathcal {M}\) of prohibited edges does not contain more than p values of j for each fixed i, and more than p values of i for each fixed j. Finally, suppose that

$$\begin{aligned} 2p \le \mu (d_r,d_c) - \sigma _2 . \end{aligned}$$
(26)

Then the construction in Lemma 2 results in a \((d_r,d_c)\)-biregular Ramanujan graph whose edge set is disjoint from the set of prohibited edges \(\mathcal {M}\).

The proof of Theorem 7 makes of the following alternate characterization of a Ramanujan bigraph. Note that \( \Vert \cdot \Vert _S \) denotes the spectral norm of a matrix, that is, its largest singular value.

Lemma 3

Suppose \(E \in \{0,1\}^{n_r \times n_c}\). Then

  1. 1.

    The corresponding graph is \((d_r,d_c)\)-biregular if and only if

    $$\begin{aligned} E \mathbf{1}_{n_c} = d_r \mathbf{1}_{n_r},\quad \mathbf{1}_{n_r}^\top E = d_c \mathbf{1}_{n_c}^\top , \end{aligned}$$
    (27)

    where \(\mathbf{1}_k\) denotes the column vector of k ones.

  2. 2.

    Define the constant

    $$\begin{aligned} \alpha = \frac{d_r}{n_c} = \frac{d_c}{n_r} = \sqrt{ \frac{ d_r d_c}{n_r n_c} } . \end{aligned}$$
    (28)

    Suppose that (27) holds, so that the graph is \((d_r,d_c)\)-biregular. Then the graph has the Ramanujan property if and only if

    $$\begin{aligned} \Vert E - \alpha \mathbf{1}_{n_r \times n_c} \Vert _S \le \sqrt{d_r-1} + \sqrt{d_c-1} =: \mu (d_r,d_c) . \end{aligned}$$
    (29)

    where \(\mathbf{1}_{k \times l}\) denotes the \(k \times l\) matrix of all ones.

Proof

The first statement is obvious. To prove the second, observe that due to biregularity, the largest singular value of E is \(\sigma _1(E) = \sqrt{d_r d_c}\), with associated (normalized) singular vectors \((1/\sqrt{n_r}) \mathbf{1}_{n_r}\) and \((1/\sqrt{n_c}) \mathbf{1}_{n_c}\). Thus, the singular value decomposition (SVD) of E looks like \( E = \sqrt{ \frac{ d_r d_c}{n_r n_c} } \mathbf{1}_{n_r} \mathbf{1}_{n_c}^\top + M = \alpha \mathbf{1}_{n_r \times n_c} + M , \) where \( \Vert M \Vert _S = \sigma _2(E)\), the second largest singular value of E. Now (29) follows from the definition of a Ramanujan bigraph. \(\square \)

Proof

(of Theorem 7) The perturbed matrix \(E_p\) can be written as \(E - \Delta _- + \Delta _+\). Note that since E and \(E_p\) are both \((d_r,d_c)\)-biregular, the quantity \(\alpha \) defined in (28) is the same for both E and \(E_p = E - \Delta _- + \Delta _+\). Moreover, by construction, both \(\Delta _-\) and \(\Delta _+\) have no more than p entries of one in each row and each column. Therefore, by Lemma 3, it follows that \(E - \Delta _- + \Delta _+\) represents a \((d_r,d_c)\)-biregular Ramanujan bigraph if \( \Vert (E - \Delta _- + \Delta _+) - \alpha \mathbf{1}_{n_r \times n_c} \Vert _S \le \mu (d_r,d_c) . \) We already know from Lemma 3 that \( \Vert E - \alpha \mathbf{1}_{n_r \times n_c} \Vert _S = \sigma _2(E) . \) Therefore the result follows if it can be established that \( \Vert \Delta _- \Vert _S , \Vert \Delta _+ \Vert _S \le p . \) Note that each of \(\Delta _+\) and \(\Delta _-\) can be viewed as biadjacency matrices of bipartite graphs of maximum degree p. Let \(\sigma \) be a singular value of \(\Delta _+\) and let \( {v} = [v_1 \, v_2 \dots v_{n_c}]^\top \) be an eigenvector of \(\Delta _+^\top \Delta _+\) corresponding to the eigenvalue \(\sigma ^2\). That is, \( (\Delta _+^\top \Delta _+) {v} = \sigma ^2 {v}. \) We assume without loss of generality that

$$\begin{aligned} |v_1| = \max _{1 \le i \le n_c} |v_i|. \end{aligned}$$

We now have, \( \sigma ^2 v_1 = R^1(\Delta _+^\top \Delta _+)v, \) where \(R^i(A)\) denotes the i-th row of a matrix A.

We also observe that

$$\begin{aligned} \Delta _+^\top \Delta _+ = [a_{ij}]_{1 \le i,j \le n_c}, \end{aligned}$$

where \(a_{ij}\) equals the dot product \( \langle C_i , C_j \rangle \) of \(C_i\) and \(C_j\), the i-th and j-th columns of \(\Delta _+\), respectively. This gives us

$$\begin{aligned} \sigma ^2 v_1 = \sum _{j=1}^{n_c} \langle C_1 , C_j \rangle v_j. \end{aligned}$$

That is,

$$\begin{aligned} \sigma ^2 |v_1| \le \sum _{j=1}^{n_c} \langle C_1 , C_j \rangle |v_j| \le |v_1| \sum _{j=1}^{n_c} \langle C_1 , C_j \rangle . \end{aligned}$$

We observe that each element of the vector \(\sum _{j=1}^{n_c}C_j\) is at most p. Also, the vector \(C_1\) has at most p number of 1’s. In other words, the dot product

$$\begin{aligned} \langle C_1 , \sum _{j=1}^{n_c}C_j \rangle \le p^2. \end{aligned}$$

Thus, \(\sigma ^2 |v_1| \le p^2 |v_1|\) and therefore, \(\sigma \le p\) for any singular value \(\sigma \) of \(\Delta _+\). We have used here, a technique from the proof of [28, Theorem 1]. A similar analysis works for \(\Delta _-\). Thus, it follows that \( \Vert \Delta _+ \Vert _S \le p , \Vert \Delta _- \Vert _S \le p\) and therefore, \( \Vert \Delta _+ - \Delta _- \Vert _S \le 2p . \) This completes the proof. \(\square \)

7.3 Analysis of the spectra of Ramanujan graphs and bigraphs

Lemma 3 shows that the greater the gap between \(\sigma _2(E)\) and the bound \(\mu (d_r,d_c)\), the more perturbation the Ramanujan graph can withstand while still remaining a Ramanujan graph. At first glance this may appear to be a vacuous result, because the Alon–Boppana bound for graphs and the Feng-Li bound for bigraphs shows that, as the graphs grow in size, the gap approaches zero. Indeed, one of the major contributions of [22] is to construct infinitely many families of Ramanujan graphs, with size approaching infinity, but fixed degree. However, in applications such as the matrix completion problem, the Alon–Boppana and Feng-Li bounds are not germane. As shown in [8, Sect. 7], as the size of the unknown matrix (which is the size of the graph) grows, so must the degree.

Both our new construction of the Ramanujan bigraphs and the Gunnells construction of Ramanujan graphs achieve a substantial gap between the degree d and the second largest singular value \(\sigma _2\). In the Gunnells construction, we get

$$\begin{aligned} d = \sum _{i=0}^{l-2} q^i \approx q^{l-2} , \mu (d,d) = 2 \sqrt{d-1} = 2 \sqrt{ \sum _{i=1}^{l-2} q^i } \approx 2 \sqrt{q^{l-2}} , \sigma _2 = \sqrt{q^{l-2}} , \end{aligned}$$

because, when q is large, the last term in various summations dominates the rest. Therefore \( \mu (d,d) - \sigma _2 \approx \sqrt{d-1} . \) Similarly, for our construction in Theorem 3, with \(l = q\), we have that

$$\begin{aligned} d = q , \sigma _2 = \sqrt{q} , \mu (d,d) = 2 \sqrt{d-1} , \mu (d,d) - \sigma _2 \approx \sqrt{d-1}. \end{aligned}$$

It is also worth mentioning that if a bipartite graph has girth six or more, then the maximum inner product \(\theta _c = 1\). Therefore (15) and (16) can be combined into the single bound

$$\begin{aligned} 2p \le \min \{ n_c - d_r , d_c \} . \end{aligned}$$

It is clear that the operative bound is the second term \(d_c\). To illustrate these bounds, suppose we construct a Ramanujan graph of size \(n = q^2 = 101^2\) and degree \(d = q = 101\). Then we can avoid any set of prohibited edges provided there are fewer than 50 edges in each row and each column, and still preserve (qq)-biregularity. Moreover, since \(\mu (q,q) - \sigma _2 \ge 10\), we can avoid any arbitrary set of prohibited edges, provided that there are not more than ten such edges in each row and each column.

One noteworthy feature of both our new construction and the Gunnells construction is the high multiplicity of the second largest singular value. In our construction, other than the largest singular value and zero (due to rank deficiency), all other singular values have the same value. In the case of the Gunnells construction, other than the largest singular value, all other singular values have the same magnitude, though some could be negative. This prompted us to analyze whether the LPS and Bibak et al. constructions have a similar feature. It appears that, even in the case of the LPS construction, the second largest singular value is repeated multiple times. Table 1 shows the results for \(q = 13\) and \(q = 17\), for various values of p. The upper limit \(p = 157\) was chosen because every prime \(p \equiv 1 ~\mathrm{mod}~4\) leads to a simple graph (and not a multigraph), for both values of q. We have thus far not found any pattern in the multiplicity of \(\sigma _2\) as a function of p and q; perhaps this can be a topic for future research. Another noteworthy aspect is that \(\sigma _2\) is very close to the Ramanujan bound of \(2 \sqrt{d-1}\) in all cases. In contrast, the Bibak et al. construction did not show that \(\sigma _2\) had multiplicity more than one, for any \(p \equiv 3 ~\mathrm{mod}~4\), for p up to 103. We did not test the Winnie Li construction due to the complexity of actually computing the constructions.

Table 1 The second largest singular value of the LPS graph (bipartite or otherwise), and its multiplicity

8 Conclusions

As described in Sect. 7.1, a significant motivation for the study of explicit constructions of Ramanujan graphs comes from the matrix completion problem. This theme was explored in detail in [8] where it was shown that it is possible to guarantee exact completion of an unknown low-rank matrix, if the sampling set corresponds to the edge set of a Ramanujan bigraph. While that set of results is interesting in itself, it has left open the question of just how Ramanujan bigraphs are to be constructed. In the literature to date, there are relatively few explicit constructions of Ramanujan graphs and balanced bigraphs, and no explicit constructions of an unbalanced Ramanujan bigraph. In this paper, we presented for the first time an infinite family of unbalanced Ramanujan bigraphs with explicitly constructed biadjacency matrices. In addition, we have also shown how to construct the adjacency matrices for the currently available families of Ramanujan graphs. These explicit constructions, as well as forthcoming ones based on [5, 14], are available for only a few combinations of degree and size. In contrast, it is known from [24, 25] that Ramanujan graphs are known to exist for all degrees and all sizes. The main limiting factor is that these are only existence proofs and do not lead to explicit constructions. A supposedly polynomial-time algorithm for constructing Ramanujan graphs of all degrees and sizes is proposed in [11]. But it is still a conceptual algorithm and no code has been made available. Therefore it is imperative to develop efficient implementations of the ideas proposed in [25], and/or to develop other methods to construct Ramanujan graphs of most degrees and sizes. We should also note that the work of [24, 25] shows the existence of balanced, bipartite graphs of all degrees and sizes. Therefore, in Sect. 5 of this article, we have also looked at how the constructions of [22] and Gunnells [19] can be further analyzed to derive nonbipartite Ramanujan graphs.

It is worth pointing out that efficient solutions of the matrix completion problem do not really require the existence of Ramanujan graphs of all sizes and degrees. It is enough if the “gaps” in the permissible values for the degrees and the sizes are very small. If this extra freedom leads to substantial simplification in the construction procedures, then it would be a worthwhile tradeoff. However, research on this problem is still at a nascent stage.

Finally, in Sect. 7, we address another issue in the matrix completion problem, namely the “missing measurements” problem. This leads to the problem of the construction of a Ramanujan bigraph (not necessarily balanced) in which a certain set of edges is prohibited. In a typical real-life application, the size of this set is small. In Sect. 7.2, we initiate the study of how a Ramanujan bigraph can be perturbed so as to remove a set of prohibited edges while still retaining biregularity and the Ramanujan condition. The set of prohibited edges considered is relatively small in size and has some additional constraints. Nonetheless, this study is at an initial stage and “perturbing” a Ramanujan bigraph by the set \(\mathcal {M}\) with weaker conditions than we currently require would be an interesting topic for future research.