# Inverses of Bipartite Graphs

###### Abstract

Let be a bipartite graph and its adjacency matrix . If has a unique perfect matching, then has an inverse which is a symmetric integral matrix, and hence the adjacency matrix of a multigraph. The inverses of bipartite graphs with unique perfect matchings have a strong connection to Möbius functions of posets. In this note, we characterize all bipartite graphs with a unique perfect matching whose adjacency matrices have inverses diagonally similar to non-negative matrices, which settles an open problem of Godsil on inverses of bipartite graphs in [Godsil, Inverses of Trees, Combinatorica 5 (1985) 33-39].

## 1 Introduction

Throughout the paper, a graph means a simple graph (no loops and parallel edges). If parallel edges and loops are allowed, we use multigraph instead. Let be a bipartite graph with bipartition . The adjacency matrix of is defined such that the -entry if , and 0 otherwise. The bipartite adjacency matrix of is defined as the -entry for and . So is an -matrix and

A perfect matching of is a set of disjoint edges covering all vertices of . If a bipartite graph has a perfect matching, then its bipartite adjacency matrix is a square matrix. Godsil proved that if a bipartite graph has a unique perfect matching, then is similar to a lower triangular matrix with all diagonal entries equal to 1 by permuting rows and columns ([5], see also [15]). So in the following, we always assume that the bipartite adjacency matrix of a bipartite graph with a unique perfect matching is a lower triangular matrix. Clearly, is invertible and its inverse is an integral matrix (cf. [5, 17]). If is non-negative (i.e. all entries are non-negative), then it is the bipartite adjacency matrix of another bipartite multigraph: the -entry is the number of edges joining the vertices and . However, the adjacency matrix of a graph has a non-negative inverse if and only if the graph is the disjoint union of ’s and ’s (cf. Lemma 1.1 in [13], and [9]).

The inverse of is diagonally similar to a non-negative integral matrix if there exists a diagonal matrix with -1 and 1 on its diagonal such that . So is a bipartite adjacency matrix of a bipartite multigraph that is called the inverse of the bipartite graph in [5] (a broad definition of graph inverse is given in the next section). The following is a problem raised by Godsil in [5] which is still open [6].

###### Problem 1.1 (Godsil, [5]).

Characterize the bipartite graphs with unique perfect matchings such that is diagonally similar to a non-negative matrix.

The bipartite graphs with unique perfect matchings are of particular interest because of the combinatorial interest of their inverses (cf. [5, 12]). Let be a bipartite graph with a unique perfect matching , and be the bipartition of . Let be the digraph obtained from by orienting all edges from to and then contracting all edges in . Simion and Cao proved that the digraph is acyclic ([15]). For example, see Figure 1. The acyclic digraph corresponds to a poset such that for , there is a directed path from to in if and only if in . The Zeta matrix of is defined as follows (cf. Chapter 4 in [1])

The modified Zeta matrix of is obtained by replacing the entry 1 by a variable for a comparable pair of which is not an arc of the digraph . Then the Zeta matrix of , and the bipartite adjacency matrix of . Note that is the adjacency matrix of and is the adjacency matrix of the transitive closure of . The Möbius function on the interval of in is (see Ex. 22 in Chapter 2 of Lovász on page 216 in [11]), and is the Möbius matrix of . On the other hand, the Zeta matrix of a poset is a lower triangular matrix, corresponding to a bipartite adjacency matrix of a bipartite graph with a unique perfect matching. This sets up a connection between inverses of bipartite graphs with unique perfect matchings and Möbius functions of posets.

As observed in [5], if is a geometric lattice (a finite matroid lattice [16]) or the face-lattice of a convex polytope [2]), then the Möbius matrix of is diagonally similar to a non-negative matrix (cf. Corollary 4.34 in [1]). Godsil [5] proved that if is a tree with a perfect matching, then the inverse of its adjacency matrix is diagonally similar to a non-negative matrix. Further, it has been observed that if and are two bipartite graphs with the property stated in Problem 1.1, then the Kronecker product is again a bipartite graph with the property [5]. The following is a partial solution to Problem 1.1.

###### Theorem 1.2 (Godsil, [5]).

Let be a bipartite graph with a unique perfect matching such that is bipartite. Then is diagonally similar to a non-negative matrix.

