Next Article in Journal
Optimization on the Financial Management of Construction Companies with Goal Programming Model
Previous Article in Journal
New Aspects in the Theory of Complete Hypergroups
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Proceeding Paper

A Branch and Bound Algorithm for Counting Independent Sets on Grid Graphs †

Faculty of Computer Science, Benemérita Universidad Autónoma de Puebla, Puebla 72592, Mexico
*
Author to whom correspondence should be addressed.
Presented at the 1st International Online Conference on Mathematics and Applications, 1–15 May 2023; Available online: https://iocma2023.sciforum.net/.
Comput. Sci. Math. Forum 2023, 7(1), 28; https://doi.org/10.3390/IOCMA2023-14434
Published: 29 April 2023

Abstract

:
A relevant problem in combinatorial mathematics is the problem of counting independent sets of a graph G, denoted by i ( G ) . This problem has many applications in combinatorics, physics, chemistry and computer science. For example, in statistical physics, the computation of i ( G ) has been useful in studying the behavior of the particles of a gas on a space modeled by a grid structure. Regarding hard counting problems, the computation of i ( G ) for a graph G has been key to determining the frontier between efficient counting and intractable counting procedures. In this article, a novel algorithm for counting independent sets on grid-like structures is presented. We propose a novel algorithm for the computation of i ( G m , n ) for a grid graph with m rows and n columns based on the ‘Branch and Bound’ design technique. The splitting rule in our proposal is based on the well-known vertex reduction rule. The vertex in any subgraph from G m , n , which is to be selected for the reduction rule, must have four internal incident faces. The ramification process is used to build a computation tree. Our proposal consists of decomposing the initial grid graph until outerplanar graphs are obtained as the ‘basic subgrids’ associated with the leave nodes of the computation tree. The resulting time-complexity of our proposal is inferior to the time-complexity of other classic methods, such as the transfer matrix method.

1. Introduction

Although counting problems have a long tradition in combinatorics, the complexity theory results are not as numerous as the decision problems at present. For example, there are few graph counting problems that can be solved in polynomial time at present. Counting problems have emerged as an important line of research in the area of combinatorial mathematics and complexity theory as counting algorithms have been used as a tool for solving practical problems in mathematics, physics, chemistry and engineering. Counting independent sets on a graph is recognized as an intractable problem, although efficient algorithms have been designed to solve this problem over specific graph topologies.
Computing the number of independent sets on mesh structures, as is the case for a grid graph G m , n (a grid with m rows and n columns), has different applications. For example, in the "hard square model" used in statistical physics and to obtain the hard quadratic entropy constant [1], diverse researchers have considered the problem of counting independent sets on grid graphs. Among those researchers, Calkin [2] and Euler [3] have introduced a matrix method for counting independent sets, called the transfer matrix method. This last method has been adapted as a counting method to attack statistical physic problems. For example, in physics, a model based on a grid graph is used (the hard square model) to model, in a statistical way, the behavior of the particles of a gas, as well as to count q-particle Widow–Rowlinson configurations by considering, for instance, q > 2 [4,5].
On the other hand, a graph invariant is any function on a graph that does not depend on the labelling of its vertices. A topological index is a numerical value that is correlated with the chemical constitution or physical properties of a molecular graph.
Since the pioneering works from Merrifield and Simmons [6], the correlation between the number of independent sets of a molecular graph G (denoted by i ( G ) ) and the boiling point of the chemical compound, represented by that molecular graph, has been recognized. Since that previous initial study, much researching has been carried out in the area of computational chemistry on the calculation of i ( G ) for different topologies of molecular graphs.
The branch and bound paradigm has been widely used to attack problems with an intrinsic combinatorial exponential character. This method allows for us to branch the original problem into similar subproblems with lower input parameters than the original problem. This branching process is continued by the formation of a computation tree whose leaves have associated instances derived from the original problem, allowing for such instances to be solved efficiently.
In this article, we present a branch and bound algorithm in order to compute the Merrifield–Simmons topological index of a grid G m , n . Our proposal provides an exact algorithm that can be applied to any type of grid, whether regular, irregular, or with non-squares internal faces. The complexity function of the time for our proposal in the calculation of i ( G m , n ) has a much smaller growth than the growth in the complexity function for the classical method of the transfer matrix.

