Chemical equation balancing: An integer programming approach

  • Authors:
  • S. K. Sen;Hans Agarwal;Sagar Sen

  • Affiliations:
  • Department of Mathematical Sciences, Florida Institute of Technology, 150 West University Boulevard, Melbourne, FL 32901-6975, USA;Energy Research Center, Lehigh University, 117ATLSS Drive, Bethlehem, PA 18018, USA;Modeling, Simulation and Design Laboratory, School of Computer Science, McGill University, McConnell Engineering Building, Room 202, 3480 University Street, Montreal, Quebec, Canada H3A 2A7

  • Venue:
  • Mathematical and Computer Modelling: An International Journal
  • Year:
  • 2006

Quantified Score

Hi-index 0.98

Visualization

Abstract

Presented here is an integer linear program (ILP) formulation for automatic balancing of a chemical equation. Also described is a integer nonlinear programming (INP) algorithm for balancing. This special algorithm is polynomial time O(n^3), unlike the ILP approach, and uses the widely available conventional floating-point arithmetic, obviating the need for both rational arithmetic and multiple modulus residue arithmetic. The rational arithmetic is unsuitable due to intermediate number growth, while the residue arithmetic suffers from the lack of a priori knowledge of the set of prime bases that avoids a possible failure due to division by zero. Further, unlike the floating point arithmetic, both arithmetics are not built-in/standard and hence additional programming effort is needed. The INP algorithm has been tested on several typical chemical equations and found to be very successful for most problems in our extensive balancing experiments. This algorithm also has the capability to determine the feasibility of a new chemical reaction and, if it is feasible, then it will balance the equation and also provide the information if two or more linearly independent balancings exist through the rank information. Any general method to solve the ILP is fail-proof, but it is not polynomial time. Since we have not encountered truly large chemical equations having, say, 1000 products and reactants in a real-world situation, a non-polynomial ILP solver is also useful. A justification for the objective functions for ILP and INP algorithms, each of which produces a unique solution, is provided.