Godsil’s result was generalized to weighted bipartite graphs with unique perfect matchings by Panda and Pati in [14]. In this paper, we provide a solution to Problem 1.1 as follows.

###### Theorem 1.3.

Let be a bipartite graph with a unique perfect matching . Then is diagonally similar to a non-negative matrix if and only if does not contain an odd flower as a subgraph.

To define odd flower, we need more notation. Let be a bipartite multigraph with a perfect matching . A path of is -alternating if is a perfect matching of . For two vertices and of , let be the number of -alternating paths of joining and . Further, let be the number of -alternating paths of joining and such that is odd, and be the number of -alternating paths joining and such that is even. For a subset of , the -span of is defined as a subgraph of consisting of all -alternating paths joining and for any , denoted by . An -span is called a flower if the vertices of can be ordered such that if and only if (mod ). A flower is odd if there is an odd number of vertex pairs with . For example, see Figure 1. In Section 4, it will be shown that the existence of an odd flower means simply that the vertices in induce a cycle with an odd number of negative edges in the inverse of .

## 2 Inverses of weighted graphs

A weighted multigraph is a multigraph with a weight-function where is a field. We always assume that a weighted multigraph has no parallel edges since all parallel edges joining a pair of vertices and can be replaced by one edge with weight . The adjacency matrix of a weighted multigraph , denoted by , is defined as

where loops, with , are allowed. A weighted multigraph is invertible over if its adjacency matrix is invertible over . Note that is a symmetric matrix. Its inverse is also symmetric and therefore is the adjacency matrix of some weighted graph, which is called the inverse of . The inverse of is defined as a weighted graph whose vertex set is and whose edge set is , and whose weight function is . Note that this definition of graph inverse is different from the definitions given in [5] and [12].

Let be a graph. A Sachs subgraph of is a spanning subgraph with only copies of and cycles (including loops) as components. For example, a perfect matching of is a Sachs subgraph. For convenience, a Sachs subgraph is denoted by where consists of the cycles of (including loops), and consists of all components of isomorphic to . The following result shows how to compute the determinant of the adjacency matrix of a graph.

###### Theorem 2.1 (Harary, [8]).

Let be a graph and be the adjacency matrix of . Then

where is a Sachs subgraph.

If is a bipartite graph with a Sachs subgraph , then every cycle in is of even size and hence its edge set can be decomposed into two disjoint perfect matchings of . Therefore, has at least perfect matchings. So if is a bipartite graph with a unique perfect matching , then is the unique Sachs subgraph of . Hence we have the following corollary of the above result, which can also be derived easily from a result of Godsil (Lemma 2.1 in [5]).

###### Corollary 2.2.

Let be a bipartite graph with a unique perfect matching . Then

where is the adjacency matrix of .

By Corollary 2.2, the determinant of the adjacency matrix of a bipartite graph with a unique perfect matching is either 1 or . So a bipartite graph with a unique perfect matching is always invertible. The inverse of a graph can be characterized in terms of its Sachs subgraphs as shown in the following theorem, which was originally proved in [17]. However, to make the paper self-contained, we include the proof here as well.

###### Theorem 2.3 ([17]).

Let be a graph with adjacency matrix , and

If has an inverse , then

where is a Sachs subgraph of and is the matrix obtained by deleting -th row and -th column from .

###### Proof.

Let be an invertible graph and be its inverse. Assume has vertices and . By the definition of the inverse of a graph, .

Note that is symmetric and hence is also symmetric. By Cramer’s rule,

where where is the matrix obtained from by deleting -th row and -th column. Let be the matrix obtained from by replacing the -entry by 1 and all other entries in the -th row and -th column by 0. Then by the Laplace expansion,

If , then . So . So the theorem holds for . In the following, assume that .

Let be the -entry of . Recall that the Leibniz formula for the determinant of is

where the sum is computed over all permutations of the set . Since all -entries () of are equal to 0 but the -entry is 1, only permutations such that contribute to the the determinant of . Let be the family of all permutations on such that . Denote the cycle of permuting to by . For convenience, is also used to denote the set of vertices which corresponds to the elements in the permutation cycle , for example, denotes the set of vertices in but not in . Denote the permutation of restricted on by . Then

By the definition of , if or , then , the -entry of .