2. Preliminares

Let G = ( V , E ) be an undirected simple graph with a set of vertices V and a set of edges E. The edge connecting the vertices u and v is denoted by u v , or we can also use the notation { u , v } to denote the edge u v .
We denote N ( x ) = { y V : { x , y } E } as the neighborhood of x V . Meanwhile, N [ x ] = N ( x ) { x } is the closed neighborhood of x. Let | A | be the cardinality of the set A. Furthermore, we denote the degree of a vertex x as δ ( x ) = | N ( x ) | . Meanwhile, the degree of the graph G is Δ ( G ) = m a x { δ ( x ) : x V } .
Given a subset of vertices S V of a graph G, S is called an independent set of G if, for any u , v S , it holds that { u , v } E ( G ) . In order to denote all the independent sets of G, the notation I ( G ) is used. We will use the notation I v ( G ) to denote those independent sets from G, where the vertex v appears. Meanwhile, I v ( G ) denotes those independent sets from G where the vertex v does not appear.
On the other hand, if we want to express the number of independent sets in G, the notation i ( G ) is used. In this case, i ( G ) = | I ( G ) | . However, when an independent set S I ( G ) is not a subset of any other independent set of G, then S is a maximal independent set. Meanwhile, S will be a maximum independent set (MIS of G) if S has the maximum length among all the elements of I ( G ) .
It is known that the computation of i ( G ) , for any graph G where Δ ( G ) 3 , is a #P-complete problem [4,7,8]. The computation of i ( G ) remains #P-complete, even if it is restricted to three regular graphs [7]. However, for a few graph topologies G, there are efficient procedures to compute i ( G ) [9,10,11,12].
Planar graphs play an important role in both the graph theory and the graph-drawing area. When a graph G can be drawn as an embedding in the plane, then G is called a planar graph. The internal regions delimited by the vertices and edges are called the internal faces of the graph. Meanwhile, the unbounded face is called the outer face or the external face of the graph. When a planar graph can be drawn with all of its vertices incident to the outer face, then the graph G is called outerplanar. Given an embedding of a planar graph G, we differentiate external vertices to all vertex of G incident to the outer face; otherwise, it is an internal vertex of G.
Let F ( G ) = { f 1 , , f k } be the set of non-intersected internal faces (or just faces) of the planar graph G. Note that the outer face of the graph is not considered in F ( G ) . Two different faces of G are adjacent when they have common edges; otherwise, we say that both faces are independent. Thus, two independent faces can have common vertices, but no common edges.
A special planar graph is the called grid graph. Let G = ( V , E ) be a grid graph of size m x n ; then, the vertex set is V = { ( i , j ) : 1 i m , 1 j n } , and the edge set is E = { ( ( j , i ) , ( j + 1 , i ) ) | 1 j < m , 1 i n } { ( ( j , i ) , ( j , i + 1 ) ) | 1 j < m , 1 i < n } . In our case, we consider that the grid graph has m rows and n columns; then, it is denoted as G m , n , letting k = m n be the number of internal faces (tiling) in G m , n .
There is some research on embedded structures in a grid graph, e.g., spanning trees, Hamiltonian cycles, independent sets, acyclic orientations, and k-coloring [2,3,13,14]. Applications of the counting objects on grids also include, for instance, tiling and efficient coding schemes in data storage [15].
One of the main methods of counting independent sets on grid graphs is the transfer matrix method [2,3]. However, this method has an exponential complexity time over dimensions m and n of the grid.

3. A Branch and Bound Algorithm

There are two common rules for counting combinatorial objects on graphs. Those rules allow for us to decompose the graph based on a vertex or an edge.
  • Vertex reduction rule: let v V ( G ) ,
    i ( G ) = i ( G v ) + i ( G ( N [ v ] ) )
  • Edge division rule: let e = { x , y } E ( G ) ,
    i ( G ) = i ( G e ) i ( G ( N [ x ] N [ y ] ) )
