Next Article in Journal
A Hybrid Matrix-Based Cryptographic Framework Using Multiple Linear Recurrence Sequences
Next Article in Special Issue
The Least Distance Eigenvalue of Complement Graphs with Two Pendant Vertices
Previous Article in Journal
Generative Adversarial Networks for Inpainting Implied Volatility Surfaces
Previous Article in Special Issue
On Graphs with Maximal Sum of α-th Degree Powers
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Counting Spanning Trees in Various Products of Two Complete Bipartite Graphs

1
Department of Mathematics, Faculty of Science, Taibah University, Al-Madinah Al-Munawarah 41411, Saudi Arabia
2
Department of Mathematics and Computer Sciences, Faculty of Science, Menoufia University, Shebin El Kom 32511, Egypt
3
Department of Mathematics, Applied College at Mahail Aseer, King Khalid University, Abha 61421, Saudi Arabia
*
Author to whom correspondence should be addressed.
Mathematics 2026, 14(11), 1996; https://doi.org/10.3390/math14111996
Submission received: 13 April 2026 / Revised: 24 May 2026 / Accepted: 2 June 2026 / Published: 4 June 2026

Abstract

Calculating the number of spanning trees in a graph is a crucial problem in combinatorics and physics that has been thoroughly researched for many years by mathematicians and physicists. The higher the quality and perfection of the network, the greater the number of trees spanning it, leading to greater possibilities for connection between two vertices and ensuring good rigidity and resistance. In this work, we use matrix theory and linear algebra techniques to derive simple explicit formulas for calculating the complexity of various products of two complete bipartite graphs, including the Cartesian product, tensor product, normal product, composition product, symmetric product, disjunction, and strong sum.

1. Introduction

A spanning tree of an undirected graph G is a subgraph that is a tree which contains all of the vertices of G . In sectors including computer networking, telecommunications, and transportation, spanning trees are essential for establishing the bare minimum of connections required to link every part of a network or system. This is necessary for network stability, redundancy, and efficiency. By allowing only one active data stream and offering backup paths for fault tolerance, they stop loops and broadcast storms in networks [1,2,3]. Additionally, the number of spanning trees is counted because it is a basic problem in graph theory and combinatorics with applications in physics and engineering, aids in the design of efficient network infrastructure and routing algorithms, and can provide a sparse subgraph that reflects graph properties [4,5].
In 1847, the physicist Kirchhoff [6] proposed the matrix tree theorem, which marked the beginning of the history of calculating the number of spanning trees, τ ( G ) , in a graph G . This theorem was based on the determinants of a particular matrix obtained from the Laplacian matrix, L , which is defined as the difference between the adjacency matrix, A ( G ) , and the degree matrix, D ( G ) , which is a diagonal matrix, D ( G ) = d i g ( d 1 , d 2 , , d n ) , corresponding to a graph G with n vertices and a 1 or 0 in position ( u i , u j ) , depending on whether or not they are adjacent. That is,
L i j = d i         i f       i = j 1     i f     i j   a n d     i   i s   a d j a c e n t   t o   j 0             o t h e r w i s e ,
where the degree of the vertex u i is indicated by d i . The matrix tree theorem states that the complexity τ ( G ) is equal to the common value of all the cofactors of L .
Consequently, Cayley’s formula [7] states that the number of spanning trees in the complete graph with n vertices as n n 2 . According to Fieldler and Sedlacek [8], the number of spanning trees of the complete bipartite graph on r and s vertices is equal to r s 1 s r 1 .
Lastly, Onodera [9] provides the number of spanning trees of a k -partite graph on the vertex set V 1 + V 2 + + V k , where V i = p i for i = 1,2 , , k , and “+” signifies disjoint union. This number is expressed as n k 2 i = 1 k ( n p i ) p i 1 , n = p i .
Daoud recently derived the exact formulas for calculating the complexity of several products of complete and complete bipartite graphs [10].
There are numerous methods for calculating τ ( G ) . Laplacian eigenvalues are one such method. Assume that the eigenvalues of the Laplacian matrix L of a graph G with k vertices are represented by μ 1 μ 2 μ k = 0 . As stated by “Kelmans” and “Chelnokov” [11],
τ ( G ) = 1 k i = 1 k 1 μ k .
Following that, Temperley [12] has proven that
τ ( G ) = 1 k 2 d e t ( L + J )
where J is the k × k matrix, each element of which is unity.
One popular way for determining complexity is the deletion-contraction method. It is feasible to recursively determine a graph’s complexity in this way: if e is any edge in a graph G , its complexity τ G equals τ ( G ) = τ ( G e ) + τ ( G / e ) , where G / e is the contraction of e in G , and G e is the deletion of e from G [13,14].
It is also possible to determine the number of spanning trees iteratively by tracking changes in the number of weighted spanning trees and simplifying the graph. The electrically equivalent transformation strategy uses graph transformations such as switching between triangle ( ) and star ( Y ) configurations, combining serial edges, and merging parallel edges, using the connection between the counting spanning tree problem and electrical networks, where conductance is represented by edge weights [15,16].
An efficient method for counting spanning trees in graphs is modular decomposition, which breaks a graph into its constituent modules bottom-up. For some graph types, this allows for a linear-time solution. The total spanning tree count is computed by multiplying the values associated with the vertices after the modular decomposition tree is shrunk until only one node is left [17].
Unfortunately, counting the number of spanning trees in large graphs by directly evaluating the determinant of Kirchhoff’s matrix is challenging. As a result, strategies to overcome the difficulties have been developed, and there has been much interest in obtaining explicit and possibly simple formulas for specific types of graphs. We now present the following lemma, which explains how to use an extension of Kirchhoff’s formula to get the number of spanning trees.
The following Lemma is easily proved from Temperley’s Equation (2):
Lemma 1.
Assume that the graph  G  has  n  vertices.
τ ( G ) = 1 n 2 det ( n I D ¯ + A ¯ )
where  I   is the  n × n  identity matrix, and  A ¯ ,   D   ¯  are the adjacency and degree matrices of  G ¯ , the complement of  G , respectively.
This formula has a big advantage because it does not need cofactors or eigenvalues, instead representing  τ ( G )  directly as a determinant.
Lemma 2.
Ref. [10] assumes that  A n ( t )  is an  n × n  matrix with  t 2   such that
A n ( t ) = t 1 1 1 t t 1 1 1 t
Then,
det ( A n ( t ) ) = ( t + n 1 ) ( t 1 ) n 1 .
Proof. 
We obtain the following from the circulant determinants’ definition:
det ( A n ( t ) ) = det t 1 1 1 t t 1 1 1 t = j = 1 n ( t + ω j + ω j 2 + ω j 3 + + ω j n 1 ) = ( t + 1 + 1 + + 1 ) × j = 1 , ω j 1 n ( t + ω j + ω j 2 + ω j 3 + + ω j n 1 ) = 1 = ( t + n 1 ) × ( t 1 ) n 1 .
We can generalize the previous Lemma as follows:
Lemma 3.
Let   P , Q F n × n and  F F k n × k n  be such that
F = P Q Q Q P P Q Q Q P
Then,
det ( F ) = [ det ( P Q ) ] k 1 det [ P + ( k 1 ) Q ] .
Lemma 4.
Let   A F n × n ,  B F n × m ,  C F m × n , and  D F m × m  [18]. Assume that  A  and  D  are nonsingular matrices. Then,
det A B C D = det ( A B D 1 C ) det ( D ) = det ( A ) det ( D C A 1 B ) .
The formulas in Lemmas 2–4 provide some symmetry in certain matrices, making it easier to calculate determinants.

2. Complexity of Cartesian Product of Two Complete Bipartite Graphs

The Cartesian product of two graphs G and H , denoted by G     H , is a graph where the vertices are ordered pairs ( g , h ) with g V ( G ) ) and h V ( H ) . Two vertices ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent if g 1 = g 2 and h 1 , h 2 are adjacent in graph H or if h 1 = h 2 and g 1 , g 2 are adjacent in graph G [19].
One way to view the resulting graph G H is to replace each vertex in G with a copy of H , connecting the relevant vertices between copies if they were adjacent in G . On the other hand, it can be thought of as swapping out each vertex in H for a copy of G . This operation is commutative up to isomorphism, meaning G H H G .
Theorem 1.
For  n , r  and  s  are all greater than or equal to 1, we get
                                      τ ( K n , n K r , s ) = r s 1 × s r 1 × n 2 n 1 × n + r 2 s 1 n 1 × n + s 2 r 1 n 1 × n + r + s 2 n 1 × 2 n + r s 1 × 2 n + s r 1 × 2 n + r + s