If the permutation cycle does not correspond to a cycle of , then for some , is not an edge of and hence . So . If the permutation cycle does correspond to a cycle in the graph , let be the path from to following the permutation order in . Then . Note that is the determinant of the adjacency matrix of the graph . By Theorem 2.1, it follows that

where is a Sachs subgraph of . For the case that has no Sachs subgraphs, then . Hence,

where is a Sachs subgraph of . The theorem follows immediately from . This completes the proof. ∎

For a bipartite graph with a unique perfect matching, the weight function of its inverse can be simplified as shown below.

###### Theorem 2.4.

Let be a bipartite graph with a unique perfect matching , and let

Then has an inverse such that

###### Proof.

Let be a bipartite graph with a unique perfect matching . By Corollary 2.2, has an inverse which is a weighted graph .

For any two vertices and , let be a path joining and .

Claim: has a Sachs subgraph if and only if is an -alternating path.

Proof of Claim: If is an -alternating path, then has a perfect matching. So has a Sachs subgraph.

Now assume that has a Sachs subgraph. Note that is a bipartite graph. Every cycle of a Sachs subgraph of is of even size. So has a perfect matching . Therefore, is a path with even number of vertices and has a perfect matching . Hence is a perfect matching of . Since has a unique perfect matching, it follows that . So is an -alternating path. This completes the proof of Claim.

## 3 Balanced weighted graphs

Let be a weighted graph. An edge of a weighted graph is positive if and negative if . A cycle of is negative if . A signed graph is a special weighted graph with a weight function , where is called the signature of (see [7]). Signed graphs are well-studied combinatorial structures due to their applications in combinatorics, geometry and matroid theory (cf. [18, 20]).

A switching function of a weighted graph is a function , and the switched weight-function of defined by is . Two weight-functions and of a graph are equivalent to each other if there exists a switching function such that . A weighted graph is balanced if there exists a switching function such that for any edge . The following is a characterization of balanced signed graphs obtained by Harary [7].

###### Proposition 3.1 ([7]).

Let be a signed graph. Then is balanced if and only if has a bipartition and such that .

For a weighted graph , define a signed graph such that for any edge . Then is balanced if and only if is balanced. Therefore, the above result can be easily extended to weighted graphs as follows.

###### Proposition 3.2.

Let be a weighted graph. Then is balanced if and only if has a bipartition and such that .

Remark. Let be a weighted graph such that is connected, and let . Let be the graph obtained from by contracting all edges in and deleting all loops. Then by Theorem 3.2, is balanced if and only if is a bipartite multigraph. Therefore, it takes steps to determine whether a weighted graph is balanced or not, where is the total number of edges of .

A direct corollary of the above theorem is the following result.

###### Corollary 3.3.

Let be a weighted graph. Then is balanced if and only if it does not contain a negative cycle.

Let be a weighted graph and be its adjacency matrix. For a switching function , define to be a diagonal matrix with . Then is equivalent to if and only if for some switching function . So the adjacency matrices of two equivalent weighted graphs are diagonally similar to each other.

###### Lemma 3.4.

Let be a bipartite graph with a unique perfect matching . Then is diagonally similar to a non-negative matrix if and only if the inverse of is a balanced weighted graph.

###### Proof.

Since is invertible, let be the inverse of by Theorem 2.4. Let be the adjacency matrix of such that

where is the bipartite adjacency matrix of , which we assume without loss of generality to be a lower triangular matrix with 1 on the diagonal. Then the inverse of is the adjacency matrix of as follows,

Note that is diagonally similar to a non-negative matrix if and only if is diagonally similar to a non-negative matrix. In other words, if and only if there exists a diagonal matrix with such that is non-negative. Define a switching function such that . Note that

Hence is diagonally similar to a non-negative matrix if and only if there exists a switching function such that . Let and . So the existence of the switching function is equivalent to the existence of a bipartition and of such that . By Proposition 3.2, it follows that is diagonally similar to a non-negative matrix if and only if is balanced. ∎

By Lemma 3.4, Godsil’s problem is equivalent to ask which bipartite graphs with unique perfect matchings have a balanced weighted graph as its inverse.

## 4 Proof of Theorem 1.3

Now, we are ready to prove our main result.

Theorem 1.3. Let be a bipartite graph with a unique perfect matching . Then is diagonally similar to a non-negative matrix if and only if does not contain an odd flower as a subgraph.