The other decomposition rule for counting independent sets of a graph is to consider each connected component of the graph in an independent way. For example, if G i , i = 1 , , k are the connected components of G, then i ( G ) = i = 1 k i ( G i ) , and the total time complexity for computing i ( G ) will be T ( i ( G ) ) = m a x { T ( i ( G i ) ) : G i is a connected component of G } .
We designed a typical branch and bound algorithm in order to count the number of independent sets from a grid graph that we denote as the BB algorithm. BB builds a computation tree. In the ramification processes of the computation tree, BB considers two main points: the criterion to choose a vertex v when applying the vertex division rule, and a halting criterion to stop the branching on any node of the computation tree. The selected vertex v from any subgraph to apply the vertex division rule holds:
  • N [ v ] is at least incident to five internal faces from the current graph.
  • One of the internal faces incident to v has a maximum size with respect to the other internal faces in the subgraph, or it is incident to at least one face with vertices in the outerface.
The application of the division rule on the vertex v builds two new child nodes v 1 and v 2 from the current node in the computation tree. The subgraph associated with v 1 is formed as G 1 = G { v } , and the subgraph associated with v 2 is formed as G 2 = G N [ v ] .
At this stage, we have a similar problem for each subgraph G i , i = 1 , 2 to the problem we had with the original grid G. If we solve the problem in a recurrent way and r i is its solution, then the complete solution for r = i ( G ) is r = r 1 + r 2 . The above procedure determines a enumerative tree whose leaves correspond to the basic subgraph instances.
This process of ramification iterates until obtained as subgraph associated with each child-node-based instance G p . The main characteristic of the topology of any base instance G p is that no vertex u V ( G p ) exists that is incident to four internal faces and, in this case, we achieved a child node for the enumerative tree. In Figure 1, an example of the computation tree formed by the algorithm BB can be seen for an initial input grid G 4 , 5 .
We have shown that, for the basic prime graph G p , i ( G p ) can be computed in linear time regarding its number of edges, since we can consider those basic prime graphs as outerplanar graphs [16,17]. Let us define H ( E G ) = { G p : G p is the graph associated to a leaf node of the previous enumerative tree. }. After E G has been built, i ( G ) = Σ G p H ( E G ) i ( G p ) . As the computation for each i ( G p ) can be carried out in linear time, then the complexity time for i ( G ) depends on the time complexity of the number of nodes of the enumerative tree.
Let k = n · m be the number of internal tiling faces existing on the initial grid G m , n . Then, the complexity time of the branch and bound procedure depends on the recurrence i ( G ) = i ( G { u } ) + i ( G N [ u ] ) . This splitting rule has different cases according of the number of internal faces incident to the vertices in N [ u ] . In the best case, N [ u ] can be incident to eight tiling faces and, in this case, the decomposition rule expressed by the number of rectangles that are decomposed is given by the recurrence: T ( k ) = T ( k 8 ) + T ( k 3 ) .
However, in the worst case, if G does not correspond to a basic case, then N [ u ] should be incident to at least five internal tilings. In this case, the splitting rule expressed by the number of rectangles that are decomposed is given by the recurrence:
T ( k ) = T ( k 5 ) + T ( k 3 )
We seek a solution to the form x k = T ( k ) . Substituting this into the previous recurrence relation (1) leads to the characteristic polynomial: P ( x ) = x 5 x 2 1 , whose five roots r i , i = 1 , , 5 give rise to solutions of the form T ( k ) = r i k .
As we are interested in the asymptotic behavior of the recurrence T ( k ) , we only consider the real root r 1 , such that | r 1 | | r i | , i = 2 , , 5 . In this case, the maximum real root is r 1 1.194 , and then we obtain a worst-case upper bound of O ( r 1 k · p o l y ( k ) ) , where p o l y ( k ) is a polynomial function that corresponds to the time-processing of the basic case graphs. Thus, the complexity time of our proposal has an upper bound of O ( 1 . 1939 k · p o l y ( k ) ) = O ( 1 . 1939 m · n · p o l y ( k ) ) .
Our proposal works without any problem on irregular grids or on variants of grids such as the aztec diamonds graphs [18], since it looks for vertices incident to more than three internal faces. On the other hand, although our proposal continues to have an exponential time-complexity, it does not have the explosive combinatorial character that the classic transfer matrix method has for the computation of i ( G m , n ) .

4. Conclusions

We introduced a branch and bound algorithm for the computation of i ( G m , n ) , for a grid graph with m rows and n columns. We applied the well-known vertex reduction rule as the splitting rule. The vertex v in any subgraph from G m , n , which is to be selected for the reduction rule, must hold that N [ v ] is incident to at least five internal faces. Our proposal consists of decomposing the initial grid graph until only outerplanar subgraphs are obtained as basic cases.
The resulting time-complexity of our proposal for computing the number of independent sets for grid graphs is dramatically inferior to the time-complexity that the classic transfer matrix method required to compute the same value.

Author Contributions

Conceptualization, G.D.I.; methodology, G.D.I. and P.B.; validation, P.B. and M.T.; writing—original draft preparation, G.D.I.; writing—review and editing, P.B. and M.T. All authors have read and agreed to the published version of the manuscript.

Funding

The authors give thanks to Conahcyt-México for the economical support for this researching.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Baxter, R.J. Planar lattice gases with nearest-neighbor exclusion. Ann. Comb. 1999, 3, 191–203. [Google Scholar] [CrossRef]
  2. Calkin, N.J.; Wilf, H.S. The Number of Independent Sets in a Grid Graph. SIAM J. Discret. Math. 1998, 11, 54–60. [Google Scholar] [CrossRef]
  3. Euler, R. The Fibonacci number of a grid graph and a new class of integer sequences. J. Integer Seq. [Electron. Only] 2005, 8, 1–16. [Google Scholar]
  4. Vadhan, S.P. The Complexity of Counting in Sparse, Regular, and Planar Graphs. SIAM J. Comput. 2001, 31, 398–427. [Google Scholar] [CrossRef]
  5. Dyer, M.E.; Greenhill, C.S. Corrigendum: The complexity of counting graph homomorphisms. Random Struct. Algorithms 2004, 25, 346–352. [Google Scholar] [CrossRef]
  6. Merrifield, R.E.; Simmons, H.E. Topological Methods in Chemistry; Wiley: New York, NY, USA, 1989. [Google Scholar]
  7. Greenhill, C.S. The complexity of counting colourings and independent sets in sparse graphs and hypergraphs. Comput. Complex. 2000, 9, 52–72. [Google Scholar] [CrossRef]
  8. Luby, M.; Vigoda, E. Approximately Counting up to Four (Extended Abstract). In Proceedings of the Twenty-Ninth Annual ACM Symposium on Theory of Computing; STOC ’97; Association for Computing Machinery: New York, NY, USA, 1997; pp. 682–687. [Google Scholar] [CrossRef]
  9. Bubley, R. Randomized Algorithms: Approximation, Generation, and Counting; BAR International; Springer: London, UK, 2001. [Google Scholar]
  10. Dahllöf, V.; Jonsson, P. An Algorithm for Counting Maximum Weighted Independent Sets and Its Applications. In Proceedings of the Thirteenth Annual ACM-SIAM Symposium on Discrete Algorithms; SODA ’02; Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 2002; pp. 292–298. [Google Scholar]
  11. Roth, D. On the hardness of approximate reasoning. Artif. Intell. 1996, 82, 273–302. [Google Scholar] [CrossRef]
  12. De Ita, G.; Contreras, M.; Bello, P.; Moyao, Y.; López, C. Recognition of graph topologies for the efficient counting of its number of independent sets. In Combinational Algorithms and Learning; Zacarias, F., Moyao, Y., Contreras, M., De Ita, G., Bello, P., Eds.; Montiel & Soriano: Puebla, Mexico, 2017; pp. 33–44. [Google Scholar]
  13. Golin, M.J.; Leung, Y.; Wang, Y.; Yong, X. Counting Structures in Grid Graphs, Cylinders and Tori Using Transfer Matrices: Survey and New Results. In Proceedings of the Seventh Workshop on Algorithm Engineering and Experiments and the Second Workshop on Analytic Algorithmics and Combinatorics, ALENEX/ANALCO 2005, Vancouver, BC, Canada, 22 January 2005; pp. 250–258. [Google Scholar]
  14. Guillen, C.; Lopez, A.L.; DeIta, G. Computing #2-SAT of Grids, Grid-Cylinders and Grid-Tori Boolean Formulas. In Proceedings of the 15th RCRA workshop on Experimental Evaluation of Algorithms for Solving Problems with Combinatorial Explosion, Udine, Italy, 12–13 December 2008; Volume 451, pp. 152–167. [Google Scholar]
  15. Roth, R.; Siegel, P.; Wolf, J. Efficient coding schemes for the hard-square model. IEEE Trans. Inf. Theory 2001, 47, 1166–1176. [Google Scholar] [CrossRef]
  16. De Ita, G.; Rodríguez, M.; Bello, P.; Contreras, M. Basic Pattern Graphs for the Efficient Computation of Its Number of Independent Sets. In Proceedings of the Pattern Recognition-12th Mexican Conference, MCPR 2020, Morelia, Mexico, 24–27 June 2020; Figueroa-Mora, K.M., Anzurez-Marin, J., Jacobo, J.C., Carrasco-Ochoa, J.A., Trinidad, J.F.M., Olvera-López, J.A., Eds.; Lecture Notes in Computer Science. Springer: Berlin, Germany, 2020; Volume 12088, pp. 57–66. [Google Scholar] [CrossRef]
  17. Medina, M.A.L.; Marcial-Romero, J.R.; Luna, G.D.I.; Moyao, Y. A Linear Time Algorithm for Computing #2SAT for Outerplanar 2-CNF Formulas. In Proceedings of the Pattern Recognition-10th Mexican Conference, MCPR 2018, Puebla, Mexico, 27–30 June 2018; Trinidad, J.F.M., Carrasco-Ochoa, J.A., Olvera-López, J.A., Sarkar, S., Eds.; Lecture Notes in Computer Science. Springer: Berlin, Germany, 2018; Volume 10880, pp. 72–81. [Google Scholar] [CrossRef]
  18. Zhang, Z. Merrifield-Simmons index of generalized Aztec diamond and related graphs. MATCH Commun. Math. Comput. Chem. 2006, 56, 625–636. [Google Scholar]
