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
(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,
[
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
) 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
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 . 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 has a much smaller growth than the growth in the complexity function for the classical method of the transfer matrix.
2. Preliminares
Let 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 , or we can also use the notation to denote the edge .
We denote as the neighborhood of . Meanwhile, is the closed neighborhood of x. Let be the cardinality of the set A. Furthermore, we denote the degree of a vertex x as . Meanwhile, the degree of the graph G is .
Given a subset of vertices of a graph G, S is called an independent set of G if, for any , it holds that . In order to denote all the independent sets of G, the notation is used. We will use the notation to denote those independent sets from G, where the vertex v appears. Meanwhile, 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 is used. In this case, . However, when an independent set 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 .
It is known that the computation of
, for any graph
G where
, is a #P-complete problem [
4,
7,
8]. The computation of
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
[
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 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 . 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 be a grid graph of size ; then, the vertex set is , and the edge set is . In our case, we consider that the grid graph has m rows and n columns; then, it is denoted as , letting be the number of internal faces (tiling) in .
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
,
Edge division rule: let
,
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 are the connected components of G, then , and the total time complexity for computing will be : is a connected component of .
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:
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 and from the current node in the computation tree. The subgraph associated with is formed as , and the subgraph associated with is formed as .
At this stage, we have a similar problem for each subgraph to the problem we had with the original grid G. If we solve the problem in a recurrent way and is its solution, then the complete solution for is . 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
. The main characteristic of the topology of any base instance
is that no vertex
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
.
We have shown that, for the basic prime graph
,
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
is the graph associated to a leaf node of the previous enumerative tree. }. After
has been built,
. As the computation for each
can be carried out in linear time, then the complexity time for
depends on the time complexity of the number of nodes of the enumerative tree.
Let be the number of internal tiling faces existing on the initial grid . Then, the complexity time of the branch and bound procedure depends on the recurrence . This splitting rule has different cases according of the number of internal faces incident to the vertices in . In the best case, 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: .
However, in the worst case, if
G does not correspond to a basic case, then
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:
We seek a solution to the form
. Substituting this into the previous recurrence relation (
1) leads to the characteristic polynomial:
, whose five roots
give rise to solutions of the form
.
As we are interested in the asymptotic behavior of the recurrence , we only consider the real root , such that . In this case, the maximum real root is , and then we obtain a worst-case upper bound of , where 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 .
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
.
4. Conclusions
We introduced a branch and bound algorithm for the computation of , 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 , which is to be selected for the reduction rule, must hold that 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.