###### Proof.

Let be a bipartite graph with a unique perfect matching and the bipartite adjacency matrix of . For any two vertices and of , let

: Assume that is diagonally similar to a non-negative matrix. We need to show that does not contain an odd flower. Suppose on the contrary that does contain a vertex subset such that is an odd flower. Then all paths in belong to . By Theorem 2.4, has an inverse where,

So and if and only if . Note that is an odd flower. So is a negative cycle in . By Corollary 3.3, is not balanced. Hence is not diagonally similar to a non-negative matrix by Lemma 3.4, a contradiction.

: Assume that does not contain an odd flower as a subgraph. We need to show that is diagonally similar to a non-negative matrix. Suppose on the contrary that is not diagonally similar to a non-negative matrix. Then by Lemma 3.4, its inverse is not balanced, and hence contains a negative cycle by Corollary 3.3. Choose a shortest negative cycle (i.e., is as small as possible). Then as is an edge of (subscripts modulo ). Hence (subscripts modulo ). Let . In the following, we are going to prove is an odd flower.

Since is a smallest negative cycle of , it follows that has no chord, which implies that if and are not consecutive on . In other words, if and only if (mod ). Note that is a negative cycle. So contains an odd number of negative edges. Hence, there is an odd number of vertex pairs such that . Hence is an odd flower, a contradiction. This completes the proof. ∎

Remark. For a matrix , its inverse can be found in steps. Note that it takes steps to determine whether the inverse of is balanced or not. Hence, it can be determined in whether has a balanced weighted graph as inverse or not.

## Acknowledgement

The authors would like to thank the anonymous referees for their valuable comments to improve the final version of the paper.

## References

- [1] M. Aigner, Combinatorial Theory, Springer, Berlin, 1979.
- [2] R.B. Bapat and E. Ghorbani, Inverses of triangular matrices and bipartite graphs, Linear Algebra Appl. 447 (2014) 68-73.
- [3] D. Cvetković, I. Gutman and S. Simić, On self-pseudo-inverse graphs, Univ. Beograd. Publ. Elektrotehn. Fak. Ser. Mat. fiz. 602-633 (1978) 111–117.
- [4] R. Donaghey and L.W. Shapiro, Motzkin numbers, J. Combin. Theory Ser. A 23 (1977) 291–301.
- [5] C.D. Godsil, Inverses of trees, Combinatorica 5 (1985) 33–39.
- [6] C.D. Godsil, Personal communication with D. Ye, 2015.
- [7] F. Harary, On the notion of balance of a signed graph, Michigan Math. J. 2 (2) (1953) 143–146.
- [8] F. Harary, The determinant of the adjacency matrix of a graph, SIAM Rev. 4 (1962) 202–210.
- [9] F. Harary and H. Minc, Which nonnegative matrices are self-inverse? Math. Mag. 49 (2) (1976) 91–92.
- [10] D.J. Klein, Treediagonal matrices and their inverses, Linear Algebra Appl. 42 (1982) 109–117.
- [11] L. Lovász, Combinatorial Problems and Exercises, North-Holland, Amsterdam, 1979.
- [12] C. McLeman and E. McNicholas, Graph invertibility, Graphs Combin. 30 (2014) 977–1002.
- [13] H. Minc, Nonnegative Matrices, Wiley, New York, 1988.
- [14] S.K. Panda and S. Pati, On the inverese of a class of graphs with unique perfect matchings, Elect. J. Linear Algebra 29 (2015) 89–101.
- [15] R. Simion and D. Cao, Solution to a problem of C.D. Godsil regarding bipartite graphs with unique perfect matching, Combinatorica 9 (1989) 85–89.
- [16] D.J.A. Welsh, Matroid Theory, Dover Publications, 2010.
- [17] D. Ye, Y. Yang, B. Mandal and D.J. Klein, Graph invertibility and median eigenvalues, Linear Algebra Appl. 513 (2017) 304–323.
- [18] T. Zaslavsky, Signed graphs, Discrete Appl. Math. 4 (1982) 47–74.
- [19] T. Zaslavsky, A mathematical bibliography of signed and gain graphs and allied areas, Electron. J. Combin. 8 (1998) #DS8: 1–124.
- [20] T. Zaslavsky, Signed graphs and geometry, arXiv:1303.2770 [math.CO].