diameter#

skfp.descriptors.diameter(mol: Mol, distance_matrix: ndarray | None = None) int#

Diameter.

Calculates the diameter [1], defined as the maximum length of the shortest path.

Parameters:
  • mol (RDKit Mol object) – The molecule for which the diameter is to be calculated.

  • distance_matrix (np.ndarray, optional) – Precomputed distance matrix. If not provided, it will be calculated.

References

Examples

>>> from rdkit.Chem import MolFromSmiles
>>> from skfp.descriptors import diameter
>>> mol = MolFromSmiles("C1=CC=CC=C1")  # Benzene
>>> diameter(mol)
3