balaban_j_index#
- skfp.descriptors.balaban_j_index(mol: Mol, distance_matrix: ndarray | None = None) float #
Balaban’s J Index.
Calculates the Balaban’s J index [1], defined as a measure of molecular connectivity with an emphasis on cyclic structures. The formula for calculating Balaban’s J Index is given as:
\[J = \frac{M}{μ + 1} \cdot \frac{Σ_{ij} (d_{ij})^{-1}}{n},\]where:
\(M\) is the number of bonds
\(μ\) is the cyclomatic number (number of independent cycles)
\(d_{ij}\) is the distance between atoms \(i\) and \(j\)
\(n\) is the number of atoms
- Parameters:
mol (RDKit
Mol
object) – The molecule for which the Balaban’s J index is to be calculated.distance_matrix (np.ndarray, optional) – Precomputed distance matrix. If not provided, it will be calculated by RDKit.
References
Examples
>>> from rdkit.Chem import MolFromSmiles >>> from skfp.descriptors import balaban_j_index >>> mol = MolFromSmiles("C1=CC=CC=C1") # Benzene >>> balaban_j_index(mol) 3.000000000000001