Unless otherwise stated, hydrogen atoms are usually ignored in the computation of such indices as organic chemists usually do when they write a benzene ring as a hexagon (Devillers and Balaban 1999, p. 25).

Since disconnected graphs have an infinite element in each distance matrix row or column, summing gives infinity and taking
the reciprocal gives 0 for each term, resulting in an overall value of 0.

Precomputed values for many graphs is implemented in the Wolfram Language as GraphData[g,
"BalabanIndex"].

Babić, D.; Klein, D. J.; Lukovits, I.; Nikolić, S.; and Trinajstić, N. "Resistance-Distance Matrix: A Computational Algorithm
and Its Applications." Int. J. Quant. Chem.90, 166-176, 2002.Balaban,
A. T. "Distance Connectivity Index." Chem. Phys. Lett.89,
399-404, 1982.Devillers, J. and Balaban, A. T. (Eds.). Topological
Indices and Related Descriptors in QSAR and QSPR. Amsterdam, Netherlands:
Gordon and Breach, pp. 117-119, 1999.Mercader, E.; Castro, E. A.;
and Toropov, A. A. "Maximum Topological Distances Based Indices as Molecular
Descriptors for QSPR. 4. Modeling the Enthalpy of Formation of Hydrocarbons from
Elements." Int. J. Mol. Sci.2, 121-132, 2001.Randić,
M. "Characterization of Molecular Branching." J. Am. Chem. Soc.97,
6609-6615, 1975.