Proof. 
By using Lemma 1, we have
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × det A B B A ,
where A and B are block matrices of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P J J J J J J P , B = ( J I ) ( J I ) ( J I ) ( J I ) ,   P = ( n + s + 1 ) 1 1 0 0 1 1 1 ( n + s + 1 ) 0 0 0 0 ( n + r + 1 ) 1 1 1 1 0 0 1 1 ( n + r + 1 ) .
Thus, we have: τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × det ( A + B ) × det ( A B ) . Such that
A + B = X Y Y Y Y Y Y X , A B = Z W W W W W W Z ,   X = ( n + s + 1 ) 2 2 1 1 2 2 2 2 ( n + s + 1 ) 1 1 1 1 ( n + r + 1 ) 2 2 2 2 1 1 2 2 ( n + r + 1 ) ,   Y = 1 2 2 2 2 2 2 2 2 1 2 2 2 2 1 2 2 2 2 2 2 2 2 1 , W = 1 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 1   and   Z = ( n + s + 1 ) 0 0 1 1 0 0 0 0 ( n + s + 1 ) 1 1 1 1 ( n + r + 1 ) 0 0 0 0 1 1 0 0 ( n + r + 1 ) .
Applying Lemma 3, we obtain
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × ( det n + s 0 0 1 1 0 0 0 n + s 1 1 1 1 n + r 0 0 0 0 1 1 0 0 n + r ) n 1 ×   det 2 n + s 2 n 2 n 2 n 1 2 n 1 2 n 2 n 2 n 2 n 2 n + s 2 n 1 2 n 1 2 n 1 2 n 1 2 n + r 2 n 2 n 2 n 2 n 2 n 1 2 n 1 2 n 2 n 2 n + r × ( det n + s 0 0 1 1 0 0 0 n + s 1 1 1 1 n + r 0 0 0 0 1 1 0 0 n + r ) n 1 ×   det 2 n + s 0 0 1 1 0 0 0 0 2 n + s 1 1 1 1 2 n + r 0 0 0 0 1 1 0 0 2 n + r .
Using Lemma 4, we get
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 ( det n + s 0 0 0 0 0 n + s r × r ) 2 ( n 1 ) ×   ( det n + r n + s r n + s r n + s r n + s r n + s r n + s r n + s r n + s n + r n + s r n + s s × s ) 2 n 1 × det 2 n + s 2 n 2 n 2 n 2 n 2 n 2 n 2 n + s r × r ×   det 2 n r 2 + 2 r + s + r s 1 2 n r + s 2 n 2 r + s r 2 n r + s 2 n 2 r + s r 2 n r + s 2 n 2 r + s r 2 n r + s 2 n 2 r + s r 2 n r + s 2 n 2 r + s r 2 n r + s 2 n 2 r + s r 2 n r + s 2 n r 2 + 2 r + s + r s 1 2 n r + s s × s ×   det 2 n + s 0 0 0 0 0 2 n + s r × r × det 2 n + r 2 n + s r 2 n + s r 2 n + s r 2 n + s r 2 n + s r 2 n + s r 2 n + s r 2 n + s 2 n + r 2 n + s r 2 n + s . s × s = 1 4 n 2 ( r + s ) 2 ( n + s ) 2 r ( n 1 ) × ( r n + s ) 2 s ( n 1 ) × ( 2 n ) r ×   ( det ( n + r ) ( n + s ) r r 1 1 1 1 1 1 ( n + r ) ( n + s ) r r s × s ) 2 ( n 1 ) × det 2 n + s 2 n 1 1 1 1 1 1 2 n + s r × r ×   ( 2 n ( 2 r + s ) r 2 n r + s ) s det 2 n ( r 2 + 2 r + s ) + r ( s 1 ) 2 n ( 2 r + s ) r 1 1 1 1 1 1 2 n ( r 2 + 2 r + s ) + r ( s 1 ) 2 n ( 2 r + s ) r s × s × ( 2 n + s ) r ×                                                                                                         ( r 2 n + s ) r det 2 n + r 2 n + s r r 1 1 1 1 1 1 2 n + r 2 n + s r r s × s .
Applying Lemma 2, we have
τ ( K n , n K r , s ) = 1 4 n 2 r + s 2 × n + s 2 r n 1 × r n + s 2 s n 1 × n + r n + s r r + s 1 2 n 1 × n + r n + s r r 1 2 n 1 s 1                                                                     × 2 n r × 2 n + s 2 n + r 1 × 2 n + s 2 n 1 r 1 × r 2 n 2 r + s 2 n r + s s × 2 n r 2 + 2 r + s + r s 1 2 n 2 r + s r + s 1                                                                     × n + r n + s r r 1 n 1 s 1 × 2 n + s r × r 2 n + s s r + 2 n s + 2 n r r + s 1                                                                     × r + 2 n s + 2 n r r 1 s 1                                               = 1 4 n 2 r + s 2 × n + s r 2 s n 1 × n + r n + s r s n 1 × n + r n + s 2 n 1 s 1 × s r 1 × r s 1 × 2 n r 2 + 2 r + s + r s 1 + s 1 2 n 2 r + s r × n + s r n 1 × n + r n + s r s n 1 × 2 n + s r r + 2 n s + 2 n r r s 1 × s + 2 n 1 × r + 2 n s 1                                               = r s 1 × s r 1 × n 2 n 1 × n + r 2 s 1 n 1 × n + s 2 r 1 n 1 × n + r + s 2 n 1 × 2 n + r s 1 × 2 n + s r 1 × 2 n + r + s .

3. Complexity of Tensor Product of Two Complete Bipartite Graphs

The tensor product, or the Kronecker product, G × H of two graphs G and H is the simple graph with V ( G × H ) = V ( G ) × V ( H ) , where ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent in G × H if and only if g 1 is adjacent to g 2 in G and h 1 is adjacent to h 2 in, H [19]. This product is commutative G × H H × G and associative, often creating disconnected components even if G and H are connected.
Lemma 5.
For  n , r  and  s  are all greater than or equal to 1, we get  ( K n , n × K r , s ) = 0 .
Proof. 
Tensor products of two connected bipartite graphs, such as complete bipartite graphs, are disconnected because they split into exactly two connected components. This occurs because bipartite graphs lack odd cycles, making it impossible for the two distinct sets of vertex pairs ( g , h ) classified by the bipartite partitions of the original graphs to create paths. □

4. Complexity of Normal Product of Two Complete Bipartite Graphs