Figure 1. Processing the grid G 4 , 5 .
Figure 1. Processing the grid G 4 , 5 .
Csmf 07 00028 g001
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

De Ita, G.; Bello, P.; Tovar, M. A Branch and Bound Algorithm for Counting Independent Sets on Grid Graphs. Comput. Sci. Math. Forum 2023, 7, 28. https://doi.org/10.3390/IOCMA2023-14434

AMA Style

De Ita G, Bello P, Tovar M. A Branch and Bound Algorithm for Counting Independent Sets on Grid Graphs. Computer Sciences & Mathematics Forum. 2023; 7(1):28. https://doi.org/10.3390/IOCMA2023-14434

Chicago/Turabian Style

De Ita, Guillermo, Pedro Bello, and Mireya Tovar. 2023. "A Branch and Bound Algorithm for Counting Independent Sets on Grid Graphs" Computer Sciences & Mathematics Forum 7, no. 1: 28. https://doi.org/10.3390/IOCMA2023-14434

APA Style

De Ita, G., Bello, P., & Tovar, M. (2023). A Branch and Bound Algorithm for Counting Independent Sets on Grid Graphs. Computer Sciences & Mathematics Forum, 7(1), 28. https://doi.org/10.3390/IOCMA2023-14434

Article Metrics

Back to TopTop