The strong (normal) product of two graphs G and H , denoted G H , is a graph with vertex set V ( G ) × V ( H ) where two distinct vertices ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent if g 1 is adjacent or equal g 2 in G and h 1 is adjacent or equal h 2 in H [19].
The normal product is commutative G H H G and associative, acting as the union of the Cartesian product G H and the tensor product G × H .
Theorem 2.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K n , n K r , s = n 2 n 1 × n + 1 r + s 1 × r s 1 × s r 1 × n r + n + r 2 n 1 s 1 × n s + n + s 2 n 1 r 1 × n r + 2 n + r s 1 × n s + 2 n + s r 1 × r + s + 2 r s + n 1 + r 1 + s 2 n 1 × r + s + 2 r s + n 2 + r + s
Proof. 
Applying Lemma 1, we have
τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 det A B B A ,
where A and B are block matrices of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P J J J J J J P , B = Q Q Q Q ,   P = ( n + 1 ) ( s + 1 ) 1 1 0 0 1 1 1 ( n + 1 ) ( s + 1 ) 0 0 0 0 ( n + 1 ) ( r + 1 ) 1 1 1 1 0 0 1 1 ( n + 1 ) ( r + 1 ) ,   Q = 0 1 1 0 0 1 1 1 0 0 0 0 0 0 1 1 1 1 0 0 1 1 0
Thus, we have: τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 × det ( A + B ) × det ( A B ) . Such that
A + B = X Y Y Y Y Y Y X , A B = Z W W W W W W Z ,   X = n + 1 s + 1 2 2 0 0 2 2 2 2 n + 1 s + 1 0 0 0 0 n + 1 r + 1 2 2 2 2 0 0 2 2 n + 1 r + 1 ,   Y = 1 2 2 1 1 2 2 2 2 1 1 1 1 1 1 2 2 2 2 1 1 2 2 1 , W = 1 0 0 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 1 0 0 1   and   Z = ( n + 1 ) ( s + 1 ) 0 0 0 0 0 0 0 0 ( n + 1 ) ( s + 1 ) 0 0 0 0 ( n + 1 ) ( r + 1 ) 0 0 0 0 0 0 0 0 ( n + 1 ) ( r + 1 ) .
Applying Lemma 3, we obtain
τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 × ( det n ( s + 1 ) + s 0 0 1 1 0 0 0 n ( s + 1 ) + s 1 1 1 1 n ( r + 1 ) + r 0 0 0 0 1 1 0 0 n ( r + 1 ) + r ) n 1 ×   det n ( s + 2 ) + s 2 n 2 n n 1 n 1 2 n 2 n 2 n 2 n n ( s + 2 ) + s n 1 n 1 n 1 n 1 n ( r + 2 ) + r 2 n 2 n 2 n 2 n n 1 n 1 2 n 2 n n ( r + 2 ) + r × ( det n ( s + 1 ) + s 0 0 1 1 0 0 0 n ( s + 1 ) + s 1 1 1 1 n ( r + 1 ) + r 0 0 0 0 1 1 0 0 n ( r + 1 ) + r ) n 1 ×   det n ( s + 2 ) + s 0 0 n 1 n 1 0 0 0 0 n ( s + 2 ) + s n 1 n 1 n 1 n 1 n ( r + 2 ) + r 0 0 0 0 n 1 n 1 0 0 n ( r + 2 ) + r .
Using Lemma 4, we get
                                                                  τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 ( det n ( s + 1 ) + s 0 0 0 0 0 0 n ( s + 1 ) + s r × r ) 2 ( n 1 )                                                                                                                       ×   det n ( s + 2 ) + s 2 n 2 n 2 n 2 n 2 n 2 n n ( s + 2 ) + s r × r                                                                                                                       ×   det n ( s + 2 ) + s 0 0 0 0 0 0 n ( s + 2 ) + s r × r   ( det ( n r + n + r ) ( n s + n + s ) r n s + n + s r n s + n + s r n s + n + s r n s + n + s r n s + n + s r n s + n + s r n s + n + s ( n r + n + r ) ( n s + n + s ) r n s + n + s s × s ) 2 ( n 1 ) ×   det ( n + 1 ) ( r + r s + n ( ( 3 r + 2 s ) + r ( 2 r + s ) ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + n ( 3 r + 2 s ) ) n ( 2 r + s ) + s ( n + 1 ) ( r + r s + n ( ( 3 r + 2 s ) + r ( 2 r + s ) ) ) n ( 2 r + s ) + s s × s ×   det ( n ( r + 2 ) + r ) ( n ( s + 2 ) + s ) r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s r ( n 1 ) 2 n ( s + 2 ) + s ( n ( r + 2 ) + r ) ( n ( s + 2 ) + s ) r ( n 1 ) 2 n ( s + 2 ) + s s × s = 1 4 n 2 ( r + s ) 2 ( n ( s + 1 ) + s ) 2 r ( n 1 ) × ( r n ( s + 1 ) + s ) 2 s ( n 1 ) × ( 2 n ) r ×   ( det ( n ( r + 1 ) + r ) ( n ( s + 1 ) + s ) r r 1 1 1 1 1 1 ( n ( r + 1 ) + r ) ( n ( s + 1 ) + s ) r r s × s ) 2 ( n 1 ) × ( 2 n ) r ×   ( n ( s + 2 ) + s 2 n 1 ) r 1 × ( n ( s + 2 ) + s 2 n + r 1 ) × ( n + 1 ) s × ( n ( 3 r + s ) r n ( 2 r + s ) + s ) s ×   det n ( ( 3 r + 2 s ) + r ( 2 r + s ) ) + r s r n ( 3 r + 2 s ) r 1 1 1 1 1 1 n ( ( 3 r + 2 s ) + r ( 2 r + s ) ) + r s r n ( 3 r + 2 s ) r s × s × ( n ( s + 2 ) + s ) r ×   ( r ( n 1 ) 2 n s + 2 + s ) s det ( n ( r + 2 ) + r ) ( n ( s + 2 ) + s ) r ( n 1 ) 2 r ( n 1 ) 2 1 1 1 1 1 1 ( n ( r + 2 ) + r ) ( n ( s + 2 ) + s ) r ( n 1 ) 2 r ( n 1 ) 2 s × s .
Applying Lemma 2, we have:
        τ K n , n K r , s = 1 4 n 2 r + s 2 × n s + n + s 2 r n 1 × r n s + n + s 2 s n 1                                                                       × n r + n + r n s + n + s r r 1 2 s 1 n 1 × n r + n + r n s + n + s r r + s 1 2 n 1                                                                       × 2 n r s n + s 2 n r 1 n s + s + 2 n r 2 n × n + 1 s × 3 n r + 2 n s r n s + s + 2 n r s                                                                       × n 3 r + 2 s + r 2 r + s + r s r 3 n r + 2 n s r + s 1 × n 3 r + 2 s + r 2 r + s + r s r 3 n r + 2 n s r 1 s 1                                                                       × n s + 2 + s r × 1 n s + 2 + s s × n r + 2 + r n s + 2 + s r s n 1 2                                                                       × n r + 2 + r n s + 2 + s s 1         = 1 4 n 2 r + s 2 × n s + n + s 2 r 1 n 1 × n r + n + r 2 s 1 n 1 × n r + n + r n s + n + s r s 2 n 1                                                                       × s n + s r 1 × n + 1 s × r + r s + n 3 r + 2 s + r 2 r + s + s 1 3 n r + 2 n s r                                                                       × r s 1 × n s + 2 + s r s × n r + 2 + r n s + 2 + s r s n 1 2                                                                       × n r + 2 + r n s + 2 + s s 1 = n 2 n 1 × n + 1 r + s 1 × r s 1 × s r 1 × n r + n + r 2 n 1 s 1 × n s + n + s 2 n 1 r 1 × n r + 2 n + r s 1 × n s + 2 n + s r 1 × r + s + 2 r s + n 1 + r 1 + s 2 n 1 r + s + 2 r s + n 2 + r + s

Complexity of Symmetric Difference in Two Complete Bipartite Graphs

The symmetric difference,   G H , of two graphs G and H is the simple graph with V ( G H ) = V ( G ) × V ( H ) , where ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent in G H if either g 1 is adjacent to g 2 in G and h 1 is not adjacent to h 2 in H , or g 1 is not adjacent to g 2 in G and h 1 is adjacent to h 2 in H [20]. The symmetric difference is commutative, G H H G and associative.
Theorem 3.
For  n , r  and  s  are all greater than or equal to 1, we get
τ ( K n , n K r , s ) = n r + s 2 n   r + s 2
Proof. 
Applying Lemma 1, we have
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 det A B B A ,
where A and B are block matrices of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P T T T T T T P , B = Q Q Q Q , P = n r + s + 1 1 1 0 0 1 1 1 n r + s + 1 0 0 0 0 n r + s + 1 1 1 1 1 0 0 1 1 n r + s + 1 , T = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 , Q = 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0 .
Thus, we obtain τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × det ( A + B ) × det ( A B ) , such that
A + B = X J J J J J J X , A B = Y Z Z Z Z Z Z Y , X = n ( r + s ) + 1 1 1 1 1 1 1 1 1 n ( r + s ) + 1 1 1 1 1 n ( r + s ) + 1 1 1 1 1 1 1 1 1 n ( r + s ) + 1 Y = n ( r + s + 1 ) 1 1 1 1 1 1 1 1 n ( r + s + 1 ) 1 1 1 1 n ( r + s + 1 ) 1 1 1 1 1 1 1 1 n ( r + s + 1 ) and   Z = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 .
Applying Lemma 3, we obtain
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 ( det n ( r + s ) 0 0 0 0 0 0 0 n ( r + s ) 0 0 0 0 n ( r + s ) 0 0 0 0 0 0 0 0 n ( r + s ) ) n 1 × det n r + s + 1 n n n n n n n n n r + s + 1 n n n n n r + s + 1 n n n n n n n n n r + s + 1 × ( det n ( r + s ) 0 0 0 0 0 0 0 n ( r + s ) 0 0 0 0 n ( r + s ) 0 0 0 0 0 0 0 0 n ( r + s ) ) n 1 ×   det n ( r + s + 1 ) n n n n n n n n n ( r + s + 1 ) n n n n n ( r + s + 1 ) n n n n n n n 0 n ( r + s + 1 ) .
Applying Lemma 4, we obtain
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × ( n ( r + s ) ) 2 ( n 1 ) ( r + s ) × n ( r + s ) × ( r + s ) ( r + s ) 1 × ( 2 r + 2 s ) × n ( r + s ) ×                                                                                                                                           det = r + s + 1 1 1 1 1 1 1 r + s + 1 r × r × ( r + s 2 r + s ) s ×                                                                                                                                           det r 2 + r ( r + 2 s + 1 ) + s ( r + s + 1 ) r + s 1 1 1 1 1 1 r 2 + r ( r + 2 s + 1 ) + s ( r + s + 1 ) r + s s × s ,
Using Lemma 2, we have
τ ( K n , n K r , s ) = 1 4 n 2 r + s 2 × n r + s 2 r + s n 1 × n r + s × 2 r + s r + s × n r + s × r + s r 1 × 2 r + s × r + s 2 r + s s × r 2 + r r + 2 s + 1 + s r + s + 1 r + s 1 s 1 × r 2 + r r + 2 s + 1 + s r + s + 1 r + s + s 1 = n r + s 2   n r + n s 1 .

5. Complexity of Composition Product of Two Complete Bipartite Graphs

The composition, or lexicographic product of two graphs G and H denoted, G [ H ] is the simple graph with V ( G ) × V ( H ) as the vertex set in which the vertices ( a , b ) and ( c , d ) are adjacent if either a is adjacent to c or a = c and b is adjacent to d in H [19]. This operation is non-commutative, G [ H ] H [ G ] .
One way to view the resulting graph G [ H ] is to replace each vertex in G with a copy of H and each edge in G with a complete bipartite graph connecting the corresponding copies of H .
Theorem 4.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K n , n [ K r , s ] = n 2 n 1 × n + 1 2 n × r + s 2 2 n 1 × n r + s + r 2 n s 1 × n r + s + s 2 n r 1
Proof. 
Applying Lemma 1, we have
τ K n , n [ K r , s ] = 1 4 n 2 ( r + s ) 2 det A B B A ,
where A and B are block matrices of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P J J J J J J P , B = 0 0 0 0 , P = n ( r + s ) + s + 1 1 1 0 0 1 1 1 n ( r + s ) + s + 1 0 0 0 0 n ( r + s ) + r + 1 1 1 1 1 0 0 1 1 n ( r + s ) + r + 1
Thus, we obtain: τ K n , n [ K r , s ] = 1 4 n 2 ( r + s ) 2 ( det ( A ) ) 2
Applying Lemma 3, we have
τ K n , n [ K r , s ] = 1 4 n 2 ( r + s ) 2 × ( d e t n ( r + s ) + s 0 0 1 1 0 0 0 n ( r + s ) + s 1 1 1 1 n ( r + s ) + r 0 0 0 0 1 1 0 0 n ( r + s ) + r ) 2 ( n 1 ) ×   ( det n ( r + s + 1 ) + s n n n 1 n 1 n n n n n ( r + s + 1 ) + s n 1 n 1 n 1 n 1 n ( r + s + 1 ) + r n n n n n 1 n 1 n n n ( r + s + 1 ) + r ) 2 .
Using Lemma 4, we obtain
τ K n , n [ K r , s ] = 1 4 n 2 ( r + s ) 2 × ( det n ( r + s ) + s 0 0 0 0 0 n ( r + s ) + s r × r ) 2 ( n 1 ) ×                                                           ( det ( n ( r + s ) + r ) ( n ( r + s ) + s ) r n ( r + s ) + s r n ( r + s ) + s r n ( r + s ) + s r n ( r + s ) + s r n ( r + s ) + s r n ( r + s ) + s r n ( r + s ) + s ( n ( r + s ) + r ) ( n ( r + s ) + s ) r n ( r + s ) + s s × s ) 2 ( n 1 ) ×                                                                                                                                       × ( det n r + s + 1 + s n n n n n n n r + s + 1 + s ) 2 ×   ( det ( n + r + n ( r + s ) ) ( 2 n r + s ( n + 1 ) ) r ( n 1 ) 2 n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s ( n + r + n ( r + s ) ) ( 2 n r + s ( n + 1 ) ) r ( n 1 ) 2 n ( 2 r + s ) + s ) 2 × = 1 4 n 2 ( r + s ) 2 ( n ( r + s ) + s ) 2 r ( n 1 ) × ( r n ( r + s ) + s ) 2 s ( n 1 ) ×   ( det ( n ( r + s ) + r ) ( n ( r + s ) + s ) r r 1 1 1 1 1 1 ( n ( r + s ) + r ) ( n ( r + s ) + s ) r r s × s ) 2 ( n 1 ) ×   n 2 r × ( det n ( r + s + 1 ) + s n 1 1 1 1 1 1 n ( r + s + 1 ) + s n r × r ) 2 × ( n 2 ( r + s ) + n ( 2 r + s ) r n ( 2 r + s ) + s ) 2 s                   ×   det ( n + r + n ( r + s ) ( 2 n r + s ( n + 1 ) ) r ( n 1 ) 2 n 2 ( r + s ) + n ( 2 r + s ) r 1 1 1 1 1 1 ( n + r + n ( r + s ) ( 2 n r + s ( n + 1 ) ) r ( n 1 ) 2 n 2 ( r + s ) + n ( 2 r + s ) r s × s
Applying Lemma 2, we get
                τ K n , n [ K r , s ] = 1 4 n 2 r + s 2 × n r + s + s 2 r n 1 × r n r + s + s 2 s n 1                                                                                 × n r + s + r n r + s + s r r 1 2 n 1 s 1                                                                                 × n r + s + r n r + s + s r r + s 1 2 n 1 × n 2 r × n r + s + 1 + s n 1 2 r 1                                                                                 × n r + s + 1 + s n + r 1 2 × n 2 r + s + n 2 r + s r s + n r + r + s 2 s                                                                                                 × n + r + n r + s 2 n r + s 1 + n r n 1 2 n 2 r + s + n 2 r + s r 1 2 s 1                                                                                                 × n + r + n r + s 2 n r + s 1 + n r n 1 2 n 2 r + s + n 2 r + s r + s 1 2 = 1 4 n 2 r + s 2 × n r + s + s 2 r s n 1 × n r + s + r n r + s + s 2 n 1 s 1 × ( ( n r + s + r ) n r + s + s r s ) 2 n 1 × n r + s + s 2 r 1 × 2 n r + n s + s 2 2 s × ( ( n + r + n r + s ) 2 n r + s 1 + n r n 1 2 n 2 r + s + n 2 r + s r 2 s 1 × ( ( n + r + n r + s 2 n r + s 1 + n r n 1 2 + s 1 ( n 2 r + s + n 2 r + s r ) ) 2                                 = n 2 n 1 × n + 1 2 n × r + s 2 2 n 1 × n r + s + r 2 n s 1 × n r + s + s 2 n r 1 .
Theorem 5.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K r , s [ K n , n ] = 4 r + s 1 × n 2 n   r + n   s 1 × r s 1 × s r 1 × r + 1 s × s + 1 r × 2 r + 1 2 s   n 1 × 2 s + 1 2 r   n 1
Proof. 
Applying Lemma 1, we have
τ K r , s [ K n , n ] = 1 4 n 2 ( r + s ) 2 det A O O B ,
where A and B are block matrices of order r × r and s × s , respectively, made up of matrices of order ( 2 n ) × ( 2 n ) that are described as follows:
A = P J J J J J J P , B = Q J J J J J J J Q ,   P = n ( 2 s + 1 ) + 1 1 1 0 0 1 1 1 n ( 2 s + 1 ) + 1 0 0 0 0 n ( 2 s + 1 ) + 1 1 1 1 1 0 0 1 1 n ( 2 s + 1 ) + 1   Q = n ( 2 r + 1 ) + 1 1 1 0 0 1 1 1 n ( 2 r + 1 ) + 1 0 0 0 0 n ( 2 r + 1 ) + 1 1 1 1 1 0 0 1 1 n ( 2 r + 1 ) + 1
Thus, we get τ K r , s [ K n , n ] = 1 4 n 2 ( r + s ) 2 × det ( A ) × det ( B ) .
Thus, applying Lemma 3, we have
τ K r , s [ K n , n ] = 1 4 n 2 ( r + s ) 2 × ( det n ( 2 s + 1 ) 0 0 1 1 0 0 0 n ( 2 s + 1 ) 1 1 1 1 n ( 2 s + 1 ) 0 0 0 0 1 1 0 0 n ( 2 s + 1 ) ) ( r 1 ) ×   det n ( 2 s + 1 ) + r r r r 1 r 1 r r r r n ( 2 s + 1 ) + r r 1 r 1 r 1 r 1 n ( 2 s + 1 ) + r r r r r r 1 r 1 r r n ( 2 s + 1 ) + r ×   ( det n ( 2 r + 1 ) 0 0 1 1 0 0 0 n ( 2 r + 1 ) 1 1 1 1 n ( 2 r + 1 ) 0 0 0 0 1 1 0 0 n ( 2 r + 1 ) ) ( s 1 ) × det n ( 2 r + 1 ) + s s s s 1 s 1 s s s s n ( 2 r + 1 ) + s s 1 s 1 s 1 s 1 n ( 2 r + 1 ) + s s s s s s 1 s 1 s s n ( 2 r + 1 ) + s .
Using Lemma 4, we obtain
τ K r , s K n , n = 1 4 n 2 ( r + s ) 2 × ( n ( 2 s + 1 ) ) n r 1 ×   ( det n ( 2 s + 1 ) 2 1 2 s + 1 1 2 s + 1 1 2 s + 1 1 2 s + 1 1 2 s + 1 1 2 s + 1 1 2 s + 1 n ( 2 s + 1 ) 2 1 2 s + 1 ) ( r 1 ) ×   r n × det n ( 2 s + 1 ) + r r 1 1 n 1 1 1 n ( 2 s + 1 ) + r r ×   ( det ( 2 n s + n + r ) ( 2 s + r + 1 ) ( r 1 ) 2 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 r ( 2 s + 3 ) 1 2 s + r + 1 ( 2 n s + n + r ) ( 2 s + r + 1 ) ( r 1 ) 2 2 s + r + 1 n × n ) 2 ×   ( n ( 2 r + 1 ) ) n ( s 1 ) × det n ( 2 r + 1 ) 2 1 2 r + 1 1 2 r + 1 1 2 r + 1 1 2 r + 1 1 2 r + 1 1 2 r + 1 1 2 r + 1 n ( 2 r + 1 ) 2 1 2 r + 1 n × n ) ( s 1 ) × s n × ×   det n ( 2 r + 1 ) + s s 1 1 n 1 1 1 n ( 2 r + 1 ) + s s n × n ×   det ( 2 n r + n + s ) ( 2 r + s + 1 ) ) ( s 1 ) 2 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 s 2 r + 3 1 2 r + s + 1 ( 2 n r + n + s ) ( 2 r + s + 1 ) ) ( s 1 ) 2 2 r + s + 1 n × n
Applying Lemma 2, we obtain
τ K r , s [ K n , n ] = 1 4 n 2 r + s 2 × n 2 s + 1 n r 1 × 1 2 s + 1 n r 1 × n 2 s + 1 2 1 1 1 n 1 r 1                                                                         × n 2 s + 1 2 1 1 + n 1 r 1 × r n × n 2 s + 1 + r r 1 n 1 × n 2 s + 1 + r r + n 1                                                                         × r 2 s + 3 1 2 s + r + 1 n × 2 n s + n + r 2 s + r + 1 r 1 2 r 2 s + 3 1 1 n 1                                                                         × 2 n s + n + r 2 s + r + 1 r 1 2 r 2 s + 3 1 + n 1 × n 2 r + 1 n s 1 × 1 2 r + 1 n s 1                                                                         × n 2 r + 1 2 1 1 1 n 1 s 1 × n 2 r + 1 2 1 1 + n 1 s 1 × s n × n 2 r + 1 + s s 1 n 1                                                                         × n 2 r + 1 + s s + n 1 × s 2 r + 3 1 2 r + s + 1 n × 2 n r + n + s 2 r + s + 1 s 1 2 s 2 r + 3 1 1 n 1                                                                         × 2 n r + n + s 2 r + s + 1 s 1 2 s 2 r + 3 1 + n 1 = 1 4 r + s 2 × n n r 1 × n 2 s + 1 2 n 1 r 1 × n n 2 s + 1 2 r 1 × n 2 s + 1 n 1 × n 1 + 2 s n 1 × 2 n s + n + r 2 s + r + 1 r 1 2 + n 1 r 2 s + 3 1 × n n s 1 × n 2 r + 1 2 n 1 s 1 × n n 2 r + 1 2 s 1 × n 2 r + 1 n 1 × n 1 + 2 r n 1 × 2 n r + n + s 2 r + s + 1 s 1 2 + n 1 s 2 r + 3 1   = 4 r + s 1 × n 2 n   r + n   s 1 × r s 1 × s r 1 × r + 1 s × s + 1 r × 2 r + 1 2 s n 1 × 2 s + 1 2 r n 1

6. Complexity of Disjunction of Two Complete Bipartite Graphs

The disjunction G H of two graphs G and H is the simple graph with V ( G H ) = V ( G ) × V ( H ) where ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent in G H if g 1 is adjacent to g 2 in G or h 1 is adjacent to h 2 in H [20]. This operation is commutative, G H H G .
Theorem 6.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K n , n K r , s = 4 ( r + s ) 2 × n 2 n r + s 2 × 2 s + r 2 n r 1 × 2 r + s 2 n s 1
Proof. 
Applying Lemma 1, we have
τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 det A O O A = 1 4 n 2 ( r + s ) 2 ( det A ) 2 ,
where A is a block matrix of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P Q Q Q Q Q Q P ,   P = n r + 2 s + 1 1 1 0 0 1 1 1 n r + 2 s + 1 0 0 0 0 n 2 r + s + 1 1 1 1 1 0 0 1 1 n 2 r + s + 1 Q = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 .
Applying Lemma 3, we obtain τ K n , n K r , s = 1 4 n 2 ( r + s ) 2
× ( det n ( r + 2 s ) 0 0 0 0 0 0 0 n ( r + 2 s ) 0 0 0 0 n ( 2 r + s ) 0 0 0 0 0 0 0 0 n ( 2 r + s ) ) 2 ( n 1 ) ×   ( det n ( r + 2 s + 1 ) n n 0 0 n n n n n ( r + 2 s + 1 ) 0 0 0 0 n ( 2 r + s + 1 ) n n n n 0 0 n n n ( 2 r + s + 1 ) ) 2 = 1 4 n 2 ( r + s ) 2 × n 2 ( r + s ) ( n 1 ) × ( 2 s + r ) 2 r ( n 1 ) × ( 2 r + s ) 2 s ( n 1 ) × n 2 r × ( det r + 2 s + 1 1 1 1 1 1 1 r + 2 s + 1 r × r ) 2 × n 2 s × ( det 2 r + s + 1 1 1 1 1 1 1 2 r + s + 1 s × s ) 2 .
Applying Lemma 2, we get
τ K n , n K r , s = 1 4 n 2 ( r + s ) 2 × n 2 ( r + s ) ( n 1 ) × ( 2 s + r ) 2 r ( n 1 ) × ( 2 r + s ) 2 s ( n 1 ) × n 2 r × ( r + 2 s ) 2 ( r 1 ) × ( 2 r + 2 s ) 2 × n 2 s × ( 2 r + s ) 2 ( s 1 ) × ( 2 r + 2 s ) 2 = 4 ( r + s ) 2 × n 2 n r + s 2 × 2 s + r 2 n r 1 × 2 r + s 2 n s 1 .

7. Complexity of Strong Sum of Two Complete Bipartite Graphs

The strong sum G H of two graphs G and H is the simple graph with V ( G H ) = V ( G ) × V ( H ) where ( g 1 , h 1 ) and ( g 2 , h 2 ) are adjacent in G H if h 1 is adjacent to h 2 in H and either g 1 is adjacent to g 2 in G , or g 1 = g 2 [20]. This operation is non-commutative, G H H G .
Theorem 7.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K n , n K r , s = 2 n 2 n 1 × n + 1 2 n r + s 2 + 1 × n + 2 2 n 1 × r 2 n s 1 × s 2 n r 1 .
Proof. 
By using Lemma 1, we have
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × det A B B A ,
where A and B are block matrices of order n × n made up of matrices of order ( r + s ) × ( r + s ) that are described as follows:
A = P J J J J J J P , B = Q Q Q Q ,   P = s n + 1 + 1 1 1 0 0 1 1 1 1 s n + 1 + 1 0 0 0 0 r n + 1 + 1 1 1 1 1 0 0 1 1 r n + 1 + 1 ,   Q = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1 .
Thus, we have τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 × det ( A + B ) × det ( A B ) . Such that
A + B = X Y Y Y Y Y Y X , A B = Z W W W W W W Z ,   X = s n + 1 + 2 2 2 0 0 2 2 2 2 s n + 1 + 2 0 0 0 0 r n + 1 + 2 2 2 2 2 0 0 2 2 r n + 1 + 2 ,   Y = 2 2 1 1 2 2 1 1 1 1 2 2 1 1 2 2 , W = 0 0 1 1 0 0 1 1 1 1 0 0 1 1 0 0
 and
Z = s ( n + 1 ) 0 0 0 0 0 0 0 0 s ( n + 1 ) 0 0 0 0 r ( n + 1 ) 0 0 0 0 0 0 0 0 r ( n + 1 ) .
Applying Lemma 3, we obtain τ K n , n K r , s =
1 4 n 2 ( r + s ) 2 × ( det s ( n + 1 ) 0 0 1 1 0 0 0 s ( n + 1 ) 1 1 1 1 r ( n + 1 ) 0 0 0 0 1 1 0 0 r ( n + 1 ) ) n 1 ×   det s n + 1 + 2 n 2 n 2 n n 1 n 1 2 n 2 n 2 n 2 n s n + 1 + 2 n n 1 n 1 n 1 n 1 r n + 1 + 2 n 2 n 2 n 2 n 2 n n 1 n 1 2 n 2 n r n + 1 + 2 n × ( det s n + 1 0 0 1 1 0 0 0 s n + 1 1 1 1 1 r n + 1 0 0 0 0 1 1 0 0 r n + 1 ) n 1 ×   det s n + 1 0 0 n 1 n 1 0 0 0 0 s n + 1 n 1 n 1 n 1 n 1 r n + 1 0 0 0 0 n 1 n 1 0 0 r n + 1 .
Using Lemma 4, we get
τ ( K n , n K r , s ) = 1 4 n 2 ( r + s ) 2 ( det s ( n + 1 ) 0 0 0 0 0 0 s ( n + 1 ) r × r ) ( n 1 ) × ( det r s ( n + 1 ) 2 r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) 2 r s ( n + 1 ) s × s ) ( n 1 ) × det s n + 1 + 2 n 2 n 2 n 2 n 2 n 2 n 2 n s n + 1 + 2 n r × r × det n + 1 ( r + r s + n 3 r + 2 s + r 2 r + s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 r + n ( 3 r + 2 s ) s + n 2 r + s n + 1 ( r + r s + n 3 r + 2 s + r 2 r + s ) s + n 2 r + s s × s × ( det s ( n + 1 ) 0 0 0 0 0 0 s ( n + 1 ) r × r ) ( n 1 ) ×   ( det r s ( n + 1 ) 2 r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) r s ( n + 1 ) 2 r s ( n + 1 ) s × s ) ( n 1 ) ×   det s ( n + 1 ) 0 0 0 0 0 0 s ( n + 1 ) r × r ×   det r s ( n + 1 ) 2 r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r ( n 1 ) 2 s ( n + 1 ) r s ( n + 1 ) 2 r ( n 1 ) 2 s ( n + 1 ) s × s = 1 4 n 2 ( r + s ) 2 [ ( s ( n + 1 ) ] r ( n 1 ) × ( r s ( n + 1 ) ) s ( n 1 ) ×   ( det 1 s ( n + 1 ) 2 1 1 1 1 1 1 1 s ( n + 1 ) 2 s × s ) ( n 1 ) × ( 2 n ) r × det s n + 1 + 2 n 2 n 1 1 1 1 1 1 s n + 1 + 2 n 2 n r × r ×   ( ( n + 1 ) ( r + n ( 3 r + 2 s ) ) s + n ( 2 r + s ) ) s ×   det r + r s + n 3 r + 2 s + r 2 r + s r + n ( 3 r + 2 s ) 1 1 1 1 1 1 r + r s + n 3 r + 2 s + r 2 r + s r + n ( 3 r + 2 s ) s × s × ( s ( n + 1 ) ) r ( n 1 ) × ( r s ( n + 1 ) ) s ( n 1 ) × det 1 s ( n + 1 ) 2 1 1 1 1 1 1 1 s ( n + 1 ) 2 s × s . × ( s ( n + 1 ) ) r × ( r ( n 1 ) 2 s ( n + 1 ) ) s × det ( n 1 ) 2 s ( n + 1 ) 2 ( n 1 ) 2 1 1 1 1 1 1 ( n 1 ) 2 s ( n + 1 ) 2 ( n 1 ) 2 s × s
Applying Lemma 2, we have:
τ ( K n , n K r , s ) = 1 4 n 2 r + s 2 × s n + 1 r n 1 × r s n + 1 s n 1 × s s n + 1 2 n 1 × s n + 1 2 n 1 s 1                                                                     × 2 n r × s n + 1 + 2 n 2 n + r 1 × s n + 1 + 2 n 2 n 1 r 1 × n + 1 r + n 3 r + 2 s s + n 2 r + s s                                                                     × r + r s + n 3 r + 2 s + r 2 r + s n 3 r + 2 s r + s 1 × r + r s + n 3 r + 2 s + r 2 r + s n 3 r + 2 s r 1 s 1                                                                     × s n + 1 r n 1 × r s n + 1 s n 1 × s s n + 1 2 n 1 × s n + 1 2 n 1 s 1                                                                     × s n + 1 r × r n 1 2 s n + 1 s × n 1 2 s n + 1 2 n 1 2 1 s 1                                                                     × n 1 2 s n + 1 2 n 1 2 + s 1   = 1 4 n 2 r + s 2 × s n + 1 r s n 1 × r s n 1 × s s n + 1 2 n 1 × s n + 1 2 n 1 s 1 × s n + 1 r 1 × n + 1 s × r + r s + n 3 r + 2 s + r 2 r + s + s 1 n 3 r + 2 s r × r s 1 × s n + 1 r n 1 × s s n + 1 2 n 1 × s n + 1 2 n 1 s 1 s n + 1 r n s × r n s × n 1 2 s n + 1 2 n 1 2 s 1 × n 1 2 s n + 1 2 + s 1 n 1 2                                                                                           = 2 n 2 n 1 × n + 1 2 n r + s 2 + 1 × n + 2 2 n 1 × r 2 n s 1 × s 2 n r 1 .
Theorem 8.
For  n , r  and  s  are all greater than or equal to 1, we get
τ K r , s K n , n = n 2 n r + s 2 × r s 1 × s r 1 × r + 1 2 s n 1 × s + 1 2 r n 1 × r + 2 s 1 × s + 2 r 1 × r + s + 2
Proof. 
By using Lemma 1, we have
τ ( K r , s K n , n ) = 1 4 n 2 ( r + s ) 2 × det A C C T B ,
where A , B , and C are block matrices of order r × r , s × s , and s × s , respectively made up of matrices of order ( 2 n ) × ( 2 n ) , which are described as follows:
A = P J J J J J J J J J P , B = Q J J J J J J J J J J Q , and   C = W W W W ,   where   P = n s + 1 + 1 1 1 0 0 1 1 1 1 n s + 1 + 1 0 0 0 0 n s + 1 + 1 1 1 1 1 0 0 1 1 n s + 1 + 1 ,   Q = n r + 1 + 1 1 0 0 1 1 1 n r + 1 + 1 0 0 0 0 n r + 1 + 1 1 1 0 0 1 n r + 1 + 1   and   W = 1 1 0 0 1 1 0 0 0 0 1 1 0 0 1 1
Applying Lemma 4, we have
τ K r , s K n , n = 1 4 n 2 ( r + s ) 2 × det ( A ) × det ( D ) ,
such that D = B C T A 1 C is a block matrix of order s × s made up of matrices of order ( 2 n ) × ( 2 n ) described as follows:
D = E F F F F F F E ,   E = a b b c c b b b b a c c c c a b b b b c c b b a   a n d   F = b b d d b b d d d d b b d d b b .
Here,
a = s + 2   2   r + s   1 + n   r + 1 r   r + s + 1 s + 2   2 r + s , b = s + 2   2 r + s r   r + s + 1 s + 2   2 r + s ,   c = r   r 1 s + 2   2 r + s   and   d = r 2 + r 1 + 2 r   1 + s + 1 + s 2 2 + s   2 r + s .
Using Lemma 3, we obtain τ K r , s K n , n = 1 4   n 2   ( r + s ) 2 ×
( det n ( s + 1 ) 0 0 1 1 0 0 0 n ( s + 1 ) 1 1 1 1 n ( s + 1 ) 0 0 0 0 1 1 0 0 n ( s + 1 ) ) r 1 ×   det n s + 1 + r r r r 1 r 1 r r r r n s + 1 + r r 1 r 1 r 1 r 1 n s + 1 + r r r r r r 1 r 1 r r n s + 1 + r × ( det a b 0 0 c d c d 0 0 0 a b c d c d c d c d a b 0 0 0 0 c d c d 0 0 a b ) s 1 ×   det a + b ( s 1 ) b s b s c + d ( s 1 ) c + d ( s 1 ) b s b s b s b s a + b ( s 1 ) c + d ( s 1 ) c + d ( s 1 ) c + d ( s 1 ) c + d ( s 1 ) a + b ( s 1 ) b s b s b s b s c + d ( s 1 ) c + d ( s 1 ) b s b s a + b ( s 1 ) .
Using Lemma 4, we get
τ ( K r , s K n , n ) = 1 4 n 2 ( r + s ) 2 ( det s n + 1 1 1 1 1 1 1 1 s n + 1 1 n × n ) ( r 1 ) ×   ( det s n + 1 + 1 1 1 1 1 1 1 s n + 1 + 1 n × n ) ( r 1 ) ×   det ( n s + 1 + 2 r 1 ) 2 r 1 2 r 1 2 r 1 2 r 1 2 r 1 2 r 1 n ( n s + 1 + 2 r 1 ) n × n   det n s + 1 + 1 1 1 1 1 1 1 n s + 1 + 1 n × n × × ( det a b + ( c d ) ( c d ) ( c d ) ( c d ) ( c d ) ( c d ) ( c d ) a b + ( c d ) n × n ) ( s 1 ) ×   ( det a b ( c d ) d c d c d c d c d c d c a b ( c d ) n × n ) ( s 1 ) ×   det a + c + ( s 1 ) b + d s b + d + ( c d ) s b + d + ( c d ) s b + d + ( c d ) s b + d + ( c d ) s b + d + ( c d ) s b + d + ( c d ) a + c + ( s 1 ) b + d n × n ×   det a c + ( s 1 ) b d s b d ( c d ) s b d ( c d ) s b d ( c d ) s b d ( c d ) s b d ( c d ) s b d ( c d ) a c + ( s 1 ) b d n × n = 1 4 n 2 ( r + s ) 2 × ( det n ( s + 1 ) 1 1 1 1 1 1 1 n ( s + 1 ) 1 n × n ) ( r 1 ) × ( det n s + 1 + 1 1 1 1 1 1 1 n s + 1 + 1 n × n ) ( r 1 ) × ( 2 r 1 ) n ×   det n s + 1 + 2 r 1 2 r 1 1 1 1 1 1 1 n s + 1 + 2 r 1 2 r 1 n × n ×   det n s + 1 + 1 1 1 1 1 1 1 n s + 1 + 1 n × n . ×   ( det ( n r + n 1 ) 1 1 1 1 1 1 ( n r + n 1 ) n × n ) s 1 × ( det ( n r + n + 1 ) 1 1 1 1 1 1 ( n r + n + 1 ) n × n ) ( s 1 ) ×   det 2 r + s n + n r + 2 s 1 r s 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s s 3 r + 2 s ( 2 r + s ) 2 r + s 2 r + s n + n r + 2 s 1 r s 2 r + s n × n   det s + 2 1 + n + n r r + 2 r s + 2 s + 2 r s s + 2 s + 2 r s s + 2 s + 2 r s s + 2 s + 2 r s s + 2 s + 2 r s s + 2 s + 2 r s s + 2 s + 2 1 + n + n r r + 2 r s + 2 n × n
Using Lemma 2, we have τ K r , s K n , n = 1 4 n 2 r + s 2 ×
1 r n 1 × n s + 1 n 1 r 1 × n n s + 1 r 1 × n s + 1 n 1 r 1 × n s + 1 + n r 1 × 2 r 1 n                                                               × n s + 1 + 2 r 1 2 r 1 1 n 1 × n s + 1 + 2 r 1 2 r 1 + n 1 × n s + 1 n 1 × n s + 1 + n                                                               × 1 r s 1 × n r n n 1 s 1 r n s 1 × n r + 1 n 1 s 1 × n r + 2 s 1 × 1 2 r + s n                                                               × n r + 1 2 r + s n 1 × 2 n r + s 2 × 1 s + 2 n × n s + 2 r + 1 n 1 × 2 n r + s + 2                                 = n 2 n r + s 2 × r s 1 × s r 1 × r + 1 2 s n 1 × s + 1 2 r n 1 × r + 2 s 1 × s + 2 r 1 × r + s + 2 ) .

8. Numerical Results

Using the formulas provided in Theorems 1–8, Table 1, Table 2, Table 3 and Table 4 show some of the values of the number of spanning trees in the various products studied above.

9. Conclusions

Graph products are crucial in discrete mathematics because they allow the construction of large, complex networks from smaller, simpler graphs. Additionally, they facilitate network optimization, structural feature analysis, and spectral data analysis. The number of spanning trees (complexity) is measured by the complexity of graph products (such as Cartesian, tensor, and strong), which is a vital indicator of network efficiency and dependability. Breaking down vast, complex networks into smaller, simpler components enables calculation of their structural features. This is crucial for optimization in computer science, chemistry, and biology. Additionally, they enable the discovery of hidden patterns, the optimization of pathways, and the creation of complex networks from smaller ones through effective computation in social network analysis and chemistry. They facilitate the description of regular structures like grids and hypercubes and aid large-scale decomposition and graph visualization. In this work, using linear algebra techniques and block matrices, we calculated explicit formulas for the number of spanning trees of seven types of products of two complete bipartite graphs.

Author Contributions

Conceptualization, S.N.D. and A.A.; methodology, S.N.D. and A.A.; software, S.N.D. and A.A.; validation, S.N.D. and A.A.; formal analysis, S.N.D. and A.A.; investigation, S.N.D. and A.A.; resources, S.N.D. and A.A.; data curation, S.N.D. and A.A.; writing—original draft, S.N.D. and A.A.; writing—review and editing, S.N.D. and A.A.; visualization, S.N.D. and A.A.; supervision, S.N.D. and A.A.; project administration, S.N.D. and A.A.; funding acquisition, A.A. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by King Khalid University grant number RGP.2/229/46.

Data Availability Statement

No new data were created or analyzed in this study.

Acknowledgments

The authors extend their appreciation to the Deanship of Scientific Research at King Khalid University for funding this work through the Large Groups program (project under grant number RGP.2/229/46). Also, the authors would extend their gratitude to anonymous referees for their valuable feedback, which significantly enhanced the quality of the manuscript.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. Cvetković, D.; Doob, M.; Sachs, H. Spectra of Graphs: Theory and Applications, 3rd ed.; Johann Ambrosius Barth: Heidelberg, Germany, 1995. [Google Scholar]
  2. Applegate, D.L.; Bixby, R.E.; Chvátal, V.; Cook, W.J. The Traveling Salesman Problem; Princeton University Press: Princeton, NJ, USA, 2011. [Google Scholar]
  3. Singh, R.P.; Vandana. Application of Graph Theory in Computer Science and Engineering. Int. J. Comput. Appl. 2014, 104, 10–13. [Google Scholar] [CrossRef] [Scilit]
  4. Deo, N. Graph Theory with Applications to Engineering and Computer Science; Prentice-Hall: Hoboken, NJ, USA, 1974. [Google Scholar]
  5. Erdos, P.D.; Hsu, F. Distributed loop networks with minimum transmission delay. Theor. Comput. Sci. 1992, 100, 223–241. [Google Scholar] [CrossRef] [Scilit]
  6. Kirchhoff, G.R. Über die Auflösung der Gleichungen, auf welche man bei der untersuchung der linearen verteilung galvanischer Ströme geführt wird. Ann. Phys. Chem. 1847, 72, 497–508. [Google Scholar] [CrossRef] [Scilit]
  7. Cayley, G.A. A Theorem on Trees, Quart. J. Math. 1889, 23, 276–378. [Google Scholar]
  8. Fiedler, M.; Sedláček, J. O W-basích orientovaných grafů. Čas. Pěst. Mat. 1958, 83, 214–225. [Google Scholar] [CrossRef] [Scilit]
  9. Onodera, R. On the number of trees in a complete n-partite graph. Matrix Tensor Q. 1972/73, 23, 142–146. [Google Scholar]
  10. Daoud, S.N. Number of Spanning Trees of Different Products of Complete and Complete Bipartite Graphs. J. Math. Probl. Eng. 2014, 2014, 965105. [Google Scholar] [CrossRef] [Scilit]
  11. Kelmans, A.K.; Chelnokov, V.M. A certain polynomial of a graph and graphs with an extermal number of trees. J. Comb. Theory (B) 1974, 16, 197–214. [Google Scholar] [CrossRef] [Scilit]
  12. Temperley, H.N.V. Graph Theory and Applications; Ellis Horwood Series in Mathematics and its Applications; Wiley: New York, NY, USA, 1981. [Google Scholar]
  13. Prüfer, H. Neuer Beweis eines Satzes über Permutationen. Arch. Math. Phys. 1918, 27, 742–744. [Google Scholar]
  14. Daoud, S.N. The Deletion—Contraction Method for Counting the Number of Spanning Trees of Graphs. Eur. J. Phys. Plus 2015, 130, 217. [Google Scholar] [CrossRef] [Scilit]
  15. Teufl, E.; Wagner, S. On the number of spanning trees on various lattices. J. Phys. A 2010, 43, 415001. [Google Scholar] [CrossRef] [Scilit]
  16. Daoud, S.N.; Saleha, W. Complexity trees of the sequence of some nonahedral graphs generated by triangle. Heliyon 2020, 6, e04786. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  17. Nikolopoulos, S.D.; Palios, L.; Papadopoulos, C. Counting spanning trees using modular decomposition. Theor. Comput. Sci. 2014, 526, 41–57. [Google Scholar] [CrossRef] [Scilit]
  18. Marcus, M.; Minc, H. A Survey of Matrix Theory and Matrix Inequalities; Allyn and Bacon. Inc.: Boston, MA, USA, 1964. [Google Scholar]
  19. Balakrishnan, R.; Ranganathan, K. Textbook of Graph Theory; Springer: New York, NY, USA, 2000. [Google Scholar]
  20. Harary, F.; Wilcox, G.W. Boolean operations on graphs. Math. Scand. 1967, 20, 41–51. [Google Scholar] [CrossRef] [Scilit]
Table 1. Selected numbers of spanning trees, K n , n K r , s and K n , n K r , s .
Table 1. Selected numbers of spanning trees, K n , n K r , s and K n , n K r , s .
n r s τ ( K n , n K r , s ) n r s τ K n , n K r , s
1 1 1 4 1 1 1 16
1 1 2 15 1 1 2 192
1 1 3 54 1 1 3 2048
1 2 2 384 1 2 2 20,736
1 2 3 6720 1 2 3 1,327,104
2 1 2 31,500 2 1 2 38,663,100
2 2 2 42,467,328 2 2 2 3,822,059,520,000
2 2 3 34,139,750,400 2 2 3 130,540,218,148,454,400
3 1 2 1,693,052,928 3 1 2 267,411,375,000,000
3 2 2 194,481,000,000,000 3 2 2 60,464,744,163,332,470,241,280
Table 2. Selected numbers of spanning trees, K n , n [ K r , s ] and K r , s [ K n , n ] .
Table 2. Selected numbers of spanning trees, K n , n [ K r , s ] and K r , s [ K n , n ] .
n r s τ ( K n , n K r , s ) n r s τ K r , s [ K n , n ]
1 1 1 16 1 1 1 16
1 1 2 576 1 1 2 192
1 1 3 40,000 1 1 3 2048
1 2 2 82,944 1 2 2 20,736
1 2 3 15,366,400 1 2 3 1,327,104
2 1 2 567,106,596 2 1 2 398,131,200
2 2 2 132,710,400,000,000 2 2 2 132,710,400,000,000
2 2 3 62,171,080,298,496,000,000 2 2 3 13,051,398,979,584,000,000
3 1 2 19,591,041,024,000,000 3 1 2 33,891,544,377,720,000
3 2 2 19,723,378,462,269,065,863,888,896 3 2 2 99,291,633,919,101,562,500,000,000
Table 3. Selected numbers of spanning trees, K n , n K r , s and K n , n K r , s .
Table 3. Selected numbers of spanning trees, K n , n K r , s and K n , n K r , s .
n r s τ ( K n , n K r , s ) n r s τ K n , n K r , s
1 1 1 4 1 1 1 16
1 1 2 81 1 1 2 576
1 1 3 4096 1 1 3 40,000
1 2 2 4096 1 2 2 82,944
1 2 3 390,625 1 2 3 15,366,400
2 1 2 60,466,176 2 1 2 3,774,873,600
2 2 2 4,398,046,511,104 2 2 2 2,282,521,714,753,536
2 2 3 1,000,000,000,000,000,000 2 2 3 1,941,155,130,215,130,726,400
3 1 2 1,853,020,188,851,841 3 1 2 1,015,599,566,684,160,000
3 2 2 552,061,438,912,436,417,593,344 3 2 2 7,342,984,060,644,141,028,475,928,576
Table 4. Selected numbers of spanning trees, K n , n K r , s and K r , s K n , n .
Table 4. Selected numbers of spanning trees, K n , n K r , s and K r , s K n , n .
n r s τ ( K n , n K r , s ) n r s τ ( K r , s K n , n )
1 1 1 4 1 1 1 4
1 1 2 32 1 1 2 15
1 1 3 192 1 1 3 54
1 2 2 4096 1 2 2 384
1 2 3 221,184 1 2 3 6720
2 1 2 248,832 2 1 2 2,211,840
2 2 2 41,278,242,816 2 2 2 41,278,242,816
2 2 3 914,039,610,015,744 2 2 3 328,758,271,672,320
3 1 2 53,084,160,000 3 1 2 13,389,252,099,840
3 2 2 28,499,341,391,953,920,000 3 2 2 518,727,059,586,428,962,176
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Daoud, S.N.; Asiri, A. Counting Spanning Trees in Various Products of Two Complete Bipartite Graphs. Mathematics 2026, 14, 1996. https://doi.org/10.3390/math14111996

AMA Style

Daoud SN, Asiri A. Counting Spanning Trees in Various Products of Two Complete Bipartite Graphs. Mathematics. 2026; 14(11):1996. https://doi.org/10.3390/math14111996

Chicago/Turabian Style

Daoud, Salama Nagy, and Ahmad Asiri. 2026. "Counting Spanning Trees in Various Products of Two Complete Bipartite Graphs" Mathematics 14, no. 11: 1996. https://doi.org/10.3390/math14111996

APA Style

Daoud, S. N., & Asiri, A. (2026). Counting Spanning Trees in Various Products of Two Complete Bipartite Graphs. Mathematics, 14(11), 1996. https://doi.org/10.3390/math14111996

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop